diff --git a/README.md b/README.md index 07d9dce..0237899 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ AHK_X11 can be used completely without a terminal. You can however if you want u
CLICK TO SEE WHICH COMMANDS ARE IMPLEMENTED AND WHICH ARE MISSING. Note however that this is not very representative. For example, no `Gui` sub command is included in the listing. For a better overview on what is already done, skim through the FULL DOCUMENTATION HERE. ```diff -DONE ?% (122/220): +DONE ?% (123/220): + Else, { ... }, Break, Continue, Return, Exit, GoSub, GoTo, IfEqual, Loop, SetEnv, Sleep, FileCopy, + SetTimer, WinActivate, MsgBox, Gui, SendRaw, #Persistent, ExitApp, + EnvAdd, EnvSub, EnvMult, EnvDiv, ControlSendRaw, IfWinExist/IfWinNotExist, SetWorkingDir, @@ -72,7 +72,8 @@ DONE ?% (122/220): + PixelSearch, #Include, InputBox, ClipWait, EnvSet, SetKeyDelay, SetMouseDelay, MouseClickDrag, + #NoTrayIcon, TrayTip, Random, Shutdown, RunAs, SoundGet, SoundSet, SoundPlay, Sort, + StringTrimLeft, StringTrimRight, WinMinimizeAll, WinMinimizeAllUndo, WinSetTitle, WinWait, -+ WinWaitClose, WinWaitActive, WinWaitNotActive, DriveSpaceFree, FileGetSize, FileRecycle ++ WinWaitClose, WinWaitActive, WinWaitNotActive, DriveSpaceFree, FileGetSize, FileRecycle, ++ FileRecycleEmpty NEW ?% (9/220): (not part of spec or from a more recent version) @@ Echo, ahk_x11_print_vars, FileRead, RegExGetPos, RegExReplace, EnvGet, Click @@ @@ -87,13 +88,13 @@ REMOVED ?% (11/220): # AutoTrim: It's always Off. It would not differentiate between %a_space% and %some_var%. # It's possible but needs significant work. -TO DO ?% (74/220): alphabetically +TO DO ?% (73/220): alphabetically - BlockInput, Control, ControlFocus, ControlGet, ControlGetFocus, - ControlMove, - DetectHiddenText, DetectHiddenWindows, Drive, DriveGet, - FileCopyDir, FileCreateShortcut, - FileInstall, FileGetAttrib, FileGetShortcut, FileGetTime, FileGetVersion, -- FileMove, FileMoveDir, FileRecycleEmpty, FileRemoveDir, +- FileMove, FileMoveDir, FileRemoveDir, - FormatTime, GroupActivate, GroupAdd, - GroupClose, GroupDeactivate, GuiControlGet, - If var is [not] type, diff --git a/docs/index.html b/docs/index.html index 012d621..31a0e27 100644 --- a/docs/index.html +++ b/docs/index.html @@ -144,7 +144,7 @@

Table of contents

FileRecycle
  • - FileRecycleEmpty + FileRecycleEmpty
  • FileRemoveDir @@ -2227,7 +2227,7 @@

    The "Last Found" Window

    Sends a file or directory to the recycle bin, if possible. - FileRecycleEmpty + FileRecycleEmpty Empties the recycle bin. @@ -4047,15 +4047,15 @@

    The "Last Found" Window

    -
    +
    - #

    FileRecycleEmpty

    [v1.0.09+] + #

    FileRecycleEmpty


    Empties the recycle bin.

    - +
    FileRecycleEmpty [, DriveLetter]FileRecycleEmpty [, DriveLetter]
    @@ -4063,7 +4063,7 @@

    The "Last Found" Window

    Parameters

    - + @@ -4074,14 +4074,14 @@

    The "Last Found" Window

    ErrorLevel is set to 1 if there was a problem or 0 otherwise.

     

    Remarks

    -

    This commands requires MS Internet Explorer 4 or greater to be installed.

    +

    This commands requires MS Internet Explorer 4 or greater to be installed.

     

    Related

    FileRecycle, FileDelete, FileCopy, FileMove

     

    Example

    -

    FileRecycleEmpty, C:\
    +

    FileRecycleEmpty

    diff --git a/src/cmd/file/file-recycle-empty.cr b/src/cmd/file/file-recycle-empty.cr new file mode 100644 index 0000000..cd80f47 --- /dev/null +++ b/src/cmd/file/file-recycle-empty.cr @@ -0,0 +1,10 @@ +# FileRecycleEmpty [, DriveLetter] +class Cmd::File::FileRecycleEmpty < Cmd::Base + def self.min_args; 0 end + def self.max_args; 1 end + def self.sets_error_level; true end + def run(thread, args) + status = Process.run("rm -rf ${XDG_DATA_HOME:-$HOME/.local/share}/Trash/*", shell: true).exit_code + status == 0 ? "0" : "1" + end +end \ No newline at end of file
    DriveLetter If omitted, the recycle bin for all drives is emptied. Otherwise, specify a drive letter such as C:\