summaryrefslogtreecommitdiff
path: root/Completion/Unix/Command/_head
diff options
context:
space:
mode:
authorAxel Beckert <abe@deuxchevaux.org>2022-04-11 00:17:48 +0200
committerAxel Beckert <abe@deuxchevaux.org>2022-04-11 00:17:48 +0200
commitb09f4483416c54c1782824633dfabaf2ec0265b6 (patch)
tree304bc82642862525ae680c7fbaa249663b10ad57 /Completion/Unix/Command/_head
parent12eb3e5356f2fc3351eed58ef1cef1b8fb83b504 (diff)
parent6e55c920503071e917619b8cb1a188cd35d772db (diff)
downloadzsh-b09f4483416c54c1782824633dfabaf2ec0265b6.tar.gz
zsh-b09f4483416c54c1782824633dfabaf2ec0265b6.zip
New upstream version 5.8.1.2-test
Diffstat (limited to 'Completion/Unix/Command/_head')
-rw-r--r--Completion/Unix/Command/_head30
1 files changed, 15 insertions, 15 deletions
diff --git a/Completion/Unix/Command/_head b/Completion/Unix/Command/_head
index 1e968cc11..0771b1e4d 100644
--- a/Completion/Unix/Command/_head
+++ b/Completion/Unix/Command/_head
@@ -18,7 +18,13 @@ else
case $OSTYPE in
(freebsd*|darwin*|dragonfly*|netbsd*)
args+=( '(-n)-c+[display the first specified bytes]:number of bytes' )
- ;;
+ ;|
+ dragonfly*|netbsd*)
+ args+=(
+ '(-v)-q[never print headers giving file names]'
+ '(-q)-v[always print headers giving file names]'
+ )
+ ;;
esac
fi
@@ -26,20 +32,14 @@ _arguments -C -s -S $opts : $args '*:file:_files' && return 0
case $state in
(number)
- local mlt sign digit
- mlt='multiplier:multiplier:((b\:512 K\:1024 KB\:1000 M\:1024\^2'
- mlt+=' MB\:1000\^2 G\:1024\^3 GB\:1000\^3 T\:1024\^4 TB\:1000\^4))'
- sign='sign:sign:((-\:"print all but the last specified bytes/lines"'
- sign+=' +\:"print the first specified bytes/lines (default)"))'
- digit='digits:digit:(0 1 2 3 4 5 6 7 8 9)'
- if compset -P '(-|+|)[0-9]##'; then
- _alternative $mlt $digit && ret=0
- elif [[ -z $PREFIX ]]; then
- _alternative $sign $digit && ret=0
- elif compset -P '(+|-)'; then
- _alternative $digit && ret=0
- fi
- ;;
+ local alts
+ [[ -z $PREFIX ]] && alts=(
+ 'sign:sign:((-\:"print all but the last specified bytes/lines" +\:"print the first specified bytes/lines (default)"))'
+ )
+ compset -P '+'
+ alts+=( 'numbers: :_numbers -N $state_descr b\:512 K\:1024 KB\:1000 M\:1024\^2 MB\:1000\^2 G\:1024\^3 GB\:1000\^3 T\:1024\^4 TB\:1000\^4' )
+ _alternative $alts && ret=0
+ ;;
esac
return ret