Skip to content

Commit

Permalink
cpio: Cleanups.
Browse files Browse the repository at this point in the history
  • Loading branch information
scop committed Feb 17, 2013
1 parent 0837ad0 commit e1a0759
Showing 1 changed file with 26 additions and 39 deletions.
65 changes: 26 additions & 39 deletions completions/cpio
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
# bash completion for cpio -*- shell-script -*-

_cpio_format()
{
COMPREPLY=( $( compgen -W 'bin odc newc crc tar ustar hpbin hpodc' -- "$cur" ) )
}

_cpio()
{
local cur prev words cword split
Expand All @@ -13,7 +8,8 @@ _cpio()
# --name value style option
case $prev in
-H|--format)
_cpio_format
COMPREPLY=( $( compgen -W \
'bin odc newc crc tar ustar hpbin hpodc' -- "$cur" ) )
return 0
;;
-E|-F|-I|--file|--pattern-file)
Expand All @@ -34,51 +30,42 @@ _cpio()
$split && return 0

if [[ $cword -eq 1 ]]; then
COMPREPLY=( $( compgen -W '-o --create -i --extract -p --pass-through \
-? --help --license --usage --version' -- "$cur" ) )
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" ) )
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 -t --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" ) )
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" ) )
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
Expand Down

0 comments on commit e1a0759

Please sign in to comment.