diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 16:24:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 16:24:27 +0000 |
commit | 6c18848a903eb3ee06dccd915859ce64195c257c (patch) | |
tree | ea0fe36eb5e6f40e0a1f765d44c4b0c0b2bfb089 /completions/cpio | |
parent | Initial commit. (diff) | |
download | bash-completion-6c18848a903eb3ee06dccd915859ce64195c257c.tar.xz bash-completion-6c18848a903eb3ee06dccd915859ce64195c257c.zip |
Adding upstream version 1:2.11.upstream/1%2.11
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'completions/cpio')
-rw-r--r-- | completions/cpio | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/completions/cpio b/completions/cpio new file mode 100644 index 0000000..d6fde0c --- /dev/null +++ b/completions/cpio @@ -0,0 +1,78 @@ +# bash completion for cpio -*- shell-script -*- + +_cpio() +{ + local cur prev words cword split + _init_completion -s -n : || return + + # --name value style option + case $prev in + --format | -!(-*)H) + COMPREPLY=($(compgen -W \ + 'bin odc newc crc tar ustar hpbin hpodc' -- "$cur")) + return + ;; + --file | --pattern-file | -!(-*)[EFI]) + _filedir + return + ;; + --owner | -!(-*)R) + _usergroup + return + ;; + --rsh-command) + compopt -o filenames + COMPREPLY=($(compgen -c -- "$cur")) + return + ;; + esac + + $split && return + + if ((cword == 1)); then + COMPREPLY=($(compgen -W '-o --create -i --extract -p --pass-through + -? --help --license --usage --version' -- "$cur")) + else + case ${words[1]} in + -o | --create) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '-0 -a -c -v -A -B -L -V -C -H -M + -O -F --file --format --message --null + --reset-access-time --verbose --dot --append + --block-size --dereference --io-size --quiet + --force-local --rsh-command --help --version' \ + -- "$cur")) + fi + ;; + -i | --extract) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '-b -c -d -f -m -n -r -t -s -u -v + -B -S -V -C -E -H -M -R -I -F --file --make-directories + --nonmatching --preserve-modification-time + --numeric-uid-gid --rename --list --swap-bytes --swap + --dot --unconditional --verbose --block-size + --swap-halfwords --io-size --pattern-file --format + --owner --no-preserve-owner --message --force-local + --no-absolute-filenames --sparse --only-verify-crc + --quiet --rsh-command --help --to-stdout --version' \ + -- "$cur")) + fi + ;; + -p* | --pass-through) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '-0 -a -d -l -m -u -v -L -V -R + --null --reset-access-time --make-directories --link + --quiet --preserve-modification-time --unconditional + --verbose --dot --dereference --owner + --no-preserve-owner --sparse --help --version' \ + -- "$cur")) + else + _filedir -d + fi + ;; + esac + fi +} && + complete -F _cpio cpio + +# ex: filetype=sh |