diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 219c24481..1a1b588cd 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -44,7 +44,8 @@ Completions - ``otool`` - ``mix phx`` - ``neovim`` - + - ``trash`` and helper utilities ``trash-empty``, ``trash-list``, ``trash-put``, ``trash-restore`` + - git's completion for ``git-foo``-style commands was fixed (:issue:`9457`) - File completion now offers ``../`` and ``./`` again (:issue:`9477`) diff --git a/share/completions/trash-empty.fish b/share/completions/trash-empty.fish new file mode 100644 index 000000000..a24ed698f --- /dev/null +++ b/share/completions/trash-empty.fish @@ -0,0 +1,13 @@ +# Completions for trash-cli +# There are many implementations of trash cli tools, but the name ``trash-empty`` is unique. + +# https://github.com/andreafrancia/trash-cli +complete -f -c trash-empty -s h -l help -d 'show help message' +complete -f -c trash-empty -l print-completion -xa 'bash zsh tcsh' -d 'print shell completion script' +complete -f -c trash-empty -l version -d 'show version number' +complete -f -c trash-empty -s v -l verbose -d 'list files that will be deleted' +complete -F -c trash-empty -l trash-dir -d 'specify trash directory' +complete -f -c trash-empty -l all-users -d 'empty trashcan of all users' +complete -f -c trash-empty -s i -l interactive -d 'prompt before emptying' +complete -f -c trash-empty -s f -d 'don\'t ask before emptying' +complete -f -c trash-empty -l dry-run -d 'show which files would have been removed' diff --git a/share/completions/trash-list.fish b/share/completions/trash-list.fish new file mode 100644 index 000000000..33ec24f25 --- /dev/null +++ b/share/completions/trash-list.fish @@ -0,0 +1,10 @@ +# Completions for trash-cli +# There are many implementations of trash cli tools, but the name ``trash-list`` is unique. + +# https://github.com/andreafrancia/trash-cli +complete -f -c trash-list -s h -l help -d 'show help message' +complete -f -c trash-list -l print-completion -xa 'bash zsh tcsh' -d 'print completion script' +complete -f -c trash-list -l version -d 'show version number' +complete -f -c trash-list -l trash-dirs -d 'list trash dirs' +complete -f -c trash-list -l trash-dir -d 'specify trash directory' +complete -f -c trash-list -l all-users -d 'list trashcans of all users' diff --git a/share/completions/trash-put.fish b/share/completions/trash-put.fish new file mode 100644 index 000000000..e7a63a1f7 --- /dev/null +++ b/share/completions/trash-put.fish @@ -0,0 +1,13 @@ +# Completions for trash-cli +# There are many implementations of trash cli tools, but the name ``trash-put`` is unique. + +# https://github.com/andreafrancia/trash-cli +complete -f -c trash-put -s h -l help -d 'show help message' +complete -f -c trash-put -l print-completion -xa 'bash zsh tcsh' -d 'print shell completion script' +complete -f -c trash-put -s d -l directory -d 'ignored (for GNU rm compatibility)' +complete -f -c trash-put -s f -l force -d 'silently ignore nonexistent files' +complete -f -c trash-put -s i -l interactive -d 'prompt before every removal' +complete -f -c trash-put -s r -s R -l recursive -d 'ignored (for GNU rm compatibility)' +complete -F -c trash-put -l trash-dir -d 'specify trash folder' +complete -f -c trash-put -s v -l verbose -d 'be verbose' +complete -f -c trash-put -l version -d 'show version number' diff --git a/share/completions/trash-restore.fish b/share/completions/trash-restore.fish new file mode 100644 index 000000000..a3cb0dd83 --- /dev/null +++ b/share/completions/trash-restore.fish @@ -0,0 +1,8 @@ +# Completions for trash-cli +# There are many implementations of trash cli tools, but the name ``trash-restore`` is unique. + +# https://github.com/andreafrancia/trash-cli +complete -f -c trash-restore -s h -l help -d 'show help message' +complete -f -c trash-restore -l print-completion -xa 'bash zsh tcsh' -d 'print shell completion script(default: None)' +complete -f -c trash-restore -l sort -a 'date path none' -d 'sort candidates(default: date)' +complete -f -c trash-restore -l version -d 'show version number' diff --git a/share/completions/trash.fish b/share/completions/trash.fish new file mode 100644 index 000000000..98d4e520f --- /dev/null +++ b/share/completions/trash.fish @@ -0,0 +1,19 @@ +# Completions for trash-cli +# There are many implementations of trash cli tools, identify different version of ``trash`` excutable by its help message. + +# https://github.com/andreafrancia/trash-cli +function __trash_by_andreafrancia + complete -f -c trash -s h -l help -d 'show help message' + complete -f -c trash -l print-completion -xa 'bash zsh tcsh' -d 'print shell completion script' + complete -f -c trash -s d -l directory -d 'ignored (for GNU rm compatibility)' + complete -f -c trash -s f -l force -d 'silently ignore nonexistent files' + complete -f -c trash -s i -l interactive -d 'prompt before every removal' + complete -f -c trash -s r -s R -l recursive -d 'ignored (for GNU rm compatibility)' + complete -F -c trash -l trash-dir -d 'specify trash folder' + complete -f -c trash -s v -l verbose -d 'be verbose' + complete -f -c trash -l version -d 'show version number' +end + +if string match -qr "https://github.com/andreafrancia/trash-cli" (trash --help 2>/dev/null) + __trash_by_andreafrancia +end