summary refs log tree commit diff
path: root/Completion/Unix/Command
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Unix/Command')
-rw-r--r--Completion/Unix/Command/_du12
-rw-r--r--Completion/Unix/Command/_ecasound28
-rw-r--r--Completion/Unix/Command/_ffmpeg36
-rw-r--r--Completion/Unix/Command/_ln25
-rw-r--r--Completion/Unix/Command/_mail6
-rw-r--r--Completion/Unix/Command/_mosh3
-rw-r--r--Completion/Unix/Command/_mysqldiff3
-rw-r--r--Completion/Unix/Command/_od4
-rw-r--r--Completion/Unix/Command/_pgrep4
-rw-r--r--Completion/Unix/Command/_pydoc23
-rw-r--r--Completion/Unix/Command/_ri4
-rw-r--r--Completion/Unix/Command/_su20
12 files changed, 88 insertions, 80 deletions
diff --git a/Completion/Unix/Command/_du b/Completion/Unix/Command/_du
index 9ae6e9cb3..8b053ba4d 100644
--- a/Completion/Unix/Command/_du
+++ b/Completion/Unix/Command/_du
@@ -1,7 +1,7 @@
 #compdef du
 
 if _pick_variant gnu=Free\ Soft unix --version /dummy/no-such-file; then
-  local ret=1
+  local context state line expl ret=1
 
   _arguments -s \
     '(-a --all -s --summarize)'{-a,--all}'[write counts for all files]' \
@@ -24,7 +24,7 @@ if _pick_variant gnu=Free\ Soft unix --version /dummy/no-such-file; then
     \*{-X+,--exclude-from=}'[exclude files matching any pattern in file]:file:_files' \
     '*--exclude=[exclude files matching pattern]:pattern' \
     '(-s --summarize)--max-depth=[maximum levels to recurse]:levels' \
-    '--files0-from=[use NUL-terminated list of files from file]:file' \
+    '--files0-from=[use NUL-terminated list of files from file]:file:_files' \
     '--time-style=[show times using given style, +FORMAT for strftime formatted args]:style:->timestyle' \
     '--time=-[show time of last modification of any file in the directory]:property:->time' \
     '(* -)--help[display help information]' \
@@ -35,14 +35,14 @@ if _pick_variant gnu=Free\ Soft unix --version /dummy/no-such-file; then
     (time)
       local -a property
       property=(atime access use ctime status)
-      _wanted property expl property compadd -a property && ret=0
-      ;;
+      _wanted -C $context property expl property compadd -a property && ret=0
+    ;;
     (timestyle)
       local -a style desc
       style=(full-iso long-iso iso +)
       desc=('full-iso' 'long-iso' 'iso' '+FORMAT like `date'\''')
-      _wanted -V style expl style compadd -d desc -a style && ret=0
-      ;;
+      _wanted -C $context -V style expl style compadd -d desc -a style && ret=0
+    ;;
   esac
 
   return ret
diff --git a/Completion/Unix/Command/_ecasound b/Completion/Unix/Command/_ecasound
index e31b072f9..7ad08d0e1 100644
--- a/Completion/Unix/Command/_ecasound
+++ b/Completion/Unix/Command/_ecasound
@@ -1,9 +1,9 @@
 #compdef ecasound
 
-local curcontext="$curcontext" state line expl
+local curcontext="$curcontext" state line expl ret=1
 typeset -A opt_args
 
-_arguments \
+_arguments -C \
   '-c[start in interactive mode]' \
   '(-q)-d\:-[debug level]:debug level' \
   '-D[print all debug information to stderr]' \
@@ -53,7 +53,7 @@ _arguments \
   '*-eli\:-[LADSPA Plugin]: :->el' \
   '*-gc\:-[time crop gate]: :->gc' \
   '*-ge\:-[threshold gate]: :->ge' \
-  && return 0
+  ':input source:->io' && ret=0
 
 case $state in
   filters)
@@ -82,12 +82,12 @@ case $state in
       'r[reverb effect]: :->etr'
   ;;
   emod)
-    _values -S : 'envelopme modulation' \
+    _values -S : 'envelope modulation' \
       'b[pulse gate]: :->eemb' \
       'p[pulse gate (hz)]: :->eemp' \
       't[tremolo effect]: :->eemt'
   ;;
-esac
+esac && ret=0
 
 case $state in
   b)
@@ -173,12 +173,12 @@ case $state in
     typeset -A msgs
     local str
     msgs=(
-      eac  'amplification value (percent):channel'								     				  
-      eaw  'amplification value (percent):channel:max-clipped-samples'						     				  
-      ec   'compression rate (decibels):threshold (0.0-1.0)'							     				  
-      eca  'peak-level:release-time (seconds):fast compression rate (0.0-1.0):compression rate'		     				  
-      enm  'threshold-level:pre-hold-time (msec):attack-time (msec):post-hold-time (msec):release-time (msec)'     				  
-      ezx  'left DC fix value:right CD fix value'								     				  
+      eac  'amplification value (percent):channel'
+      eaw  'amplification value (percent):channel:max-clipped-samples'
+      ec   'compression rate (decibels):threshold (0.0-1.0)'
+      eca  'peak-level:release-time (seconds):fast compression rate (0.0-1.0):compression rate'
+      enm  'threshold-level:pre-hold-time (msec):attack-time (msec):post-hold-time (msec):release-time (msec)'
+      ezx  'left DC fix value:right CD fix value'
       eemb 'pulse frequency (beats per minute):on time (msec)'
       eemp 'pulse frequency (hz):on time (percent)'
       eemt 'tremolo speed (beats per second):depth (percent)'
@@ -206,5 +206,7 @@ case $state in
       str="${str#*:}"
     done
     _message "${str%%:*}"
-  ;;      
-esac
+  ;;
+esac && ret=0
+
+return ret
diff --git a/Completion/Unix/Command/_ffmpeg b/Completion/Unix/Command/_ffmpeg
index 6a4ba234d..d68a094d4 100644
--- a/Completion/Unix/Command/_ffmpeg
+++ b/Completion/Unix/Command/_ffmpeg
@@ -1,6 +1,6 @@
 #compdef ffmpeg
 
-local context state line expl
+local curcontext="$curcontext" state line expl
 typeset -A opt_args
 
 (( $+functions[_ffmpeg_presets] )) || _ffmpeg_presets() {
@@ -33,14 +33,10 @@ typeset -A opt_args
     _wanted ffmpeg-formats expl 'force format' compadd -a formats
 }
 
-(( $+functions[_ffmpeg_list_pix_fmts] )) || _ffmpeg_list_pix_fmts() {
-    echo - ${${${(M)${(f)"$(_call_program formats $words[1] -pix_fmts 2>/dev/null)"}:#[I.][O.][H.][P.][B.] [^=[:space:]]*}#* }%% *}
-}
-
 (( $+functions[_ffmpeg_pix_fmts] )) || _ffmpeg_pix_fmts() {
     local pix_fmts
-    pix_fmts=($(_ffmpeg_list_pix_fmts))
-    _wanted ffmpeg-pix-fmts expl 'set pixel format' compadd -a pix_fmts
+    _wanted ffmpeg-pix-fmts expl 'pixel format' compadd "$@" - \
+        ${${${(M)${(f)"$(_call_program formats $words[1] -pix_fmts 2>/dev/null)"}:#[I.][O.][H.][P.][B.] [^=[:space:]]*}#* }%% *}
 }
 
 (( $+functions[_ffmpeg_bsfs] )) || _ffmpeg_bsfs() {
@@ -71,10 +67,10 @@ typeset -A _ffmpeg_flags
     local match mbegin mend
     integer ret=1
 
-    if [[ $PREFIX = (#b)(*)[-+]([^-+]#) ]]; then 
+    if [[ $PREFIX = (#b)(*)[-+]([^-+]#) ]]; then
         if [[ -n ${flag_options[(R)$match[2]]} ]]; then
             _ffmpeg_new_flag_options && ret=0
-        fi 
+        fi
         if [[ -n ${flag_options[(R)$match[2]?*]} ]]; then
             _ffmpeg_more_flag_options ${#match[1]} && ret=0
         fi
@@ -82,7 +78,7 @@ typeset -A _ffmpeg_flags
         _ffmpeg_flag_options && ret=0
     fi
 
-    return $ret
+    return ret
 }
 
 (( $+functions[_ffmpeg_register_lastopt_values] )) || _ffmpeg_register_lastopt_values() {
@@ -150,7 +146,7 @@ local -a _ffmpeg_argspecs
                 elif [[ $lastopt == -pix_fmt ]]; then
                     lastopt_takesargs=0
                     lastopt="*$lastopt"
-                    lastopt+=": :_ffmpeg_pix_fmts"
+                    lastopt+=":set pixel format:_ffmpeg_pix_fmts"
                 elif [[ $example == bitstream_filter ]]; then
                     lastopt_takesargs=0
                     lastopt+=": :_ffmpeg_bsfs"
@@ -175,17 +171,17 @@ local -a _ffmpeg_argspecs
     [[ -n $lastopt ]] && _ffmpeg_register_lastopt_values
 }
 
-_arguments -S \
+_arguments -C -S \
     "${_ffmpeg_argspecs[@]}" \
     '*:output file:_files' \
-    && return 0
+    && return
 
 [[ "$state" == "vfilters" ]] &&
     _values -s , -S = 'video filters' \
     'aspect:set aspect ratio (rational number X\:Y or decimal number):' \
     'crop:crop input video (x\:y\:width\:height):' \
-    'format: :->format' \
-    'noformat: :->noformat' \
+    'format: :_sequence -s : _ffmpeg_pix_fmts' \
+    'noformat: :_sequence -s : _ffmpeg_pix_fmts' \
     'null' \
     'pad:add pads to the input image (width\:height\:x\:y\:color_string):' \
     'pixelaspect:set pixel aspect ratio (rational number X\:Y or decimal number):' \
@@ -196,15 +192,9 @@ _arguments -S \
     'buffer' \
     'nullsrc' \
     'nullsink' \
-    && return 0
-
-[[ "$state" == "format" ]] &&
-    _values -s : -S = 'convert input video to one of the specified pixel formats' $(_ffmpeg_list_pix_fmts) && return 0
-
-[[ "$state" == "noformat" ]] &&
-    _values -s : -S = 'disable specified pixel formats by force' $(_ffmpeg_list_pix_fmts) && return 0
+    && return
 
 [[ -n $state && -n $_ffmpeg_flags[$state] ]] &&
-    _ffmpeg_flags $state && return 0
+    _ffmpeg_flags $state && return
 
 return 1
diff --git a/Completion/Unix/Command/_ln b/Completion/Unix/Command/_ln
index 89b7177ab..12baf76a9 100644
--- a/Completion/Unix/Command/_ln
+++ b/Completion/Unix/Command/_ln
@@ -3,10 +3,17 @@
 local curcontext="$curcontext" state line ret=1
 local -A opt_args
 
-local -a args
+local -a args bsd
 args=(
   '-f[remove existing destination files]'
-  '-s[create symbolic links instead of hard links]')
+  '-s[create symbolic links instead of hard links]'
+)
+bsd=(
+  '-F[remove existing destination directories]'
+  {-h,-n}'[do not dereference destination]'
+  '-i[prompt before removing destination files]'
+  '-v[print name of each linked file]'
+)
 
 local -a opts
 
@@ -44,14 +51,16 @@ elif (( ${+builtins[ln]} )); then
     {-h,-n}'[do not dereference destination]'
     '-i[prompt before removing destination files]')
 elif [[ $OSTYPE == darwin* ]]; then
-  args+=(
-    '-F[remove existing destination directories]'
-    {-h,-n}'[do not dereference destination]'
-    '-i[prompt before removing destination files]'
-    '-v[print name of each linked file]')
+  args+=( $bsd )
+elif [[ $OSTYPE == freebsd* ]]; then
+  args+=( $bsd
+    '(-L)-P[create hard links directly to symbolic links]'
+    '(-P)-L[create hard links to symbolic link references]'
+    "-w[warn if source of a symbolic link doesn't currently exist]"
+  )
 fi
 
-_arguments -s $opts \
+_arguments -C -s $opts \
   $args \
   ':link target:_files' \
   '*:: :->files' && ret=0
diff --git a/Completion/Unix/Command/_mail b/Completion/Unix/Command/_mail
index 90c75359d..d618cf366 100644
--- a/Completion/Unix/Command/_mail
+++ b/Completion/Unix/Command/_mail
@@ -1,9 +1,9 @@
 #compdef mail mailx=mail Mail=mail mush zmail nail=mail
 
 _arguments -s \
-  '(-f -u)*-b[specify a BCC recipient]:BCC recipient:->userhost' \
-  '(-f -u)*-c[specify a CC recipient]:CC recipient:->userhost' \
+  '(-f -u)*-b[specify a BCC recipient]:BCC recipient:_email_addresses -n $service' \
+  '(-f -u)*-c[specify a CC recipient]:CC recipient:_email_addresses -n $service' \
   '(-b -c -u -s *)-f+[specify mail folder]:mailbox:_mailboxes' \
-  '(-f -u)-s+[specify a subject]:subject:' \
+  '(-f -u)-s+[specify a subject]:subject' \
   "(-b -c -f -s *)-u+[read specified user's mail]:user:_users" \
   "(-f -u)*:recipient:_email_addresses -n $service"
diff --git a/Completion/Unix/Command/_mosh b/Completion/Unix/Command/_mosh
index dacbd1018..c19f6ebde 100644
--- a/Completion/Unix/Command/_mosh
+++ b/Completion/Unix/Command/_mosh
@@ -1,9 +1,8 @@
 #compdef mosh
 
 local curcontext="$curcontext" state line
-local -a suf
 
-_arguments \
+_arguments -C \
   '(-)--help[display help information]' \
   '(-)--version[display version information]' \
   "--no-init[don't set terminal init string]" \
diff --git a/Completion/Unix/Command/_mysqldiff b/Completion/Unix/Command/_mysqldiff
index 094694d32..4b46c86df 100644
--- a/Completion/Unix/Command/_mysqldiff
+++ b/Completion/Unix/Command/_mysqldiff
@@ -1,8 +1,5 @@
 #compdef mysqldiff
 
-local curcontext="$curcontext" state line expl
-typeset -A opt_args
-
 _mysqldiff () {
   _arguments -s \
     {-h{,1,2},--host{,1,2}=}':server hostname:_mysql_hosts' \
diff --git a/Completion/Unix/Command/_od b/Completion/Unix/Command/_od
index d542597e0..36a9b7dae 100644
--- a/Completion/Unix/Command/_od
+++ b/Completion/Unix/Command/_od
@@ -1,6 +1,6 @@
 #compdef od
 
-local context state state_descr line args ret=1
+local curcontext="$curcontext" state state_descr line args ret=1
 local -A opt_args
 
 args=(
@@ -49,7 +49,7 @@ else
   esac
 fi
 
-_arguments -s -S : "$args[@]" && return 0
+_arguments -C -s -S : "$args[@]" && return 0
 
 case "$state" in
   (format)
diff --git a/Completion/Unix/Command/_pgrep b/Completion/Unix/Command/_pgrep
index 95d0ea284..3af55a379 100644
--- a/Completion/Unix/Command/_pgrep
+++ b/Completion/Unix/Command/_pgrep
@@ -1,6 +1,6 @@
 #compdef pgrep pkill
 
-local context state line ret=1 expl
+local curcontext="$curcontext" state line ret=1 expl
 typeset -A opt_args
 typeset -a arguments
 
@@ -66,7 +66,7 @@ esac
 arguments=( ${(M)arguments:#(|\*)(|\(*\))-[$optchars]*}
      '*:process name:->pname')
 
-_arguments -s -w $arguments && ret=0
+_arguments -C -s -w $arguments && ret=0
 
 case $state in
   (tty)
diff --git a/Completion/Unix/Command/_pydoc b/Completion/Unix/Command/_pydoc
index 92a01a76f..f85ab0c2d 100644
--- a/Completion/Unix/Command/_pydoc
+++ b/Completion/Unix/Command/_pydoc
@@ -1,16 +1,19 @@
 #compdef pydoc
 
-local context state line
+local context state line ret=1
 typeset -A opt_args
 
 _arguments \
-  '-k[keyword]:keyword:' \
-  '-p[port]:port:_ports' \
-  '-g[gui]' \
-  '-w[write out HTML]:file or dir:_files' \
-  ':keyword, topic, module, package, or dotted reference:->lookup' && return 0
+  '(-)-k[search keyword]:keyword' \
+  '(- *)-p[start web server on specified port]:port number' \
+  '(- *)-g[start gui]' \
+  '(-)-w[write out HTML]:file or dir:_files' \
+  '(- *)-h[show help information]' \
+  '*: :->lookup' && ret=0
 
-_alternative \
-  'keywords:keyword:compadd ${=${${(f)"$(pydoc keywords)"}[2,-1]}}' \
-  'topics:topic:compadd ${=${${(f)"$(pydoc topics)"}[2,-1]}}' \
-  'modules:module:'
+[[ -n $state ]] && _alternative -C $context \
+  'keywords:keyword:compadd ${=${${(f)"$(_call_program keywords pydoc keywords)"}[2,-1]}}' \
+  'topics:topic:compadd ${=${${(f)"$(_call_program topics pydoc topics)"}[2,-1]}}' \
+  'modules:module:' && ret=0
+
+return ret
diff --git a/Completion/Unix/Command/_ri b/Completion/Unix/Command/_ri
index feb10ec91..070f46ac2 100644
--- a/Completion/Unix/Command/_ri
+++ b/Completion/Unix/Command/_ri
@@ -3,7 +3,7 @@
 local curcontext="$curcontext" state line ret=1
 typeset -A opt_args
 
-_arguments \
+_arguments -C \
   '(- *)'{-h,--help}'[print help information and exit]' \
   '(- *)'{-v,--version}'[display the version of ri]' \
   '*'{-d,--doc-dir}'[directory to search for documentation]:ri doc directory:_files -/' \
@@ -42,8 +42,6 @@ if [[ "$state" = ri-name ]]; then
 
   if compset -P '?*(::|\#|.)'; then
     class_dir=${IPREFIX//(::|\#|.)/\/}
-    #else
-    #	:
   fi
   esc_name=${${(Q)PREFIX}//(#b)([^A-Za-z0-9_])/$(printf %%%x ${(qq)match[1]})}
 
diff --git a/Completion/Unix/Command/_su b/Completion/Unix/Command/_su
index 6d0f2cd9f..9d3f28066 100644
--- a/Completion/Unix/Command/_su
+++ b/Completion/Unix/Command/_su
@@ -1,9 +1,9 @@
 #compdef su
 
 local -A opt_args
-local -a args state context
+local -a args context state line expl
 local shell=${words[(i)(-s|--shell=*)]} first='1:user name:_users'
-local usr=root line
+local usr=root
 
 if _pick_variant gnu="Free Software Foundation" unix --version; then
   args=(
@@ -20,10 +20,20 @@ if _pick_variant gnu="Free Software Foundation" unix --version; then
   )
 else
   args=(
-    '-c[pass command to shell]:command string:->command'
     '-l[use a login shell]'
     '-s[run the specified shell]:shell:->shell'
   )
+  case $OSTYPE in
+  freebsd*)
+    args=(
+      '-c[use settings from specified login class]:class'
+      '-f[if the invoked shell is csh, prevent it from reading .cshrc]'
+      '-l[use a login shell]'
+      '-m[do not reset environment]'
+      '-s[set the MAC label]'
+    )
+  *) args+=( '-c[pass command to shell]:command string:->command' ) ;;
+  esac
 fi
 
 if [[ $#words -ge 2 && $words[2] != -* && CURRENT -ne 2 ]]; then
@@ -50,11 +60,11 @@ case $state in
         return
         ;;
     (shell)
-        compadd ${(f)^"$(</etc/shells)"}(N)
+        _wanted -C $context shells expl shell compadd ${(f)^"$(</etc/shells)"}(N)
         return
         ;;
     (rest)
-        if [[ -z $shell || $shell = */nologin ]]; then
+        if [[ -z $shell || $shell = */(nologin|false) ]]; then
             _arguments "-s[run the specified shell, $usr has no shell]" ||
                 _message "-s option required, $usr has no shell"
             compstate[insert]=