diff options
Diffstat (limited to 'Completion/User')
-rw-r--r-- | Completion/User/_bzip2 | 6 | ||||
-rw-r--r-- | Completion/User/_chown | 2 | ||||
-rw-r--r-- | Completion/User/_compress | 2 | ||||
-rw-r--r-- | Completion/User/_dvi | 2 | ||||
-rw-r--r-- | Completion/User/_gzip | 6 | ||||
-rw-r--r-- | Completion/User/_imagemagick | 2 | ||||
-rw-r--r-- | Completion/User/_ispell | 2 | ||||
-rw-r--r-- | Completion/User/_java | 2 | ||||
-rw-r--r-- | Completion/User/_lp | 2 | ||||
-rw-r--r-- | Completion/User/_make | 2 | ||||
-rw-r--r-- | Completion/User/_mount | 2 | ||||
-rw-r--r-- | Completion/User/_mysql_utils | 2 | ||||
-rw-r--r-- | Completion/User/_pack | 6 | ||||
-rw-r--r-- | Completion/User/_pbm | 12 | ||||
-rw-r--r-- | Completion/User/_psutils | 2 | ||||
-rw-r--r-- | Completion/User/_rcs | 6 | ||||
-rw-r--r-- | Completion/User/_rlogin | 4 | ||||
-rw-r--r-- | Completion/User/_ssh | 12 | ||||
-rw-r--r-- | Completion/User/_tiff | 8 | ||||
-rw-r--r-- | Completion/User/_yp | 2 |
20 files changed, 44 insertions, 40 deletions
diff --git a/Completion/User/_bzip2 b/Completion/User/_bzip2 index 53ec36967..cbb231c4d 100644 --- a/Completion/User/_bzip2 +++ b/Completion/User/_bzip2 @@ -1,12 +1,12 @@ -#compdef bzip2 bzcat bunzip2 bzip2recover +#compdef bzip2 bunzip2 bzcat=bunzip2 bzip2recover local decompress expl state line curcontext="$curcontext" typeset -A opt_args -case "${words[1]:t}" in +case "$service" in bzip2recover) [[ $CURRENT = 2 ]] && state=files;; bzip2) decompress=no;& - bunzip2|bzcat) _arguments -C -s \ + bunzip2) _arguments -C -s \ '(--help)-h[display help message]' \ '(-h)--help[display help message]' \ '(--decompress --compress -z --test -t)-d[decompress]' \ diff --git a/Completion/User/_chown b/Completion/User/_chown index 0363e838c..40f38d2f4 100644 --- a/Completion/User/_chown +++ b/Completion/User/_chown @@ -3,7 +3,7 @@ local suf if [[ CURRENT -eq 2 || CURRENT -eq 3 && $words[CURRENT-1] = -* ]]; then - if [[ ${words[1]:t} = chgrp ]] || compset -P '*[:.]'; then + if [[ $service = chgrp ]] || compset -P '*[:.]'; then _groups else if [[ $OSTYPE = (solaris*|hpux*) ]]; then diff --git a/Completion/User/_compress b/Completion/User/_compress index 3521dfef6..9ba8c8e15 100644 --- a/Completion/User/_compress +++ b/Completion/User/_compress @@ -17,7 +17,7 @@ common_args2=( \ '(-q)-v[display compression statistics]' \ "${common_args1[@]}" ) -case "${words[1]:t}" in +case "$service" in compress) _arguments -C -s \ "-b[specify maximum number of bits used to replace common substring]:bits:(${bits[*]})" \ diff --git a/Completion/User/_dvi b/Completion/User/_dvi index 9d551ea07..672b4419d 100644 --- a/Completion/User/_dvi +++ b/Completion/User/_dvi @@ -9,7 +9,7 @@ args=( ':output DVI file:_files -g \*.\(dvi\|DVI\)' ) -case "${words[1]:t}" in +case "$service" in dvips) _arguments -s \ '-a[make three passes]' \ diff --git a/Completion/User/_gzip b/Completion/User/_gzip index 549936a96..a915715a4 100644 --- a/Completion/User/_gzip +++ b/Completion/User/_gzip @@ -1,10 +1,10 @@ -#compdef gzip gunzip gzcat +#compdef gzip gunzip gzcat=gunzip local decompress expl curcontext="$curcontext" state line typeset -A opt_args -case "${words[1]:t}" in -gunzip|zcat|gzcat) +case "$service" in +gunzip) decompress=yes ;& gzip) diff --git a/Completion/User/_imagemagick b/Completion/User/_imagemagick index cf6604e3d..b297f3498 100644 --- a/Completion/User/_imagemagick +++ b/Completion/User/_imagemagick @@ -18,7 +18,7 @@ if (( $# )); then return fi -case "${words[1]:t}" in +case "$service" in display) _arguments -M 'm:{a-z}={A-Z}' \ '*-backdrop[use full screen]' \ diff --git a/Completion/User/_ispell b/Completion/User/_ispell index 7d81952dc..3eacee87f 100644 --- a/Completion/User/_ispell +++ b/Completion/User/_ispell @@ -1,6 +1,6 @@ #compdef ispell buildhash munchlist findaffix tryaffix icombine ijoin -case "${words[1]:t}" in +case "$service" in ispell) _arguments -s \ '(-n -h)-t[input file is in TeX/LaTeX format]' \ diff --git a/Completion/User/_java b/Completion/User/_java index d92dbca3f..f906f0ae8 100644 --- a/Completion/User/_java +++ b/Completion/User/_java @@ -6,7 +6,7 @@ typeset -A opt_args tmpassoc jdb_args=() -case "${words[1]:t}" in +case "$service" in javac) _arguments \ '-g-[generate debugging information]:debug:->debug' \ diff --git a/Completion/User/_lp b/Completion/User/_lp index a81d348bb..b556f1bf5 100644 --- a/Completion/User/_lp +++ b/Completion/User/_lp @@ -5,7 +5,7 @@ local expl ret=1 printer list disp strs shown if compset -P -P || [[ "$words[CURRENT-1]" = -P ]]; then _printers else - if [[ "${words[1]:t}" = (lpq|lprm) ]]; then + if [[ "$service" = (lpq|lprm) ]]; then if [[ "$words" = *-P* ]]; then printer=(-P "${${words##*-P( |)}%% *}") else diff --git a/Completion/User/_make b/Completion/User/_make index b13224c06..958e2a5af 100644 --- a/Completion/User/_make +++ b/Completion/User/_make @@ -25,7 +25,7 @@ else file=Makefile elif [[ -e makefile ]]; then file=makefile - elif [[ -e GNUmakefile ]]; then + elif [[ -n "$_is_gnu[$words[1]]" && -e GNUmakefile ]]; then file=GNUmakefile else file='' diff --git a/Completion/User/_mount b/Completion/User/_mount index 50fa769b2..cbd762583 100644 --- a/Completion/User/_mount +++ b/Completion/User/_mount @@ -368,7 +368,7 @@ if (( ! $+_fs_any )); then esac fi -if [[ "${words[1]:t}" = mount ]]; then +if [[ "$service" = mount ]]; then # Here are the tests and tables for the arguments and options for # the `mount' program. The `fss' array has to be set to the names diff --git a/Completion/User/_mysql_utils b/Completion/User/_mysql_utils index c4648c818..ae7ffe72c 100644 --- a/Completion/User/_mysql_utils +++ b/Completion/User/_mysql_utils @@ -224,7 +224,7 @@ _mysqladmin_commands () { } _mysql_utils () { - case "${words[1]:t}" in + case "$service" in mysql) _mysql "$@" ;; diff --git a/Completion/User/_pack b/Completion/User/_pack index 5ec7a160c..b0172dca8 100644 --- a/Completion/User/_pack +++ b/Completion/User/_pack @@ -1,15 +1,15 @@ -#compdef pack pcat unpack +#compdef pack unpack pcat=unpack local expl state line -case ${words[1]:t} in +case $service in pack) _arguments -C \ '-f[force packing even for files which will not benefit]' \ '-[show statistics for files]' \ '*:file to compress:_files -g \*\~\*.z' ;; - pcat|unpack) + unpack) _description files expl 'compressed file' _files "$expl[@]" -g '*.z' ;; diff --git a/Completion/User/_pbm b/Completion/User/_pbm index 4b7163dcd..7980fc2b7 100644 --- a/Completion/User/_pbm +++ b/Completion/User/_pbm @@ -6,14 +6,14 @@ # defaults can be overridden by simply defining completion functions # for those commands whose arguments you want to complete differently. -local pat expl ret=1 cmd="${words[1]:t}" +local pat expl ret=1 -if [[ "$cmd" = pnm* ]]; then +if [[ "$service" = pnm* ]]; then pat='*.(#i)p[bgp]m' -elif [[ "$cmd" = *top[bgpn]m ]]; then - pat="*.(#i)${cmd%%top[bgpn]m}" +elif [[ "$service" = *top[bgpn]m ]]; then + pat="*.(#i)${service%%top[bgpn]m}" else - pat="*.(#i)${cmd[1,3]}" + pat="*.(#i)${service[1,3]}" fi if [[ $# -ne 0 || $+_in_pbm -ne 0 ]]; then @@ -24,7 +24,7 @@ fi local _in_pbm=yes -case "$cmd" in +case "$service" in asciitop[gn]m) _arguments \ '-d[specify divisor]:divisor:' \ diff --git a/Completion/User/_psutils b/Completion/User/_psutils index 58cfff112..b2e713e6d 100644 --- a/Completion/User/_psutils +++ b/Completion/User/_psutils @@ -1,6 +1,6 @@ #compdef epsffit extractres fixdlsrps fixfmps fixmacps fixpsditps fixpspps fixscribeps fixtpps fixwfwps fixwpps fixwwps includeres psbook psmerge psnup psresize psselect pstops getafm showchar -case "${words[1]:t}" in +case "$service" in epsffit) _arguments \ '-v[print version]' \ diff --git a/Completion/User/_rcs b/Completion/User/_rcs index 1e0fa315a..11cb7a59f 100644 --- a/Completion/User/_rcs +++ b/Completion/User/_rcs @@ -1,14 +1,14 @@ #compdef co ci rcs -local cmd="${words[1]:t}" ret=1 +local ret=1 -if [[ -d RCS && $cmd != ci ]]; then +if [[ -d RCS && $service != ci ]]; then local rep expl rep=(RCS/*,v(:t:s/\,v//)) (( $#rep )) && _wanted files expl 'RCS file' compadd -a rep && ret=0 fi -[[ $cmd = ci || $cmd = rcs || ret -eq 1 ]] && _files && ret=0 +[[ $service = ci || $service = rcs || ret -eq 1 ]] && _files && ret=0 return ret diff --git a/Completion/User/_rlogin b/Completion/User/_rlogin index f84939ce9..bdfe2b44c 100644 --- a/Completion/User/_rlogin +++ b/Completion/User/_rlogin @@ -1,7 +1,7 @@ -#compdef rlogin rsh remsh rcp +#compdef rlogin rsh remsh=rsh rcp _rlogin () { - case "${words[1]:t}" in + case "$service" in rlogin) _arguments -s \ '-8[allow 8-Bit data]' \ diff --git a/Completion/User/_ssh b/Completion/User/_ssh index c6a6898f1..7e81123ef 100644 --- a/Completion/User/_ssh +++ b/Completion/User/_ssh @@ -1,9 +1,12 @@ -#compdef ssh slogin scp ssh-add ssh-agent ssh-keygen +#compdef ssh slogin=ssh scp ssh-add ssh-agent ssh-keygen _remote_files () { # This is extremely simple-minded; could parse "ls -F" output to do # colorings and LIST_TYPES and so on, but I'm just not that ambitious. - compadd $(ssh -a -x ${words[CURRENT]%:*} echo ${words[CURRENT]#*:}\*) + local expl + + _wanted files expl 'remote files' \ + compadd $(ssh -a -x ${words[CURRENT]%:*} echo ${words[CURRENT]#*:}\*) } _ssh () { @@ -14,8 +17,8 @@ _ssh () { # ssh-opt is a pseudo-command used to complete ssh options for `scp -o'. - case "${words[1]:t}" in - ssh|slogin) + case "$service" in + ssh) args=( ':remote host name:->userhost' '(-):command: _command_names -e' @@ -179,6 +182,7 @@ _ssh () { compset -q words=(ssh-opt "$words[@]" ) (( CURRENT++ )) + service=ssh-opt _ssh return elif [[ -n "$state" ]]; then diff --git a/Completion/User/_tiff b/Completion/User/_tiff index f780f6bca..c5c7c3c35 100644 --- a/Completion/User/_tiff +++ b/Completion/User/_tiff @@ -1,9 +1,9 @@ #compdef -P (tiff*|*2tiff|pal2rgb) -local pat expl ret=1 cmd="${words[1]:t}" +local pat expl ret=1 -if [[ "$cmd" = *2tiff ]]; then - pat="*.(#i)${cmd%%2tiff}" +if [[ "$service" = *2tiff ]]; then + pat="*.(#i)${service}" else pat="*.(#i)tiff" fi @@ -23,7 +23,7 @@ local _in_tiff=yes local curcontext="$curcontext" state line ret=1 typeset -A opt_args -case "$cmd" in +case "$service" in tiff2bw) _arguments -C \ '-c[specify compression scheme]:compression scheme:->compress' \ diff --git a/Completion/User/_yp b/Completion/User/_yp index d25533e35..1ca374972 100644 --- a/Completion/User/_yp +++ b/Completion/User/_yp @@ -14,7 +14,7 @@ if (( ! $+_yp_cache_maps )); then ) fi -case "${words[1]:t}" in +case "$service" in ypcat) _arguments -C -s "$_yp_args[@]" ':map name:->map' && ret=0 ;; |