summaryrefslogtreecommitdiffstats
path: root/completions/cpio
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:03:18 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:03:18 +0000
commitf2621414ee5f2f601424c22f00e207903e3b6104 (patch)
tree56a856dafd1ca684bb23263cacaa723ee4f404fc /completions/cpio
parentAdding debian version 1:2.11-8. (diff)
downloadbash-completion-f2621414ee5f2f601424c22f00e207903e3b6104.tar.xz
bash-completion-f2621414ee5f2f601424c22f00e207903e3b6104.zip
Merging upstream version 1:2.12.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'completions/cpio')
-rw-r--r--completions/cpio63
1 files changed, 30 insertions, 33 deletions
diff --git a/completions/cpio b/completions/cpio
index d6fde0c..e7b70cd 100644
--- a/completions/cpio
+++ b/completions/cpio
@@ -1,78 +1,75 @@
# bash completion for cpio -*- shell-script -*-
-_cpio()
+_comp_cmd_cpio()
{
- local cur prev words cword split
- _init_completion -s -n : || return
+ local cur prev words cword was_split comp_args
+ _comp_initialize -s -n : -- "$@" || return
# --name value style option
+ local noargopts='!(-*|*[HEFIR]*)'
+ # shellcheck disable=SC2254
case $prev in
- --format | -!(-*)H)
- COMPREPLY=($(compgen -W \
- 'bin odc newc crc tar ustar hpbin hpodc' -- "$cur"))
+ --format | -${noargopts}H)
+ _comp_compgen -- -W 'bin odc newc crc tar ustar hpbin hpodc'
return
;;
- --file | --pattern-file | -!(-*)[EFI])
- _filedir
+ --file | --pattern-file | -${noargopts}[EFI])
+ _comp_compgen_filedir
return
;;
- --owner | -!(-*)R)
- _usergroup
+ --owner | -${noargopts}R)
+ _comp_compgen_usergroups
return
;;
--rsh-command)
- compopt -o filenames
- COMPREPLY=($(compgen -c -- "$cur"))
+ _comp_compgen_commands
return
;;
esac
- $split && return
+ [[ $was_split ]] && return
if ((cword == 1)); then
- COMPREPLY=($(compgen -W '-o --create -i --extract -p --pass-through
- -? --help --license --usage --version' -- "$cur"))
+ _comp_compgen -- -W '-o --create -i --extract -p --pass-through -?
+ --help --license --usage --version'
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"))
+ _comp_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'
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
+ _comp_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"))
+ --quiet --rsh-command --help --to-stdout --version'
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"))
+ _comp_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'
else
- _filedir -d
+ _comp_compgen_filedir -d
fi
;;
esac
fi
} &&
- complete -F _cpio cpio
+ complete -F _comp_cmd_cpio cpio
# ex: filetype=sh