diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 09:14:42 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 09:14:42 +0000 |
commit | 0bc58b66a4850cdb8458a86c3d9a2fc81de82aa3 (patch) | |
tree | ea0fe36eb5e6f40e0a1f765d44c4b0c0b2bfb089 /completions/file | |
parent | Initial commit. (diff) | |
download | bash-completion-0bc58b66a4850cdb8458a86c3d9a2fc81de82aa3.tar.xz bash-completion-0bc58b66a4850cdb8458a86c3d9a2fc81de82aa3.zip |
Adding upstream version 1:2.11.upstream/1%2.11upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | completions/file | 32 | ||||
-rw-r--r-- | completions/file-roller | 42 | ||||
-rw-r--r-- | completions/filefrag | 17 | ||||
-rw-r--r-- | completions/filesnarf | 22 |
4 files changed, 113 insertions, 0 deletions
diff --git a/completions/file b/completions/file new file mode 100644 index 0000000..21fbd16 --- /dev/null +++ b/completions/file @@ -0,0 +1,32 @@ +# file(1) completion -*- shell-script -*- + +_file() +{ + local cur prev words cword + _init_completion || return + + case $prev in + --help | --version | --separator | -!(-*)[vF]) + return + ;; + --magic-file | --files-from | -!(-*)[mf]) + _filedir + return + ;; + --exclude | -!(-*)e) + COMPREPLY=($(compgen -W 'apptype ascii cdf compress elf encoding + soft tar text tokens troff' -- "$cur")) + return + ;; + esac + + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + return + fi + + _filedir +} && + complete -F _file file + +# ex: filetype=sh diff --git a/completions/file-roller b/completions/file-roller new file mode 100644 index 0000000..1d223fd --- /dev/null +++ b/completions/file-roller @@ -0,0 +1,42 @@ +# file-roller(1) completion -*- shell-script -*- + +_file_roller() +{ + local cur prev words cword split + _init_completion -s || return + + local exts='@(7z|ace|alz|ar|arj|[bglx]z|bz2|tb?(z)2|cab|cb[rz]|iso?(9660)|Z|t[abglx]z|cpio|deb|rar|?(g)tar|gem|lh[az]|lz[4h]|?(t)lrz|lzma|lzo|wim|swm|rpm|sit|zoo)' + + case $prev in + --help | --help-all | --help-gtk | --help-sm-client | -!(-*)'?') + return + ;; + --sm-client-state-file) + _filedir + return + ;; + --add-to | -!(-*)a) + _filedir_xspec unzip + _filedir "$exts" + return + ;; + --extract-to | --default-dir | -!(-*)e) + _filedir -d + return + ;; + esac + + $split && return + + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1" --help-all)' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace + return + fi + + _filedir_xspec unzip + _filedir "$exts" +} && + complete -F _file_roller file-roller + +# ex: filetype=sh diff --git a/completions/filefrag b/completions/filefrag new file mode 100644 index 0000000..d26e8c8 --- /dev/null +++ b/completions/filefrag @@ -0,0 +1,17 @@ +# filefrag(8) completion -*- shell-script -*- + +_filefrag() +{ + local cur prev words cword + _init_completion || return + + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1")' -- "$cur")) + return + fi + + _filedir +} && + complete -F _filefrag filefrag + +# ex: filetype=sh diff --git a/completions/filesnarf b/completions/filesnarf new file mode 100644 index 0000000..f959d80 --- /dev/null +++ b/completions/filesnarf @@ -0,0 +1,22 @@ +# filesnarf etc completion -*- shell-script -*- + +_snarf() +{ + local cur prev words cword + _init_completion || return + + case $prev in + -i) + _available_interfaces -a + return + ;; + esac + + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1")' -- "$cur")) + fi + +} && + complete -F _snarf filesnarf mailsnarf msgsnarf + +# ex: filetype=sh |