summaryrefslogtreecommitdiff
path: root/Completion/Unix/Command/_od
diff options
context:
space:
mode:
authorAxel Beckert <abe@deuxchevaux.org>2015-05-05 23:32:59 +0200
committerAxel Beckert <abe@deuxchevaux.org>2015-05-05 23:58:59 +0200
commitdb38e167634b6c2217eec3a5aafc37c46d9e5a8d (patch)
treedaa342d423febbd3a5a7ef97053037677fab004a /Completion/Unix/Command/_od
parent01eea47617a6e06debdb4330f92ae69f92089fd2 (diff)
parent3c3c8d3d13fd4cf6c03f81ca8dc18a1efd561728 (diff)
downloadzsh-db38e167634b6c2217eec3a5aafc37c46d9e5a8d.tar.gz
zsh-db38e167634b6c2217eec3a5aafc37c46d9e5a8d.zip
Merge branch 'upstream' into debian
Diffstat (limited to 'Completion/Unix/Command/_od')
-rw-r--r--Completion/Unix/Command/_od28
1 files changed, 20 insertions, 8 deletions
diff --git a/Completion/Unix/Command/_od b/Completion/Unix/Command/_od
index d542597e0..db75b3f96 100644
--- a/Completion/Unix/Command/_od
+++ b/Completion/Unix/Command/_od
@@ -1,6 +1,6 @@
-#compdef od
+#compdef od god
-local context state state_descr line args ret=1
+local curcontext="$curcontext" state state_descr line args ret=1
local -A opt_args
args=(
@@ -19,13 +19,14 @@ args=(
{-l,-I,-L}'[output decimal longs (-t dL)]'
{-o,-B}'[output octal shorts (-t o2)]'
'-s[output decimal shorts (-t d2)]'
- '*:files:_files'
)
if _pick_variant gnu=GNU unix --version; then
# -h -B -I and -L are obsolescent and undocumented
args=( ${(R)args:#(|\*)(|\(*\))-[hBIL]*} )
args+=(
+ '--traditional'
+ '--endian=[swap input bytes]:endianess:(big little)'
{-S+,--strings=-}'[output strings of at least specfied bytes long]:length'
{-w-,--width=-}'[output specified bytes per line]:bytes'
'(- : *)--help[display help and exit]'
@@ -34,22 +35,33 @@ if _pick_variant gnu=GNU unix --version; then
else
args=( ${(R)args:#(|\*)(|\(*\))--*} ) # remove long options
case "$OSTYPE" in
- (darwin*|freebsd*|dragonfly*|openbsd*)
+ darwin*|freebsd*|dragonfly*|openbsd*)
args+=(
- '-D[output unsigned decimal ints (-t u4)]'
+ '-D[output unsigned decimal integers (-t u4)]'
{-e,-F}'[output double-precision floats (-t fD)]'
{-H,-X}'[output hexadecimal ints (-t x4)]'
'-O[output octal ints (-t o4)]'
)
- ;;
+ ;;
+ solaris*)
+ args=(
+ ${(M)args:#(|\*)(|\(*\))-[AjNtvbcdfosx]*}
+ '-C[output all printable characters and use C-style escapes]'
+ '-D[output unsigned decimal long words (-t u4)]'
+ '-F[output double-precision floats (-t f8)]'
+ '-O[output octal ints (-t o4)]'
+ '-S[output decimal ints (-t d4)]'
+ '-X[output hexadecimal ints (-t x4)]'
+ )
+ ;;
(*)
# POSIX options only
args=( ${(M)args:#(|\*)(|\(*\))-[AjNtvbcdosx]*} )
- ;;
+ ;;
esac
fi
-_arguments -s -S : "$args[@]" && return 0
+_arguments -C -s -S : "$args[@]" '*:files:_files' && return 0
case "$state" in
(format)