diff options
Diffstat (limited to 'Completion/Unix/Command')
27 files changed, 621 insertions, 120 deletions
diff --git a/Completion/Unix/Command/.distfiles b/Completion/Unix/Command/.distfiles index 355cb9cf9..36d922f9a 100644 --- a/Completion/Unix/Command/.distfiles +++ b/Completion/Unix/Command/.distfiles @@ -27,6 +27,7 @@ _cdrecord _chkconfig _chmod _chown +_clay _comm _compress _configure @@ -39,6 +40,7 @@ _cut _cvs _darcs _date +_dbus _dd _devtodo _dhclient @@ -111,6 +113,7 @@ _kvno _last _ldd _less +_lha _links _ln _loadkeys @@ -143,6 +146,7 @@ _mysqldiff _ncftp _netcat _nice +_nkf _nm _nmap _notmuch @@ -256,6 +260,7 @@ _wiggle _xargs _xmlsoft _xmms2 +_xz _yafc _yodl _yp diff --git a/Completion/Unix/Command/_arping b/Completion/Unix/Command/_arping index fea110934..5edda2123 100644 --- a/Completion/Unix/Command/_arping +++ b/Completion/Unix/Command/_arping @@ -35,7 +35,7 @@ _arguments -s \ '-s[set source MAC address]:source MAC address' \ '-t[set target MAC address]:target MAC address' \ '-c[send this many requests]:count' \ - '-i[interface]:interface:_net_interfaces' \ + '-I[interface]:interface:_net_interfaces' \ '-A[only count addresses matching requested address]' \ '(-B):address:_hosts' diff --git a/Completion/Unix/Command/_bzip2 b/Completion/Unix/Command/_bzip2 index 75f051a57..c175e5c90 100644 --- a/Completion/Unix/Command/_bzip2 +++ b/Completion/Unix/Command/_bzip2 @@ -7,38 +7,29 @@ case "$service" in bzip2recover) [[ $CURRENT = 2 ]] && state=files;; bzip2) decompress=no;& bunzip2) _arguments -C -s -S \ - '(--help)-h[display help message]' \ - '(-h)--help[display help message]' \ - '(--decompress --compress -z --test -t)-d[decompress]' \ - '(-d --compress -z --test -t)--decompress[decompress]' \ - '(--compress --decompress -d --test -t)-z[compress]' \ - '(-z --decompress -d --test -t)--compress[compress]' \ - "(--keep)-k[keep (don't delete) input files]" \ - "(-k)--keep[keep (don't delete) input files]" \ - '(--force)-f[force overwrite]' \ - '(-f)--force[force overwrite]' \ - '(--test --decompress -d --compress -z )-t[test compressed file integrity]' \ - '(-t --decompress -d --compress -z )--test[test compressed file integrity]' \ - '(--stdout)-c[write on standard output]' \ - '(-c)--stdout[write on standard output]' \ - '(--quiet)-q[suppress all warnings]' \ - '(-q)--quiet[suppress all warnings]' \ - '*-v[verbose mode]' \ - '*--verbose[verbose mode]' \ - '(--license)-L[display software license]' \ - '(-L)--license[display software license]' \ - '(--version)-V[display version number]' \ - '(-V)--version[display version number]' \ - '(--small)-s[use less memory (at most 2500k)]' \ - '( -2 -3 -4 -5 -6 -7 -8 -9)-1' \ - '(-1 -3 -4 -5 -6 -7 -8 -9)-2' \ - '(-1 -2 -4 -5 -6 -7 -8 -9)-3' \ - '(-1 -2 -3 -5 -6 -7 -8 -9)-4' \ - '(-1 -2 -3 -4 -6 -7 -8 -9)-5' \ - '(-1 -2 -3 -4 -5 -7 -8 -9)-6' \ - '(-1 -2 -3 -4 -5 -6 -8 -9)-7' \ - '(-1 -2 -3 -4 -5 -6 -7 -9)-8' \ - '(-1 -2 -3 -4 -5 -6 -7 -8 )-9' \ + '(- *)'{-h,--help}'[display help message]' \ + '(-d --decompress --compress -z --test -t)'{-d,--decompress}'[decompress]' \ + '(-z --compress --decompress -d --test -t)'{-z,--compress}'[compress]' \ + '(-k --keep)'{-k,--keep}"[keep (don't delete) input files]" \ + '(-f --force)'{-f,--force}'[force overwrite]' \ + '(-t --test --decompress -d --compress -z)'{-t,--test}'[test compressed file integrity]' \ + '(-c --stdout)'{-c,--stdout}'[write on standard output]' \ + '(-q --quiet)'{-q,--quiet}'[suppress all warnings]' \ + \*{-v,--verbose}'[verbose mode]' \ + '(- *)'{-L,--license}'[display software license]' \ + '(- *)'{-V,--version}'[display version number]' \ + '(--small -s)'{-s,--small}'[reduce memory usage (at most 2500k)]' \ + '(-1 -2 -3 -4 -5 -6 -7 -8 -9 --fast )--best' \ + '(-1 -2 -3 -4 -5 -6 -7 -8 -9 --best)--fast' \ + '( -2 -3 -4 -5 -6 -7 -8 -9 --fast --best)-1' \ + '(-1 -3 -4 -5 -6 -7 -8 -9 --fast --best)-2' \ + '(-1 -2 -4 -5 -6 -7 -8 -9 --fast --best)-3' \ + '(-1 -2 -3 -5 -6 -7 -8 -9 --fast --best)-4' \ + '(-1 -2 -3 -4 -6 -7 -8 -9 --fast --best)-5' \ + '(-1 -2 -3 -4 -5 -7 -8 -9 --fast --best)-6' \ + '(-1 -2 -3 -4 -5 -6 -8 -9 --fast --best)-7' \ + '(-1 -2 -3 -4 -5 -6 -7 -9 --fast --best)-8' \ + '(-1 -2 -3 -4 -5 -6 -7 -8 --fast --best)-9' \ '*:files:->files' && ret=0 ;; esac diff --git a/Completion/Unix/Command/_bzr b/Completion/Unix/Command/_bzr index 83f6fd19b..23feb6f83 100644 --- a/Completion/Unix/Command/_bzr +++ b/Completion/Unix/Command/_bzr @@ -396,6 +396,10 @@ case $cmd in args+=( '--dry-run[do not actually sign anything]' ) ;; +(send) + args+=( '*:DIR:_files -/' ) + ;; + (*) _message "unknown bzr command completion: $cmd" return 1 diff --git a/Completion/Unix/Command/_clay b/Completion/Unix/Command/_clay new file mode 100644 index 000000000..71f05bf64 --- /dev/null +++ b/Completion/Unix/Command/_clay @@ -0,0 +1,42 @@ +#compdef clay + +# Completion for the Clay Programming Language +# http://claylabs.com/clay/ + +_arguments -C \ + "-o:specify output file:_files" \ + "-target:set target platform for code generation" \ + "-shared[create a dynamically linkable library]" \ + "-emit-llvm[emit llvm code]" \ + "-S[emit assembler code]" \ + "-c[emit object code]" \ + "-D-:set flag value" \ + "-O-:set optimization level:(0 1 2 3)" \ + "-g[keep debug symbol information]" \ + "-exceptions[enable exception handling]" \ + "-no-exceptions[disable exception handling]" \ + "-inline[inline procedures marked 'forceinline']" \ + "-no-inline[ignore 'inline' and 'forceinline' keyword]" \ + "-import-externals[include externals from imported modules]" \ + "-no-import-externals[don't include externals from imported modules]" \ + "-pic[generate position independent code]" \ + "-abort[abort on error (to get stacktrace in gdb)]" \ + "-run[execute the program without writing to disk]" \ + "-timing[show timing information]" \ + "-full-match-errors[show universal patterns in match failure errors]" \ + "-log-match:log overload matching behavior for calls" \ + "-arch:build for Darwin architecture <arch>" \ + "-F-:add <dir> to framework search path:_files -/" \ + "-framework:link with framework <name>" \ + "-L:add <dir> to library search path:_files -/" \ + "-Wl,-:pass flags to linker" \ + "-l-:link with library <lib>" \ + "-I+:add <path> to clay module search path:_files -/" \ + "-deps[keep track of the dependencies of the currently]" \ + "-no-deps[don't generate dependencies file]" \ + "-o-deps:write the dependencies to this file" \ + "-e:compile and run <source> (implies -run)" \ + "-M-:import <module>.*; for -e" \ + "-v[display version info]" \ + ":program file:_files -g '*.clay'" + diff --git a/Completion/Unix/Command/_dbus b/Completion/Unix/Command/_dbus new file mode 100644 index 000000000..bdd7613f0 --- /dev/null +++ b/Completion/Unix/Command/_dbus @@ -0,0 +1,87 @@ +#compdef dbus-send dbus-monitor + +local curcontext="$curcontext" state line expl find end ret=1 +typeset -A opt_args +local -a suf introspect interfaces + +case $service in + dbus-send) + _arguments -A "--*" -C \ + '(--session)--system' '(--system)--session' \ + '--address=-:bus address:->addresses' \ + '--dest=-:connection:->connections' \ + '--print-reply=-::format:(literal)' \ + '--reply-timeout=-:timeout (ms)' \ + '--type=-:type:(method_call signal)' \ + ':object path:->objectpaths' \ + ':message name:->methods' \ + ':content:->contents' && ret=0 + ;; + dbus-monitor) + _arguments -A "--*" -C \ + '(--session)--system' '(--system)--session' \ + '--address=-:bus address:->addresses' \ + '(--profile)--monitor' '(--monitor)--profile' \ + '*:watch expression:->expressions' && ret=0 + ;; +esac + +case $state in + addresses) + compset -P '*;' + if compset -P '*='; then + _files && ret=0 + else + _message -e addresses address + fi + ;; + connections) + _wanted connections expl connection compadd ${=${(M)PREFIX:#*.*}:+-M 'r:|.=* r:|=*'} ${$(_call_program connections dbus-send ${opt_args[(I)--system]} --print-reply=literal --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.ListActivatableNames 2>/dev/null):#(array|\[|\])} ${$(_call_program connections dbus-send ${opt_args[(I)--system]} --print-reply=literal --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.ListNames 2>/dev/null):#(array|\[|\])} && ret=0 + ;; + objectpaths) + if [[ -prefix / ]]; then + compset -P ${PREFIX%%[^/]#} + _wanted objectpaths expl 'object path' compadd -qS/ ${${${(M)${(f)"$(_call_program objectpaths dbus-send --print-reply ${(M)words:#(--dest=|--system|--address=)*} ${${IPREFIX%/}:-/} org.freedesktop.DBus.Introspectable.Introspect 2>/dev/null)"}:#*node name=[^/]##\"*}#*\"}%\"*} && ret=0 + else + _wanted objectpaths expl 'object path' compadd -S '/' -r '-=' '' && ret=0 + fi + ;; + methods) + introspect=( ${(M)${(f)"$(_call_program methods dbus-send --print-reply ${(M)words:#(--dest=|--system|--address=|/)*} org.freedesktop.DBus.Introspectable.Introspect 2>/dev/null)"}:#*name=*} ) + interfaces=( ${${${(M)introspect:#*interface name=*}#*\"}%\"*} ) + _wanted interfaces expl interface compadd -qS. -M 'r:|.=* r:|=*' -a interfaces && ret=0 + if [[ $compstate[nmatches] != $#interfaces ]] && compset -P '*.'; then + find="*interface name=?${IPREFIX%.}??" + end=${interfaces[(i)${IPREFIX%.}]} + _wanted methods expl method compadd ${${${(M)${${introspect[${introspect[(i)$find]}+1,(in.end+1.)*interface name=*]}:#*interface name=*}:#*${${opt_args[--type]%_*}:-method} name=*}#*\"}%\"*} && ret=0 + fi + ;; + contents) + compset -S ':*' || suf=( -S : ) + while compset -P '(array|dict|variant):'; do + : + done + if compset -P '*:'; then + _message -e value 'value' + else + _alternative -O suf \ + 'containers:container:(array dict variant)' \ + 'types:type:(string double byte boolean objpath '${(j. .):-{,u}int{16,32,64}}\) && ret=0 + fi + ;; + expressions) + _values -w -s , 'expression' \ + 'type:message type:(signal method_call method_return error)' \ + 'sender:bus or name' \ + 'interface:interface' \ + 'member:member' \ + 'path:path' \ + 'path_namespace:path' \ + 'destination:unique name' \ + arg{0..9}:value \ + 'arg0namespace:namespace' \ + 'eavesdrop:eavesdropping:(true false)' && ret=0 + ;; +esac + +return ret diff --git a/Completion/Unix/Command/_find b/Completion/Unix/Command/_find index 3c21dcc94..33767c080 100644 --- a/Completion/Unix/Command/_find +++ b/Completion/Unix/Command/_find @@ -1,18 +1,23 @@ #compdef find _arguments \ + '(- *)-help' '(-)--help' \ + '(- *)-version' '(-)--version' \ + '(-L -P)-H[only follow symlinks when resolving command-line arguments]' \ + '(-H -P)-L[follow symlinks]' \ + '(-H -L)-P[never follow symlinks]' \ + '-D[print diagnostics]:deb option:(help tree search stat rates opt exec)' \ + '-O+[enable query optimisation]:level:(1 2 3)' \ '*-daystart' \ - '*-depth' \ + '*-d' '*-depth' \ '*-follow' \ - '*-help' \ - '*-ignore_readdir_race' \ - '*-maxdepth:maximum search depth:' \ - '*-mindepth:minimum search depth:' \ + '(-noignore_readdir_race)-ignore_readdir_race' \ + '*-maxdepth:maximum search depth' \ + '*-mindepth:minimum search depth' \ '*-mount' \ - '*-noignore_readdir_race' \ + '(-ignore_readdir_race)-noignore_readdir_race' \ '*-noleaf' \ - '*-regextype:regexp syntax:(emacs posix-awk posix-basic posix-egrep posix-extended)' \ - '*-version' \ + '-regextype:regexp syntax:(emacs posix-awk posix-basic posix-egrep posix-extended)' \ '*-warn' \ '*-nowarn' \ '*-xdev' \ @@ -27,6 +32,7 @@ _arguments \ '*-newer:file to compare (modification time):_files' \ '*-used:access after inode change (days):' \ '*-empty' \ + '*-executable' \ '*-false' \ '*-fstype:file system type:_file_systems' \ '*-gid:numeric group ID:' \ @@ -48,6 +54,8 @@ _arguments \ '*-nouser' \ '*-nogroup' \ '*-perm:file permission bits:' \ + '*-readable' \ + '*-writable' \ '*-size:file size:' \ '*-samefile:same inode as:_files' \ '*-true' \ @@ -68,4 +76,7 @@ _arguments \ '*-prune' \ '*-quit' \ '*-ls' \ + '*-and' '*-a' \ + '*-or' '*-o' \ + '*-not' \ '*:directory:_files -/' diff --git a/Completion/Unix/Command/_gcc b/Completion/Unix/Command/_gcc index 402797aa2..b14c13334 100644 --- a/Completion/Unix/Command/_gcc +++ b/Completion/Unix/Command/_gcc @@ -1,4 +1,4 @@ -#compdef gcc g++ -value-,LDFLAGS,-default- -value-,CFLAGS,-default- -value-,CPPFLAGS,-default- +#compdef gcc g++ cc c++ llvm-gcc llvm-g++ clang clang++ -value-,LDFLAGS,-default- -value-,CFLAGS,-default- -value-,CPPFLAGS,-default- local curcontext="$curcontext" state line ret=1 expl args args2 typeset -A opt_args @@ -210,10 +210,23 @@ h8/300) ;; esac +if [[ "$service" = clang* ]]; then + args=( + $args + -flto -emit-llvm + "-Qunused-arguments[don't emit warning for unused driver arguments]" + --analyze + -fshow-column -fshow-source-location -fcaret-diagnostics -fdiagnostics-fixit-info + -fdiagnostics-parseable-fixits -fdiagnostics-print-source-range-info + -fprint-source-range-info -fdiagnostics-show-option -fmessage-length + ) +fi + _arguments -C -M 'L:|-{fW}no-=-{fW} r:|[_-]=* r:|=*' \ "$args[@]" \ -c -S -E -v -a -w -C -H -P -s '(-pg)-p' '(-p)-pg' \ + '-###[print commands to run this compilation]' \ '-o:output file:_files -g "^*.(c|h|cc|C|cxx)(-.)"' \ '-x:input file language:(c objective-c c++ c-header cpp-output c++-cpp-output assembler assembler-with-cpp none)' \ '+e-:virtual function definitions in classes:((0\:only\ interface 1\:generate\ code))' \ @@ -226,6 +239,7 @@ _arguments -C -M 'L:|-{fW}no-=-{fW} r:|[_-]=* r:|=*' \ '*-U-:undefine macro:' \ '*-Wp,-:preprocessor option:' \ '*-Wl,-:linker option:' \ + '*-Xpreprocessor:preprocessor option:' \ '*-Xlinker:linker option:' \ '*-u:pretend symbol to be undefined:' \ '*-Wa,-:assembler option:' \ @@ -234,7 +248,8 @@ _arguments -C -M 'L:|-{fW}no-=-{fW} r:|[_-]=* r:|=*' \ '*-I-:header file search path:_files -/' \ '-B-:executable prefix:_files -/' \ '-b:target machine:' \ - '-V:gcc version:' \ + '-V:specify compiler version:' \ + '--version' \ '-print-file-name=:library:->library' \ '-print-prog-name=:program:' \ '*-include:include file:_files -g \*.h\(-.\)' \ diff --git a/Completion/Unix/Command/_getent b/Completion/Unix/Command/_getent index 9644fa35b..3ea148b71 100755 --- a/Completion/Unix/Command/_getent +++ b/Completion/Unix/Command/_getent @@ -5,12 +5,13 @@ local services databases keys local -a args typeset -A opt_args -if _pick_variant -r is_gnu gnu=GNU unix --version; then +if _pick_variant -r is_gnu gnu='(GNU|EGLIBC)' unix --version; then args+=( '(- 1 *)'{-\?,--help}'[display help information]' '(- 1 *)--usage[display a short usage message]' '(- 1 *)'{-V,--version}'[display version information]' {-s,--service=}'[specify service configuration to use]:service:->services' + '(-i --no-idn)'{-i,--no-idn}'[disable IDN encoding]' ) fi diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 88c765fb0..2b6a36956 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -5451,7 +5451,7 @@ __git_remote_repositories () { service= _ssh if compset -P '*:'; then - _remote_files --no-files -- ssh + _remote_files -/ -- ssh else _ssh_hosts -S: fi @@ -6073,7 +6073,7 @@ _git() { aliases=(${(f)${${${(f)"$(_call_program aliases git config --get-regexp '\^alias\.')"}#alias.}/ /$'\n'}/(#e)/$'\n'}) (( $#aliases % 2 == 0 )) && git_aliases=($aliases) - if (( $+git_aliases[$words[2]] && !$+commands[git-$words[2]] )); then + if (( $+git_aliases[$words[2]] && !$+commands[git-$words[2]] && !$+functions[_git-$words[2]] )); then local -a tmpwords expalias expalias=(${(z)git_aliases[$words[2]]}) tmpwords=(${words[1]} ${expalias}) diff --git a/Completion/Unix/Command/_iconv b/Completion/Unix/Command/_iconv index 75fe521ee..190ed5f77 100644 --- a/Completion/Unix/Command/_iconv +++ b/Completion/Unix/Command/_iconv @@ -4,13 +4,13 @@ local expl curcontext="$curcontext" state line ret=1 local LOCPATH="${LOCPATH:-/usr/lib/nls/loc}" local -U codeset -if _pick_variant gnu=GNU unix --version; then +if _pick_variant gnu='(GNU|EGLIBC)' unix --version; then local exargs="--list -? --help --usage --version -V" _arguments -C -S -s \ "(-f --from-code $exargs)"{-f+,--from-code=}'[specify code set of input file]:code set:->codeset' \ "(-t --to-code $exargs)"{-t+,--to-code=}'[specify code set for output]:code set:->codeset' \ - '(- 1)--list[list all character code sets]' \ + '(- 1 -l --list)'{-l,--list}'[list all character code sets]' \ "($exargs)-c[omit invalid characters from output]" \ "(-o --output $exargs)"{-o+,--output=}'[specify output file]:output file:_files' \ "(-s --silent --verbose $exargs)"{-s,--silent}'[suppress warnings]' \ diff --git a/Completion/Unix/Command/_ip b/Completion/Unix/Command/_ip index 8cfe5bdab..0fc979cd3 100644 --- a/Completion/Unix/Command/_ip +++ b/Completion/Unix/Command/_ip @@ -38,6 +38,11 @@ subcmd_ipaddrs=( /$'(<->(.<->(.<->(.<->|)|)|)|[:[:xdigit]]#:[:[:xdigit:]]#)(|/<->)\0'/ ":ipaddress:IP address (v4 or v6) currently set:( $(ip addr show | sed -n 's/^ *inet6* \([0-9a-f\.:/]*\) .*$/\1/p') )" ) +subcmd_prefix_label=( + /$'(<->(.<->(.<->(.<->|)|)|)|[:[:xdigit]]#:[:[:xdigit:]]#)(|/<->)\0'/ + ":ipaddresslabel:IP addrlabel prefix currently set:( $(ip -6 addrlabel list | sed -n 's/^prefix \([0-9a-f\.:/]*\) .*$/\1/p') )" +) + local -a subcmd_scope _regex_words scope "IP address scope" \ @@ -240,6 +245,34 @@ _regex_words \ 'f*lush:flush protocol address:$addr_show_cmds' addr_cmds=("$reply[@]") +# +# addrlabel +# + +local -a addrlabel_add_cmds +_regex_words addrlabel-add-commands "addlabel add command" \ + 'p*refix: limit to given IP address/prefix' \ + 'd*ev: specify device:$subcmd_dev' \ + 'l*abel: number' +addrlabel_add_cmds=( "(" $subcmd_ipaddr "|" ")" "$reply[@]" "#") + +local -a addrlabel_del_cmds +_regex_words addrlabel-add-commands "addlabel del command" \ + 'p*refix: limit to given IP address/prefix:$subcmd_prefix_label' \ + 'd*ev: specify device:$subcmd_dev' \ + 'l*abel: number:$subcmd_number' +addrlabel_del_cmds=( "(" $subcmd_ipaddr "|" ")" "$reply[@]" "#") + + +local -a addrlabel_cmds +_regex_words \ + addrlabel-commands "addrlabel command" \ + 'h*elp: show help for command' \ + 'a*dd: add an address labels:$addrlabel_add_cmds' \ + 'd*el: delete an address labels:$addrlabel_del_cmds' \ + 'l*ist: list address labels' \ + 'f*lush: flush adderss labels' +addrlabel_cmds=("$reply[@]") # # neigh @@ -419,7 +452,7 @@ _regex_words \ 'h*elp:show help for command' \ 'a*dd:add a new IP tunnel:$tunnel_add_cmds' \ 'c*hange:change an existing IP tunnel:$tunnel_add_cmds' \ - 'd*elete:destroy an IP tunnel:$tunnel_add_cmds' \ + 'd*el:destroy an IP tunnel:$tunnel_add_cmds' \ 's*how:list IP tunnels' tunnel_cmds=("$reply[@]") @@ -506,6 +539,7 @@ args+=("$reply[@]" "#") _regex_words \ commands "ip command" \ 'l*ink:configure network device:$link_cmds' \ + 'addrlabel:manage addrlabel:$addrlabel_cmds' \ 'a*ddr:manage protocol address:$addr_cmds' \ 'r*oute:manage routing table:$route_cmds' \ 'ru*le:manage routing policy database:$rule_cmds' \ diff --git a/Completion/Unix/Command/_irssi b/Completion/Unix/Command/_irssi index ee1e1ef43..fd64b5efc 100644 --- a/Completion/Unix/Command/_irssi +++ b/Completion/Unix/Command/_irssi @@ -30,6 +30,7 @@ _arguments -s \ '--noconnect[disable autoconnect]' \ '(-n --nick)'{-n,--nick=}'[set nick name]:nick:_irssi_nick' \ '(-h --hostname)'{-h,--hostname=}'[specify hostname]:hostname:_hosts' \ + '(-d --dummy)'{-d,--dummy}'[use the dummy terminal mode]' \ '(-)'{-v,--version}'[display version information]' \ '(-)'{-\?,--help}'[display help information]' \ '(-)--usage[display usage]' diff --git a/Completion/Unix/Command/_ldd b/Completion/Unix/Command/_ldd index d59294717..0980bc043 100644 --- a/Completion/Unix/Command/_ldd +++ b/Completion/Unix/Command/_ldd @@ -1,12 +1,12 @@ #compdef ldd -if _pick_variant gnu=GNU solaris --version; then +if _pick_variant gnu='(GNU|EGLIBC)' solaris --version; then args=( '(- *)--version[display version information]' '(- *)--help[display help information]' '(-v --verbose)'{-v,--verbose}'[include symbol versioning information]' '(-d --data-relocs)'{-d,--data-relocs}'[perform data relocations and report missing objects]' - '(-f --function-relocs)'{-f,--function-relocs}'[perform data/function relocations and report missing objects]' + '(-r --function-relocs)'{-r,--function-relocs}'[perform data/function relocations and report missing objects]' '(-u --unused)'{-u,--unused}'[display any unused objects]' ) else diff --git a/Completion/Unix/Command/_lha b/Completion/Unix/Command/_lha new file mode 100644 index 000000000..5a238d807 --- /dev/null +++ b/Completion/Unix/Command/_lha @@ -0,0 +1,77 @@ +#compdef lha + +if (( CURRENT == 2 )); then + compset -P - + + local lhacmds + lhacmds=( + '( x l v u d m c p t)a[Add \(Or replace\) to archive]' + '(a l v u d m c p t)x[EXtract from archive]' + '(a x v u d m c p t)l[List]' + '(a x l u d m c p t)v[Verbose List]' + '(a x l v d m c p t)u[Update newer files to archive]' + '(a x l v u m c p t)d[Delete from archive]' + '(a x l v u d c p t)m[Move to archive]' + '(a x l v u d m p t)c[re-Construct new archive]' + '(a x l v u d m c t)p[Print to STDOUT from archive]' + '(a x l v u d m c p )t[Test file CRC in archive]' + ) + + if [ "${words[2]#-}" != "" ]; then + lhacmds=($lhacmds + 'v[verbose]' + 'q[quiet]' + 'n[not execute]' + 'f[force\(over write at extract\)]' + 't[FILES are TEXT file]' + 'e[TEXT code convert from/to EUC]' + 'g[Generic format \(for compatibility\)]' + ) + case ${words[2]#-} in + a*|u*) + lhacmds=($lhacmds + 'd[delete FILES after]' + 'z[files not compress]' + '( 1 2)0[header level 0]' + '(0 2)1[header level 1]' + '(0 1 )2[header level 2]' + ) + ;; + c*) + lhacmds=($lhacmds 'd[delete FILES after]') + ;; + x*) + lhacmds=($lhacmds 'i[ignore directory path]') + ;; + esac + fi + + _values -s '' 'lha command' \ + $lhacmds \ + && return 0 +elif (( CURRENT == 3 )); then + _arguments -C \ + '*:LHA file:_files -g \*.lzh' && return 0 +else + case ${words[2]#-} in + l*|x*|d*) + if [ -f "$words[3]" ]; then + _lzh_cache_list=`$words[1] lq $words[3] | awk '{print $8}'` + _lzh_cache_list=("${(@f)${_lzh_cache_list}}") + + _wanted files expl 'file from archive' _multi_parts / _lzh_cache_list + + return 0 + else + _message -r "Archive file is not found : ${words[3]}" + return 1 + fi + + ;; + *) + _arguments -C \ + '*:file:_files' && return 0 + esac +fi + +return 0 diff --git a/Completion/Unix/Command/_lp b/Completion/Unix/Command/_lp index e0654e711..8da84a180 100644 --- a/Completion/Unix/Command/_lp +++ b/Completion/Unix/Command/_lp @@ -28,7 +28,7 @@ _lp_job_options() # Generic options (from lp manual page) lopts_with_args=( media orientation-requested sides number-up scaling cpi lpi - page-{bottom,left,right,top} ) + page-{bottom,left,right,top} page-ranges ) lopts_no_args=(fitplot landscape) diff --git a/Completion/Unix/Command/_mount b/Completion/Unix/Command/_mount index b48aaa236..542154a58 100644 --- a/Completion/Unix/Command/_mount +++ b/Completion/Unix/Command/_mount @@ -17,7 +17,7 @@ if [[ "$OSTYPE" == cygwin ]]; then '(-)'{-i,--import-old-mounts}'[import old mounts]' \ '(-)'{-p,--show-cygdrive-prefix}'[show cygdrive prefix]' \ '(-)'{-c,--change-cygdrive-prefix}'[cygdrive prefix]:cygdrive prefix (POSIX path):_files -P/ -W "(/)" -/' \ - + return else local line @@ -45,7 +45,7 @@ _fs_ufs _fs_efs _fs_cd9660 _fs_iso9660 _fs_cachefs _fs_s5fs _fs_tmpfs _fs_pcfs \ _fs_hsfs _fs_advfs _fs_cdfs _fs_affs _fs_ext2 _fs_fat _fs_ext3 _fs_msdos \ _fs_msdosfs _fs_umsdos _fs_vfat _fs_hpfs _fs_ntfs _fs_reiserfs _fs_smbfs \ _fs_xfs _fs_std _fs_devfs _fs_fdesc _fs_kernfs _fs_linprocfs _fs_linsysfs \ -_fs_procfs +_fs_procfs _fs_btrfs _fs_ext4 typeset -A opt_args @@ -54,11 +54,11 @@ if (( ! $+_fs_any )); then local _fs_any # These are tables describing the possible values and their - # arguments for the `-o' option. There is one array per + # arguments for the `-o' option. There is one array per # file system type (only for those that accept more values # than those in the `_fs_any' array). The elements of the # array are used as arguments to `_values'. The first tables - # are used by several systems while system specific tables are + # are used by several systems while system specific tables are # (re)defined in a "$OSTYPE" case. _fs_any=( @@ -121,7 +121,7 @@ if (( ! $+_fs_any )); then 'nosuid[prevent running setuid/setgid from mount]' "$_fs_any[@]" ) - + _fs_nfs=( '(fg)bg[mount in background]' '(bg)fg[mount in foreground]' @@ -155,7 +155,7 @@ if (( ! $+_fs_any )); then 'grpid[inherit group id of parent directory]' "$_fs_any[@]" ) - + _fs_efs=( 'raw[raw device pathname to filesystem]:raw device pathname:->devordir' '(nofsck)fsck[fsck should check this filesystem by default]' @@ -164,7 +164,7 @@ if (( ! $+_fs_any )); then '(quota)noquota[turn off quotas]' 'lbsize[no of bytes transferred in each operation]:bytes' ) - + _fs_iso9660=( 'setx[set execute permissions on every file]' 'notranslate[don'\''t translate filenames]' @@ -176,7 +176,7 @@ if (( ! $+_fs_any )); then '(rrip)norrip[disable rock ridge extensions]' 'nmconv[specify filename translation]:filename translation:((c\:no\ translation l\:to\ lowercase m\:suppress\ version\ no))' ) - + _fs_nfs=( '(fg)bg[mount in background]' '(bg)fg[mount in foreground]' @@ -194,7 +194,7 @@ if (( ! $+_fs_any )); then 'symttl[time-to-live of cached symbolic links]:seconds' "$_nfs_access[@]" ) - + _fs_cachefs=( 'backfstype[type of the back file system]:back file system type:(efs nfs iso9660 dos hfs cachefs)' 'backpath[specify back file system location]:back file system location:_files -/' @@ -206,9 +206,9 @@ if (( ! $+_fs_any )); then 'local-access[check permissions locally]' 'purge[purge any cached information]' "$_nfs_access[@]" - ) - - ;; + ) + + ;; solaris*) _fs_s5fs=( 'remount[remount file system]' @@ -270,7 +270,7 @@ if (( ! $+_fs_any )); then 'vers[set NFS version number]:NFS version number:(2 3)' "$_nfs_access[@]" "$_fs_s5fs[@]" - ) + ) _fs_cachefs=( 'backfstype[type of the back file system]:back file system type:(nfs hsfs)' 'backpath[specify back file system location]:back file system location:_files -/' @@ -306,10 +306,15 @@ if (( ! $+_fs_any )); then _fs_any=( '(sync)async[do all I/O asynchronously]' '(noatime)atime[update access time]' - '(norelatime)relatime[update atime relative to mtime/ctime]' + '(norelatime)relatime[update atime relative to mtime/ctime]' + '(nostrictatime)strictatime[full atime updates]' + '(strictatime)nostrictatime[default atime update behaviour]' '(rw suid dev exec async)defaults[use default options]' '(nodev)dev[interpret devices]' + '(nodiratime)diratime[update directory access time]' + "(diratime)nodiratime[don't update directory access time]" '(noexec)exec[permit execution of binaries]' + "noiversion[don't increment i_version inode field]" '(nomand)mand[allow mandatory locks]' "(atime)noatime[don't update access time]" "(relatime)norelatime[update access time without regard to mtime/ctime]" @@ -327,6 +332,10 @@ if (( ! $+_fs_any )); then 'encryption[enable encryption]:cypher' 'keybits[set number of bits in encryption key]:key size:(64 128 160 192 256)' 'offset[specify data start for loopback mount]:offset (bytes)' + '(loud)silent' '(silent)loud' + '(fscontext defcontext)context:context' + '(context)'{fscontext,defcontext}':context' + 'rootcontext:context' ) _fs_adfs=( 'uid[set owner of root]:user ID' @@ -383,6 +392,7 @@ if (( ! $+_fs_any )); then 'umask[specify umask]:umask value (octal)' 'dmask[specify umask for directories only]:umask value (octal)' 'fmask[specify umask for files only]:umask value (octal)' + 'allow_utime[control permission check of mtime/atime]:value' 'check[specify checking level]:checking level:((relaxed\:accept\ upper\ and\ lower\ case,\ truncate\ long\ name normal\:like\ '"'\`'"'relaxed'"\\'"',\ but\ reject\ special\ characters strict\:like\ '"'\`'"'normal'"\\'"',\ but\ no\ long\ parts))' 'codepage[specify codepage for converting filenames to short form]:codepage' 'conf[specify CR/NL conversion]:CR/NL conversion mode:((binary\:no\ translation text\:conversion\ on\ all\ files auto\:perform\ translation\ on\ file\ without\ binary\ extension))' @@ -392,15 +402,26 @@ if (( ! $+_fs_any )); then 'debug[debug mode]' 'fat[specify fat type]:fat type (bit):(12 16 32)' 'iocharset[character set to use for converting from 8 bit to unicode]:character set' + 'tz[set timezone conversion]:zone:(UTC)' 'quiet[quiet mode]' ) _fs_ext3=( "$_fs_ext2[@]" 'journal[update fs journal]:update or inode number:(update)' + 'journal_dev[specify new journal location]:device number' 'noload[do not load journal]' 'data[specify mode for data]:journalling mode:(journal ordered writeback)' + 'barrier[enable/disable barriers]:state:((0\:disabled 1\:enabled))' 'commit[specify commit sync interval for data and metadata]:seconds' ) + _fs_ext4=( + "$_fs_ext3[@]" + journal_checksum journal_sync_commit + inode_readahead:blocks stripe:blocks delalloc nodelalloc + {max,min}'_batch_time:time (usecs)' journal_ioprio:priority + abort {,no}auto_da_alloc {,no}discard nouid32 resize + {,no}block_validity dioread_{,no}lock i_version + ) _fs_msdos=( "$_fs_fat[@]" ) _fs_umsdos=( "$_fs_fat[@]" ) _fs_vfat=( "$_fs_fat[@]" @@ -527,6 +548,27 @@ if (( ! $+_fs_any )); then 'sunit[specify stripe unit]:size' 'swidth[specify stripe width]:size' ) + _fs_btrfs=( + 'subvol[mount a subvolume]:path' + 'subvolid[mount subvolume by id]:id' + 'device[scan device for filesystems]:device' + 'nodatasum[disable checksums of new files]' + 'nobarrier[disable use of device barriers]' + 'max_inline[set maximum space for inline data]:size (bytes)' + 'alloc_start[set where on disk allocations start]:number' + 'thread_pool[number of worker threads to allocate]:number' + '(compress-force)compress[enable compression]:algorithm:(zlib lzo no)' + '(compress)compress-force[enable compression for all files]:algorithm:(zlib lzo no)' + 'ssd[optimise behaviour for SSDs]' + 'ssd_spread[be strict about finding a large unused region for new allocations]' + 'discard[enable discard/TRIM on freed blocks]' + 'notreelog[disable the tree logging used for fsync]' + metadata_ratio:number {,no}space_cache clear_cache + user_subvol_rm_allowed autodefrag inode_cache + enospc_debug recovery check_int check_int_data + check_int_print_mask:number skip_balance + 'fatal_errors:action:(bug panic)' + ) ;; freebsd*|dragonfly*) _fs_any=( @@ -628,28 +670,31 @@ if [[ "$service" = mount ]]; then deffs=efs ;; linux*) + local excl='-V --version -h --help' args=( -s - '(- :)-h[show help]' - '(- :)-V[show version]' - '(-V -h)-v[verbose mode]' - '(-V -h)-p[specify file descriptor from which to read passphrase]:file descriptor:_file_descriptors' - '(-V -h -o :)-a[mount all filesystems in fstab]' - '(-V -h)-F[fork off one child per device]' - '(-V -h)-f[fake mount]' - "(-V -h)-i[don't call /sbin/mount.<fs> helper]" - '(-V -h)-l[output ext2, ext3 and XFS labels]' - "(-V -h)-n[don't write /etc/mtab]" - '(-V -h)-s[tolerate sloppy mount options]' - '(-V -h -w)-r[mount read-only]' - '(-V -h -r)-w[mount read/write]' - '(-V -h)-L[mount partition with specified label]:label' - '(-V -h)-U[mount partition with specified uuid]:uuid' - '(-V -h)-t[specify file system type]:file system type:->fslist' - '(-V -h)-O[with -a, restrict filesystems by options]:file system option:->fsopt' - '(-V -h -a -O)-o[specify file system options]:file system option:->fsopt' - '(: -)--bind[remount part of filesystem elsewhere]:old directory:_directories:new directory:_directories' - '(: -)--rbind[remount part of filesystem including submounts elsewhere]:old directory:_directories:new directory:_directories' - '(: -)--move[move part of filesystem elsewhere]:old directory:_directories:new directory:_directories' + '(- :)'{-h,--help}'[show help]' + '(- :)'{-V,--version}'[show version]' + "($excl -v --verbose)"{-v,--verbose}'[verbose mode]' + "($excl -p --pass-fd)"{-p+,--pass-fd=}'[specify file descriptor from which to read passphrase]:file descriptor:_file_descriptors' + "($excl -o : -a --all)"{-a,--all}'[mount all filesystems in fstab]' + "($excl -F --fork)"{-F,--fork}'[fork off one child per device]' + "($excl -f --fake)"{-f,--fake}'[fake mount]' + "($excl -i --internal-only)"{-i,--internal-only}"[don't call /sbin/mount.<fs> helper]" + "($excl)-l[output ext2, ext3, ext4 and XFS labels]" + "($excl -n --no-mtab)"{-n,--no-mtab}"[don't write /etc/mtab]" + "($excl)--no-canonicalize[don't convert paths to canonical form]" + "($excl)-s[tolerate sloppy mount options]" + "($excl -w -r --read-only)"{-r,--read-only}'[mount read-only]' + "($excl -r -w --rw)"{-w,--rw}'[mount read/write]' + "($excl)-L+[mount partition with specified label]:label:->labels" + "($excl)-U+[mount partition with specified uuid]:uuid" + "($excl -t --types)"{-t+,--types=}'[specify file system type]:file system type:->fslist' + "($excl -O --test-opts)"{-O+,--test-opts=}'[with -a, restrict filesystems by options]:file system option:->fsopt' + "($excl -a -O -o --options)"{-o+,--options=}'[specify file system options]:file system option:->fsopt' + '(: -)'{-B,--bind}'[remount part of filesystem elsewhere]:old directory:_directories:new directory:_directories' + '(: -)'{-R,--rbind}'[remount part of filesystem including submounts elsewhere]:old directory:_directories:new directory:_directories' + '(: -)'{-M,--move}'[move part of filesystem elsewhere]:old directory:_directories:new directory:_directories' + '(: -)--make-'{r,}{shared,slave,private,unbindable}':mount point:->udevordir' ':dev or dir:->devordir' ':mount point:_files -/' ) @@ -693,7 +738,7 @@ if [[ "$service" = mount ]]; then freebsd*|dragonfly*|darwin*) args=( -s '(:)-a[mount all filesystems in fstab]' - '-d[cause everything to be done except for the actual system call]' + '-d[cause everything to be done except for the actual system call]' '-f[forced mount]' '-o[specify file system options]:file system option:->fsopt' '-p[print mounted file systems]' @@ -747,21 +792,22 @@ else '-t[unmount all filesystems of specified type]:file system type:_file_systems' '-v[verbose]' ) - ;; + ;; linux*) + local excl='-V --version -h --help' args=( - '(- *)-h[show help]' - '(- *)-V[show version]' - '(-V -h)-v[verbose mode]' - "(-V -h)-n[don't write /etc/mtab]" - '(-V -h)-r[remount read-only on failure]' - '(-V -h)-d[for loopback mount, free loop device]' - "(-V -h)-i[don't call /sbin/umount.<fs> helper]" - '(-V -h *)-a[unmount all file systems from /etc/mtab]' - '(-V -h)-t[specify file system type]:file system type:_file_systems' - '(-V -h *)-O[with -a, restrict filesystems by options]:file system option:->fsopt' - '(-V -h)-f[force unmount]' - '(-V -h)-l[lazy unmount]' + '(- *)'{-h,--help}'[show help]' + '(- *)'{-V,--version}'[show version]' + "($excl -v --verbose)"{-v,--verbose}'[verbose mode]' + "($excl -n --no-mtab)"{-n,--no-mtab}"[don't write /etc/mtab]" + "($excl)-r[remount read-only on failure]" + "($excl)-d[for loopback mount, free loop device]" + "($excl)-i[don't call /sbin/umount.<fs> helper]" + "($excl *)-a[unmount all file systems from /etc/mtab]" + "($excl)-t[specify file system type]:file system type:_file_systems" + "($excl *)-O[with -a, restrict filesystems by options]:file system option:->fsopt" + "($excl)-f[force unmount]" + "($excl)-l[lazy unmount]" '*:dev or dir:->udevordir' ) ;; @@ -828,7 +874,7 @@ devordir) case "$OSTYPE" in dragonfly*) - while read mline; do + while read mline; do case $mline[(w)1] in \#* ) ;; @@ -849,7 +895,7 @@ devordir) ;; freebsd*) local _glabel - while read mline; do + while read mline; do case $mline[(w)1] in \#* ) ;; @@ -862,7 +908,7 @@ devordir) ;; esac done < /etc/fstab - # + /sbin/ggatel list | while read mline; do dev_tmp+=(/dev/$mline) done @@ -945,6 +991,9 @@ udevordir) 'device-paths: device path:_canonical_paths -A dpath_tmp -N device-paths device\ path' \ 'directories:mount point:_canonical_paths -A mp_tmp -N directories mount\ point' && ret=0 ;; +labels) + _wanted labels expl 'disk label' compadd /dev/disk/by-label/*(:t) && ret=0 + ;; esac return ret diff --git a/Completion/Unix/Command/_mutt b/Completion/Unix/Command/_mutt index c9ff98af4..3d433a0b2 100644 --- a/Completion/Unix/Command/_mutt +++ b/Completion/Unix/Command/_mutt @@ -1,11 +1,14 @@ #compdef mutt -_arguments -s \ +_arguments -s -S \ '::recipient:_email_addresses -n mutt' \ - '*-a[attach file using MIME]:file attachment:_files' \ + '(- :)-A[expand given alias]:alias:_email_addresses -n mutt' \ + '*-a[attach file using MIME]::file attachment:_files' \ '*-b[specify a BCC recipient]:BCC recipient:_email_addresses -n mutt' \ '*-c[specify a CC recipient]:CC recipient:_email_addresses -n mutt' \ - '-e+[specify a post-init configuration command]:post-init configuration:' \ + '(- :)-D[print the value of all variables]' \ + '-d+[log debugging output to ~/.muttdebug0]:level:(1 2 3 4 5)' \ + '-e+[specify a post-init configuration command]:post-init configuration' \ '-f+[specify mailbox to load]:mailbox: _mailboxes' \ '-F+[specify an init file]:init file:_files' \ '-h[display help]' \ @@ -14,6 +17,7 @@ _arguments -s \ '-m+[specify default mailbox type]:mailbox type:(mbox MMDF MH Maildir)' \ '-n[bypass system configuration]' \ '-p[resume postponed message]' \ + '(- :)-Q+[query a configuration variable]:variable:(${${(f)"$(_call_program variables mutt -D 2>/dev/null)"}%%( is|=)*})' \ '-R[open in read-only mode]' \ '-s+[specify a subject]:subject:' \ '-v[display mutt version]' \ diff --git a/Completion/Unix/Command/_nkf b/Completion/Unix/Command/_nkf new file mode 100644 index 000000000..4d541274d --- /dev/null +++ b/Completion/Unix/Command/_nkf @@ -0,0 +1,44 @@ +#compdef nkf + +typeset -A opt_args + +local outputsshort="-j -s -e -w -w8 -w16 -w16b0 -w16b -w16l0 -w16l" +local outputs="$outputsshort --fj --unix --mac --windows --jis --euc --sjis --utf8 --utf16" +local inputs=${outputsshort:u} + +_arguments -s \ + '(-u)-b[Output is buffered]' \ + '(-b)-u[Output is unbuffered]' \ + '($outputs)'{-j,--jis}'[Output is JIS 7 bit]' \ + '($outputs)'{-e,--sjis}'[Output is Shift JIS]' \ + '($outputs)'{-s,--euc}'[Output is EUC-JP]' \ + '($outputs)'{-w,--utf8}'[Output is UTF-8 (No BOM)]' \ + '($outputs)-w8[Output is UTF-8 (BOM)]' \ + '($outputs)'{-w16,-w16b0,--utf16}'[Output is UTF-16 (BigEndian; No BOM)]' \ + '($outputs)-w16b[Output is UTF-16 (BigEndian; BOM)]' \ + '($outputs)-w16l0[Output is UTF-16 (Little Endian; No BOM)]' \ + '($outputs)-w16l[Output is UTF-16 (Little Endian; BOM)]' \ + '($outputs)--fj[Output is for fj]' \ + '($outputs)--unix[Output is for unix]' \ + '($outputs)--mac[Output is for Mac]' \ + '($outputs)--windows[Output is for Windows]' \ + '($inputs)-J[Input assumption is JIS 7 bit]' \ + '($inputs)-E[Input assumption is Shift JIS]' \ + '($inputs)-S[Input assumption is EUC-JP]' \ + '($inputs)-W[Input assumption is UTF-8 (No BOM)]' \ + '($inputs)-W8[Input assumption is UTF-8 (BOM)]' \ + '($inputs)-W16[Input assumption is UTF-16 (BigEndian; No BOM)]' \ + '($inputs)-W16b[Input assumption is UTF-16 (BigEndian; BOM)]' \ + '($inputs)-W16l0[Input assumption is UTF-16 (Little Endian; No BOM)]' \ + '($inputs)-W16l[Input assumption is UTF-16 (Little Endian; BOM)]' \ + '(-M)-m-[MIME decode]:mime decode:((B\:base64 Q\:quoted S\:strict N\:non-strict 0\:no-decode))' \ + '(-m)-M-[MIME encode]:mime encode:((\:header B\:base64 Q\:quoted))' \ + '-h-[hirakana<->katakana]:hirakata:((1\:hirakana-\>katakana 2\:katakana-\>hirakana 3\:both))' \ + '-L-[line mode]:line mode:((u\:LF w\:CRLF m\:CR))' \ + '-I[Convert non ISO-2022-JP charactor to GETA]' \ + '(--cap-input --url-input)'{--cap-input,--url-input}'[Convert hex after \: or \%]' \ + '--overwrite[Overwrite original listed files by filtered result]' \ + '(-v --help)'{-v,--help}'[display help message]' \ + '*:file:_files' && return 0 + +return 1 diff --git a/Completion/Unix/Command/_perforce b/Completion/Unix/Command/_perforce index 2c1365a79..d2943472c 100644 --- a/Completion/Unix/Command/_perforce +++ b/Completion/Unix/Command/_perforce @@ -474,8 +474,17 @@ _perforce_gen_cmd_list() { # Ignore blank lines and the heading line beginning `Perforce...' # Just gets run once, then cached, so don't bother optimising # this to a grossly unreadable parameter substitution. + _perforce_cmd_list=() _perforce_call_p4 help-commands help commands | while read -A hline; do - (( ${#hline} < 2 )) && continue + if (( ${#hline} < 2 )); then + if (( ${#_perforce_cmd_list} )); then + # Ignore comments after the main list of commands, separate by blank + # line. + break + else + continue + fi + fi [[ $hline[1] = (#i)perforce ]] && continue _perforce_cmd_list+=("${hline[1]}:${hline[2,-1]}") done @@ -2010,7 +2019,7 @@ _perforce_cmd_fix() { '-s[set job status]:status:_perforce_statuses' \ '1::-c required:(-c)' \ '2::change:_perforce_changes' \ - "3::job:_perforce_jobs$job" + "*::job:_perforce_jobs$job" } diff --git a/Completion/Unix/Command/_perldoc b/Completion/Unix/Command/_perldoc index 8c816b502..3e58d5a50 100644 --- a/Completion/Unix/Command/_perldoc +++ b/Completion/Unix/Command/_perldoc @@ -15,14 +15,15 @@ fi _arguments -C -s -S -A "-*" \ '(- *)-h[print help information]' \ '(- *)-V[display version information]' \ - '-v[verbose output]' \ + '-D[describe search for the item]' \ '-t[use plain text output instead of nroff]' \ '-u[show raw Pod source]' \ '*-m[display entire module]:module:_perl_modules' \ '-l[display only filename of the module found]' \ '-F[consider arguments as filenames]' \ - '(-q)-f+[view documentation for Perl built-in function]:perl builtin function:->perl-builtin-funcs' \ - '(-f)-q+[search question headings in Perl FAQ]:regular expression' \ + '(-q -v)-f+[view documentation for Perl built-in function]:perl builtin function:->perl-builtin-funcs' \ + '(-f -v)-q+[search question headings in Perl FAQ]:regular expression' \ + '(-f -q)-v+[view documentation for predefined variable]:special variable:->perl-variables' \ '(-d)-T[send output direct to stdout and not via pager]' \ '(-T)-d+[specify output file]:output file:_files' \ '-o+[specify output format]:output format:(man nroff pod rtf text tk xml latex)' \ @@ -54,6 +55,14 @@ case $state in 'files:module or .pod file:_files -g "*.(pod|pm)(-.)"' && ret=0 fi ;; + + perl-variables) + : ${(A)_perl_special_vars:=${(u)${${${(M)${(f)"$(_call_program variables \ + perldoc -u perlvar 2>/dev/null)"}:#\=item [\$\@\%]*}#* }:#\$<I*}}} + + _wanted variables expl 'perl special variable' compadd "$@" -a - \ + _perl_special_vars && ret=0 + ;; esac return ret diff --git a/Completion/Unix/Command/_systemd b/Completion/Unix/Command/_systemd index 585ed9c41..c9fc38a5e 100644 --- a/Completion/Unix/Command/_systemd +++ b/Completion/Unix/Command/_systemd @@ -121,6 +121,7 @@ _hosts_or_user_at_host() "rescue:Enter system rescue mode" "emergency:Enter system emergency mode" "halt:Shut down and halt the system" + "suspend:Suspend the system" "poweroff:Shut down and power-off the system" "reboot:Shut down and reboot the system" "kexec:Shut down and reboot the system with kexec" diff --git a/Completion/Unix/Command/_telnet b/Completion/Unix/Command/_telnet index bab9c8d36..c7ab34f98 100644 --- a/Completion/Unix/Command/_telnet +++ b/Completion/Unix/Command/_telnet @@ -12,6 +12,8 @@ if (( ! $+_telnet_args )); then local help="$(_call_program options 'telnet -\?' < /dev/null 2>&1)" local -A optionmap optionmap=( + '*\[-4\]*' '-4[Force IPv4 address resolution]' + '*\[-6\]*' '-6[Force IPv6 address resolution]' '*\[-8\]*' '-8[allow 8-Bit data]' '*\[-E\]*' '-E[disable an escape character]' '*\[-K\]*' '-K[no automatic login]' @@ -30,11 +32,13 @@ if (( ! $+_telnet_args )); then '*\[-n tracefile\]*' '-n+[specify tracefile]:tracefile:_files' '*\[-r\]*' '-r[rlogin like user interface]' '*\[-s src_addr\]*' '-s+[set source IP address]:src_addr:' + '*\[ -b addr \]*' '-b+[set source IP address]:src_addr:' '*\[-x\]*' '-x' '*\[-t transcom\]*' '-t+:transcom:' '*\[-noasynch\]*' '-noasynch' '*\[-noasyncnet\]*' '-noasyncnet' '*\[-noasynctty\]*' '-noasynctty' + '*\[-z ssl\]*' '*-z[SSL parameters]:SSL parameter:->ssl' ) _telnet_args=($optionmap[(K)"$help"]) (( $#_telnet_args )) || _telnet_args=( '-l+[specify user]:user:->users' ) @@ -46,6 +50,20 @@ _arguments -C -s \ ':port:->ports' && ret=0 case "$state" in +ssl) + _values -w 'SSL parameter' \ + 'debug[Send SSL debugging info to stderr]' \ + '(nossl)ssl[Negotiate SSL connection]' \ + '(ssl)nossl[Switch off SSL negotiation]' \ + 'certrequired[Require server certificate]' \ + 'secure[No fallback to unencrypted mode]' \ + 'verbose[Be verbose about certificates, etc.]' \ + 'verify[Set SSL verify flags]:int:' \ + 'cert[Specify certificate file]:certificate file:_path_files' \ + 'key[Specify key file]:key file:_path_files' \ + 'cipher[Set preferred cipher list]:ciphers:' + ;; + hosts) _wanted hosts expl host \ _combination -s '[@:]' '' users-hosts-ports \ diff --git a/Completion/Unix/Command/_uniq b/Completion/Unix/Command/_uniq index be58fd775..dcd7a6f49 100644 --- a/Completion/Unix/Command/_uniq +++ b/Completion/Unix/Command/_uniq @@ -13,12 +13,17 @@ args=( '(-u --unique)'{-u,--unique}'[only print unique lines]' '(-w --check-chars)'{-w,--check-chars=}'[specify maximum number of characters to compare]:characters' '(-W --check-fields)'{-W,--check-fields=}'[specify maximum number of fields to compare]:fields' + '(-z --zero-terminated)'{-z,--zero-terminated}'[delimit lines with null character, not newline]' '(- *)--help[display help information]' '(- *)--version[display version information]' ) if ! _pick_variant gnu=Free\ Soft unix --version; then - args=( ${(M)args:#(|\*)(|\(*\))-[cdufs]*} ) + local optchars="cdufs" + if [[ "$OSTYPE" == (darwin|freebsd)* ]]; then + optchars="${optchars}i" + fi + args=( ${(M)args:#(|\*)(|\(*\))-[$optchars]*} ) fi _arguments "$args[@]" \ diff --git a/Completion/Unix/Command/_vim b/Completion/Unix/Command/_vim index 2c9b0a1a4..42e5058ec 100644 --- a/Completion/Unix/Command/_vim +++ b/Completion/Unix/Command/_vim @@ -4,6 +4,7 @@ _vim_files () { case $PREFIX in (+*) _files -P './' $* && return 0 ;; + (scp|http(|s)|(|s)ftp):*) _urls ;; (*) _files $* ;; esac case $PREFIX in @@ -21,14 +22,10 @@ arguments=( '( -e -E -s -d -y)-v[vi mode]' '(-v -E -d -y)-e[ex mode]' '(-v -e -d -y)-E[improved ex mode]' - '(-v -e -E -s -y)-d[diff mode]' '(-v -e -E -s -d )-y[easy mode]' - '-R[readonly mode]' - '-Z[restricted mode]' '-m[modifications (writing files) not allowed]' '-M[modifications in text not allowed]' '-b[binary mode]' - '-g[start with GUI]' '-l[lisp mode]' '-C[start in compatible mode]' '-N[start in incompatible mode]' @@ -52,7 +49,6 @@ arguments=( '(-A -H )-F[start in Farsi mode]' '-T[set terminal type]:::_terminals' '-u[use given vimrc file instead of default .vimrc]::rc file:_files' - '-U[use given gvimrc file instead of default .gvimrc]::rc file:_files' '--noplugin[do not load plugin scripts]' '-o-[number of windows to open (default: one for each file)]::window count: ' '-O-[number of windows to vertically split open (default is one for each file)]::window count: ' @@ -76,7 +72,6 @@ arguments=( '--remote-tab-wait[as --remote-wait but open tab page for each file]:*:file:_vim_files' '--remote-tab-wait-silent[as --remote-wait-silent but open tab page for each file]:*:file:_vim_files' '--remote-expr[evaluate given expression in a vim server and print result]:expression: ' - '--echo-wid[echo window ID on STDOUT, GUI version only]' '--literal[do not expand wildcards in arguments (this is useless with ZSH)]' '(- *)--serverlist[list available vim servers and exit]' '--servername[name of vim server to send to or name of server to become]:server name:->server' @@ -88,6 +83,20 @@ arguments=( '(* -q)-t[edit file where tag is defined]:tag:_complete_tag' '(-t -q)*:file:_vim_files' ) +[[ $service != *g* ]] && arguments+='-g[start with GUI]' +[[ $service != r* ]] && arguments+='-Z[restricted mode]' +[[ $service != *diff ]] && arguments+='(-v -e -E -s -y)-d[diff mode]' +[[ $service != *view ]] && arguments+='-R[readonly mode]' +[[ $service = *g* ]] || (( ${words[(I)-g]} )) && arguments+=( + '-font:font:_xft_fonts' + '-geometry:geometry:_x_geometry' + '(-rv -reverse)'{-rv,-reverse}'[use reverse video]' + '-display:display:_x_display' + '--role[set unique role to identify main window]:role' + '--socketid[open vim inside another GTK widget]:xid' + '--echo-wid[echo window ID on stdout]' + '-U[use given gvimrc file instead of default .gvimrc]::rc file:_files' +) _arguments -C -S $arguments && return diff --git a/Completion/Unix/Command/_webbrowser b/Completion/Unix/Command/_webbrowser index d97d5457a..4192aff54 100644 --- a/Completion/Unix/Command/_webbrowser +++ b/Completion/Unix/Command/_webbrowser @@ -1,3 +1,3 @@ -#compdef amaya arena chimera dillo express galeon grail gzilla hotjava konqueror light mmm Mosaic netrik opera phoenix retawq skipstone www xmosaic zen +#compdef amaya arena chimera dillo dwb express galeon grail gzilla hotjava konqueror light mmm Mosaic netrik opera opera-next retawq skipstone www xmosaic zen _alternative 'files:file:_files' 'urls:URL:_urls' diff --git a/Completion/Unix/Command/_xz b/Completion/Unix/Command/_xz new file mode 100644 index 000000000..028285a35 --- /dev/null +++ b/Completion/Unix/Command/_xz @@ -0,0 +1,85 @@ +#compdef xz unxz xzcat=unxz lzma=xz unlzma=unxz lzcat=unxz -redirect-,<,unxz=unxz -redirect-,>,xz=unxz -redirect-,<,xz=xz -value-,XZ_OPT,-default- -value-,XZ_DEFAULTS,-default- + +local decompress files expl state line curcontext="$curcontext" ret=1 +typeset -A opt_args +local decomp="(-z --compress --decompress -d --test -t --list -l --single-stream --no-sparse)" + +files=( '(--files --files0)*:files:->files' ) +case "$service" in + *XZ_*) + compset -q + words=( fake "$words[@]" ) + (( CURRENT++ )) + files=() + ;& + xz) decompress=no;& + unxz) _arguments -C -s -S "$files[@]" \ + '(- *)'{-h,--help}'[display help message]' \ + '(- *)'{-H,--long-help}'[display the long help (lists also the advanced options)]' \ + '(-d --decompress --compress -z --test -t --list -l)'{-d,--decompress}'[decompress]' \ + "${decomp}"{-z,--compress}'[compress]' \ + '(-k --keep)'{-k,--keep}"[keep (don't delete) input files]" \ + '(-f --force)'{-f,--force}'[force overwrite]' \ + '(-t --test --decompress -d --compress -z --list -l)'{-t,--test}'[test compressed file integrity]' \ + '(-t --test --decompress -d --compress -z --list -l)'{-l,--list}'[list information about .xz files]' \ + '(-c --stdout)'{-c,--stdout}'[write on standard output]' \ + \*{-q,--quiet}'[suppress all warnings]' \ + \*{-v,--verbose}'[verbose mode]' \ + '(- *)'{-V,--version}'[display version number]' \ + '(-e --extreme)'{-e,--extreme}'[try to improve compression ratio by using more CPU time]' \ + '(-1 -2 -3 -4 -5 -6 -7 -8 -9 --fast )--best' \ + '(-1 -2 -3 -4 -5 -6 -7 -8 -9 --best)--fast' \ + '( -2 -3 -4 -5 -6 -7 -8 -9 --fast --best)-1' \ + '(-1 -3 -4 -5 -6 -7 -8 -9 --fast --best)-2' \ + '(-1 -2 -4 -5 -6 -7 -8 -9 --fast --best)-3' \ + '(-1 -2 -3 -5 -6 -7 -8 -9 --fast --best)-4' \ + '(-1 -2 -3 -4 -6 -7 -8 -9 --fast --best)-5' \ + '(-1 -2 -3 -4 -5 -7 -8 -9 --fast --best)-6' \ + '(-1 -2 -3 -4 -5 -6 -8 -9 --fast --best)-7' \ + '(-1 -2 -3 -4 -5 -6 -7 -9 --fast --best)-8' \ + '(-1 -2 -3 -4 -5 -6 -7 -8 --fast --best)-9' \ + "${decomp}--single-stream[decompress only the first stream]" \ + "${decomp}--no-sparse[do not create sparse files when decompressing]" \ + '(* --files --files0)--files=-[read list of files to process from file]::file:_files' \ + '(* --files --files0)--files0=-[read null terminated list of files to process from file]::file:_files' \ + '(-F --format)'{-F,--format}'=[specify file format]:format;(auto xz lzma raw)' \ + '(-C --check)'{-C,--check}'=[integrity check type]:check type:(none crc32 crc64 sha256)' \ + '--memlimit-compress=[set memory usage limit for compression]:memory usage' \ + '--memlimit-decompress=[set memory usage limit for decompression]:memory usage' \ + '(-M --memlimit --memory)'{-M+,--memlimit=,--memory=}'[set memory usage limit]:memory usage' \ + '--no-adjust[give error if settings exceed memory limit]' \ + '(-Q --no-warn)'{-Q,--no-warn}'[make warnings not affect exit status]' \ + '--robot[use machine-parsable messages]' \ + --{x86,powerpc,ia64,arm,armthumb,sparc}=-'[add a branch/call/jump filter]::option:->bcj-options' \ + --lzma{1,2}=-'[add lzma filter]::option:->lzma-options' \ + '--delta=-[add delta filter]::option:->delta-options' \ + '(- *)--info-memory[display amount of RAM and memory usage limits]' && ret=0 + ;; +esac + +case $state in + files) + (( $+opt_args[-z] || $+opt_args[--compress] )) && decompress=no + [[ -n $opt_args[(i)-([dtl]|-decompress|-test|-list)] ]] && unset decompress + if [[ -z "$decompress" ]]; then + _description files expl 'compressed file' + _files "$expl[@]" -g '*.(xz|txz|lzma|tlz)(-.)' && return + else + _description files expl 'file to compress' + _files "$expl[@]" -g '^*.(xz|txz|lzma|tlz)(-.)' && return + fi + ;; + lzma-options) + _values -s , options 'preset:preset' 'dict:size' 'lc:context bits' \ + 'lp:position bits' 'mf:matchfinder:(hc3 hc4 bt2 bt3 bt4)' \ + 'mode:mode:(fast normal)' 'nice:length' 'depth:depth' && ret=0 + ;; + bcj-options) + _values options 'start:offset' && return + ;; + delta-options) + _values options 'dist:distance' && return + ;; +esac + +return ret |