From b32f902ba598c851196b037178233477c2411876 Mon Sep 17 00:00:00 2001 From: Paul Ackersviller Date: Mon, 3 Dec 2007 02:31:49 +0000 Subject: Bring various .distfiles up to date and merge any extra completions onto 4.2 branch. --- Completion/BSD/Command/.distfiles | 5 + Completion/Base/Utility/.distfiles | 8 + Completion/Darwin/Command/.distfiles | 4 + Completion/Debian/Command/.distfiles | 22 ++- Completion/Debian/Command/_debdiff | 22 +++ Completion/Debian/Command/_linda | 26 +++ Completion/Debian/Command/_mergechanges | 5 + Completion/Debian/Command/_wanna-build | 44 +++++ Completion/Linux/Command/_sshfs | 14 ++ Completion/Linux/Command/_tpb | 20 ++ Completion/Linux/Command/_tpconfig | 24 +++ Completion/Redhat/Command/.distfiles | 6 + Completion/Redhat/Command/_yum | 294 ++++++++++++++++++++++++++++ Completion/Unix/Command/.distfiles | 245 ++++++++++++++++++++--- Completion/Unix/Command/_arp | 14 ++ Completion/Unix/Command/_cdrecord | 4 +- Completion/Unix/Command/_cp | 32 +++ Completion/Unix/Command/_cplay | 2 +- Completion/Unix/Command/_diffstat | 19 ++ Completion/Unix/Command/_flasher | 29 +++ Completion/Unix/Command/_gcc | 335 ++++++++++++++++++++++++++++++++ Completion/Unix/Command/_getconf | 7 + Completion/Unix/Command/_gnutls | 126 ++++++++++++ Completion/Unix/Command/_joe | 39 ++++ Completion/Unix/Command/_mh | 6 + Completion/Unix/Command/_ping | 63 ++++++ Completion/Unix/Command/_quilt | 36 ++-- Completion/Unix/Command/_sed | 27 +++ Completion/Unix/Command/_su | 69 +++++++ Completion/Unix/Command/_totd | 13 ++ Completion/Unix/Type/.distfiles | 58 ++++-- Completion/Unix/Type/_list_files | 69 +++++++ Completion/Unix/Type/_path_commands | 77 ++++++++ Completion/X/Command/.distfiles | 16 +- Completion/Zsh/Command/_precommand | 6 + 35 files changed, 1716 insertions(+), 70 deletions(-) create mode 100644 Completion/BSD/Command/.distfiles create mode 100644 Completion/Base/Utility/.distfiles create mode 100644 Completion/Darwin/Command/.distfiles create mode 100644 Completion/Debian/Command/_debdiff create mode 100644 Completion/Debian/Command/_linda create mode 100644 Completion/Debian/Command/_mergechanges create mode 100644 Completion/Debian/Command/_wanna-build create mode 100644 Completion/Linux/Command/_sshfs create mode 100644 Completion/Linux/Command/_tpb create mode 100644 Completion/Linux/Command/_tpconfig create mode 100644 Completion/Redhat/Command/.distfiles create mode 100644 Completion/Redhat/Command/_yum create mode 100644 Completion/Unix/Command/_arp create mode 100644 Completion/Unix/Command/_cp create mode 100644 Completion/Unix/Command/_diffstat create mode 100644 Completion/Unix/Command/_flasher create mode 100644 Completion/Unix/Command/_gcc create mode 100644 Completion/Unix/Command/_gnutls create mode 100644 Completion/Unix/Command/_joe create mode 100644 Completion/Unix/Command/_ping create mode 100644 Completion/Unix/Command/_sed create mode 100644 Completion/Unix/Command/_su create mode 100644 Completion/Unix/Command/_totd create mode 100644 Completion/Unix/Type/_list_files create mode 100644 Completion/Unix/Type/_path_commands create mode 100644 Completion/Zsh/Command/_precommand diff --git a/Completion/BSD/Command/.distfiles b/Completion/BSD/Command/.distfiles new file mode 100644 index 000000000..188292f3e --- /dev/null +++ b/Completion/BSD/Command/.distfiles @@ -0,0 +1,5 @@ +DISTFILES_SRC=' +.distfiles +_bsd_pkg _cvsup _kld _chflags +_csup _portlint _portsnap +' diff --git a/Completion/Base/Utility/.distfiles b/Completion/Base/Utility/.distfiles new file mode 100644 index 000000000..9be8b0100 --- /dev/null +++ b/Completion/Base/Utility/.distfiles @@ -0,0 +1,8 @@ +DISTFILES_SRC=' +.distfiles +_alternative _call_program _nothing _sub_commands +_arg_compile _combination _regex_arguments _values +_arguments _set_command _retrieve_cache _guard +_cache_invalid _describe _sep_parts _pick_variant +_call_function _multi_parts _store_cache _regex_words +' diff --git a/Completion/Darwin/Command/.distfiles b/Completion/Darwin/Command/.distfiles new file mode 100644 index 000000000..e52f4a980 --- /dev/null +++ b/Completion/Darwin/Command/.distfiles @@ -0,0 +1,4 @@ +DISTFILES_SRC=' +.distfiles +_defaults _fink _hdiutil _open _qtplay _softwareupdate +' diff --git a/Completion/Debian/Command/.distfiles b/Completion/Debian/Command/.distfiles index d1fbaf745..cabcdd3d8 100644 --- a/Completion/Debian/Command/.distfiles +++ b/Completion/Debian/Command/.distfiles @@ -1,10 +1,18 @@ DISTFILES_SRC=' .distfiles -_apt _bts _dpkg _update-alternatives -_aptitude _bug _dpkg_source _update-rc.d -_apt-move _debchange _dput -_apt-show-versions _debfoster _dupload -_auto-apt _debsign _lintian _make-kpkg _wajig -_dchroot _dlocate _dpkg-cross _madison _module-assistant -_piuparts _toolchain-source +_a2utils _dak _dpkg_source _piuparts +_apt _dchroot _dput _reprepro +_apt-file _dchroot-dsa _dupload _schroot +_aptitude _debchange _invoke-rc.d _toolchain-source +_apt-move _debdiff _linda _update-alternatives +_apt-show-versions _debfoster _lintian _update-rc.d +_auto-apt _debsign _madison _uscan +_bts _dlocate _make-kpkg _wajig +_bug _dpkg _mergechanges _wanna-build +_cdbs-edit-patch _dpkg-cross _module-assistant +_dpatch-edit-patch +_dpkg-buildpackage +_dpkg-repack +_lighttpd +_svn-buildpackage ' diff --git a/Completion/Debian/Command/_debdiff b/Completion/Debian/Command/_debdiff new file mode 100644 index 000000000..de7b9b9c8 --- /dev/null +++ b/Completion/Debian/Command/_debdiff @@ -0,0 +1,22 @@ +#compdef debdiff + +_arguments \ + '(-d --dirs)'{-d,--dirs}'[do not ignore directories]' \ + '--nodirs[ignore directories]' \ + '(-m --move)'{-m,--move}':movement:_files' \ + '--move-regex:movement:_files' \ + '--nocontrol[do not compare control files]' \ + '--control[compare control files]' \ + '--wp[pass -p to wdiff]' \ + '--wl[pass -l to wdiff]' \ + '--wt[pass -t to wdiff]' \ + '--show-moved[show movements between packages]' \ + '--noshow-moved[do not show movements between packages]' \ + '--renamed:package:_deb_packages avail' \ + '(--no-conf --noconf)'{--no-conf,--noconf}'[do not read any config files]' \ + '(-h --help)'{-h,--help}'[show help]' \ + '(-v --version)'{-v,--version}'[show version]' \ + '(-q --quiet)'{-q,--quiet}'[be quiet if no differences]' \ + '--from:debs:_files -g "*.deb"' \ + '--to:debs:_files -g "*.deb"' \ + '*:file to compare:_files -g "*.(deb|changes|dsc)"' diff --git a/Completion/Debian/Command/_linda b/Completion/Debian/Command/_linda new file mode 100644 index 000000000..d428d18a8 --- /dev/null +++ b/Completion/Debian/Command/_linda @@ -0,0 +1,26 @@ +#compdef linda + +_arguments \ + '(-c --config)'{-c,--config=}':config file:_files' \ + '(-C --checks)'{-C,--checks=}':check regexes:' \ + '(-d --debug)*'{-d,--debug}'[debug]' \ + '(-D --disable-local)*'{-D,--disable-local}'[disable registration of local checks]' \ + '(-f --format)'{-f,--format=}':output format:(branden long lintian figlet)' \ + '(-h --help)'{-h,--help}'[help]' \ + '(-i --info)'{-i,--info}'[info]' \ + '(-l --lab)'{-l,--lab=}':lab root:_files -/' \ + '(-L --list-checks)'{-L,--list-checks=}':list checks:' \ + '(-m --more-overrides)'{-m,--more-overrides=}':more overrides:' \ + '(-n --no-cull)'{-n,--no-cull}'[do not delete lab after completion]' \ + '(-o --show-overridden)'{-o,--show-overridden}'[display errors that are overridden]' \ + '(-p --print-overrides)'{-p,--print-overrides}'[print parsed overrides]' \ + '(-P --profiling)'{-P,--profiling}'[print profiling stats]' \ + '(-q --quiet)'{-q,--quiet}'[quiet]' \ + '(-s --show-tag)'{-s,--show-tag}'[print tag along with errors]' \ + '(-S --seteuid)'{-S,--seteuid}'[do not seteuid to nobody]' \ + '(-t --types)'{-t,--types=}':types string:_values -s , "types" Error Warning eXperimental Informational' \ + '(-T --traceback)'{-T,--traceback}'[show a traceback from any exception]' \ + '(-U --unpack)'{-U,--unpack}':unpack level:' \ + '(-v --verbose)'{-v,--verbose}'[verbose]' \ + '(-V --version)'{-V,--version}'[version]' \ + ':package:_files -g "*.(changes|u#deb|dsc)"' diff --git a/Completion/Debian/Command/_mergechanges b/Completion/Debian/Command/_mergechanges new file mode 100644 index 000000000..607fdacb0 --- /dev/null +++ b/Completion/Debian/Command/_mergechanges @@ -0,0 +1,5 @@ +#compdef mergechanges + +_arguments \ + '-f[output to file]' \ + '*:changes file:_files -g "*.changes(-.)"' diff --git a/Completion/Debian/Command/_wanna-build b/Completion/Debian/Command/_wanna-build new file mode 100644 index 000000000..779906afb --- /dev/null +++ b/Completion/Debian/Command/_wanna-build @@ -0,0 +1,44 @@ +#compdef wanna-build + +_arguments \ + '(-v --verbose)'{-v,--verbose}'[verbose]' \ + '--take[take package for building]' \ + '(-f --failed)'{-f,--failed}'[record as failed]' \ + '(-u --uploaded)'{-u,--uploaded}'[record as uploaded]' \ + '(-n --no-build)'{-n,--no-build}'[record as undesired]' \ + '--dep-wait[record as waiting for source dependencies]' \ + '--merge-quinn[merge quinn-diff output into database]' \ + '--merge-partial-quinn[merge partial quinn-diff output into database]' \ + '--merge-packages[merge Packages files into database]' \ + '--merge-sources[merge Sources files into database]' \ + '--merge-all' \ + '--pretend-avail[pretend that given packages are available now]' \ + '(-i --info)'{-i,--info=}':source package:_deb_packages avail' \ + '(-l --list)'{-l,--list=}':state:(needs-build building uploaded failed installed dep-wait not-for-us all failed-removed dep-wait-removed install-wait reupload-wait)' \ + '(-m --message)'{-m,--message=}':message:' \ + '(-o --override)'{-o,--override}"[override another user's lock]" \ + '(-U --user)'{-U,--user=}':user name:' \ + '--import:ASCII file:_files' \ + '--export:ASCII file:_files' \ + '--create-db[create database]' \ + '--correct-compare' \ + '(-N --no-propagation)'{-N,--no-propagation} \ + '(-D --no-down-propagation)'{-D,--no-down-propagation} \ + '--give-back[give package back]' \ + '--forget' \ + '--forget-user' \ + '--binNMU:version:' \ + '--perm-build-priority:priority:' \ + '--build-priority:priority:' \ + '(-d --dist)'{-d,--dist=}':distribution:(stable testing unstable all)' \ + '(-O --order)'{-O,--order=}':ordering:(P S p s n c b)' \ + '(-b --database)'{-b,--database=}':database:' \ + '(-A --arch)'{-A,--arch=}':architecture:' \ + '(-c --category)'{-c,--category=}':category:(uploaded-fixed-pkg fix-expected reminder-sent nmu-offered easy medium hard compiler-error none)' \ + '(-a --min-age)'{-a,--min-age=}':minimum age:' \ + '--max-age:maximum age:' \ + '--manual-edit' \ + '--maintlock-create' \ + '--maintlock-remove' \ + '--clean-db' \ + ':package_version:_deb_packages avail' diff --git a/Completion/Linux/Command/_sshfs b/Completion/Linux/Command/_sshfs new file mode 100644 index 000000000..c6a8e102d --- /dev/null +++ b/Completion/Linux/Command/_sshfs @@ -0,0 +1,14 @@ +#compdef sshfs + +_arguments \ + '-V[version]' \ + '-p:tcp port:' \ + '-C[compression]' \ + '-o:options:_values -s , "sshfs or fuse or mount options" reconnect sshfs_sync no_readahead sshfs_debug cache=:cache\ setting:(yes no) cache_timeout=:seconds: cache_stat_timeout=:seconds: cache_dir_timeout=:seconds: cache_link_timeout=:seconds: ssh_command=:ssh\ command:_command_names directport=:port: SSHOPT=:ssh\ option: default_permissions allow_other allow_root kernel_cache large_read direct_io max_read=:size: hard_remove debug fs_name=:name: use_ino readdir_ino' \ + '-d[debug]' \ + '-f[foreground]' \ + '-s[disable multithreaded operation]' \ + '-r[mount read-only]' \ + '-h[help]' \ + ':remote directory:_user_at_host -S:' \ + ':mountpoint:_files -/' diff --git a/Completion/Linux/Command/_tpb b/Completion/Linux/Command/_tpb new file mode 100644 index 000000000..c4c4c2bbd --- /dev/null +++ b/Completion/Linux/Command/_tpb @@ -0,0 +1,20 @@ +#compdef tpb + +_arguments \ + '(-h --help)'{-h,--help}'[help]' \ + '(-d --daemon)'{-d,--daemon}'[start up as daemon]' \ + '(-c --config)'{-c,--config=}':config file:_files' \ + '(-A --apm)'{-A,--apm=}':state:(on off)' \ + '(-P --powermgt)'{-P,--powermgt=}':state:(on off)' \ + '(-x --xevents)'{-x,--xevents=}':state:(on off)' \ + '(-m --mixer)'{-m,--mixer=}':state:(on off)' \ + '(-o --osd)'{-o,--osd=}':state:(on off)' \ + '(-p --poll)'{-p,--poll=}':delay in microseconds:' \ + '(-t --thinkpad)'{-t,--thinkpad=}':command to execute:_command_names' \ + '(-H --home)'{-H,--home=}':command to execute:_command_names' \ + '(-S --search)'{-S,--search=}':command to execute:_command_names' \ + '(-M --mail)'{-M,--mail=}':command to execute:_command_names' \ + '(-W --wireless)'{-W,--wireless=}':command to execute:_command_names' \ + '(-C --callback)'{-C,--callback=}':command to execute:_command_names' \ + '(-v --verbose)'{-v,--verbose=}'[print information about pressed keys]' + diff --git a/Completion/Linux/Command/_tpconfig b/Completion/Linux/Command/_tpconfig new file mode 100644 index 000000000..62f216107 --- /dev/null +++ b/Completion/Linux/Command/_tpconfig @@ -0,0 +1,24 @@ +#compdef tpconfig + +_arguments \ + '--help' \ + '(-D --debug)'{-D,--debug=}':debug level:(1 2 3)' \ + '(-d --device)'{-d,--device=}':mouse device:_files' \ + '--version' \ + '(-i --info)'{-i,--info}'[display current touchpad config]' \ + '(-x --reset)'{-x,--reset}'[perform a software reset on the touchpad]' \ + '(-q --quiet --silent)'{-q,--quiet,--silent}'[suppress verbose output]' \ + '-a::packet mode:(0 1)' \ + '--absolute[set packet mode to absolute]' \ + '--relative[set packet mode to relative]' \ + '-r::reporting rate:(0 1)' \ + '-t::tapping mode:(0 1 2 3)' \ + '-s::sleep mode:(0 1)' \ + '(-2 --two-button)'{-2,--two-button}'[set two-button mode]' \ + '(-3 --three-button)'{-3,--three-button}'[set three-button mode]' \ + '(-c --corner)'{-c,--corner=}'::corner-tap mode:(0 1)' \ + '(-e --edgemode)'{-e,--edgemode=}'::edge motion:(0 1 3)' \ + '-m[display which mouse button is simulated by corner taps]' \ + '--middle-button[make corner taps simulate the middle mouse button]' \ + '--right-button[make corner taps simulate the right mouse button]' \ + '(-z --zthreshold)'{-z,--zthreshold=}'::tap sensitivity:' diff --git a/Completion/Redhat/Command/.distfiles b/Completion/Redhat/Command/.distfiles new file mode 100644 index 000000000..9f0a3ef6a --- /dev/null +++ b/Completion/Redhat/Command/.distfiles @@ -0,0 +1,6 @@ +DISTFILES_SRC=' +.distfiles +_rpm +_service +_yum +' diff --git a/Completion/Redhat/Command/_yum b/Completion/Redhat/Command/_yum new file mode 100644 index 000000000..8988b43d7 --- /dev/null +++ b/Completion/Redhat/Command/_yum @@ -0,0 +1,294 @@ +#compdef yum + +# Main dispatcher +_yum() +{ + local curcontext="$curcontext" state lstate line + + _arguments -s \ + {-h,--help}'[show the help message]' \ + {-t,--tolerant}'[be tolerant of errors]' \ + '-C[Run entirely from cache]' \ + '-c[Config file location]:Yum conf file:_files' \ + '-R[Maximum command wait time (in minutes)]:Max wait time' \ + '-d[Debug level (0-10)]:Debug level' \ + '-e[Error level (0-10)]:Error level' \ + '-y[Answer yes for all questions]' \ + '--installroot=[Set install root]:Install Root:_files -/' \ + '*--enablerepo=[Enable or or more repositories]:Repos to enable:_yum_disabled_repos_list' \ + '*--disablerepo=[Disable one or more repositories]:Disable Repos:_yum_enabled_repos_list' \ + '--exclude=[Exclude package(s) by name or glob]:Exclude Packages' \ + '--version[Show yum version]' \ + '--obseletes[Enable obsoletes processing during updates]' \ + '--noplugins[Disable yum plugins]' \ + '*::yum command:_yum_command' +} + +(( $+functions[_yum_command] )) || _yum_command() +{ + local -a _yum_cmds + _yum_cmds=( + "install:Install the latest version of a package or group of packages" + "erase:Remove an installed package (with its dependencies)" + "remove:Remove an installed package (with its dependencies)" + "clean:Clean local yum cache" + "deplist:Gives a list of all dependencies for a package" + "check-update:Check if any updates are available" + "info:Get description of available packages" + "list:Is used to list various information about packages" + "groupinfo:Get info on package groups" + "groupinstall:Install a package group or groups" + "groupremove:Remove a package group or groups" + "grouplist:List package groups" + "groupupdate:Update a package group or groups" + "localinstall:Install packages with local rpm files" + "localupdate:Update packages with local rpm files" + "makecache:Makes a local yum cache" + "provides:Find out which package provides some feature or file" + "whatprovides:Find out which package provides some feature or file" + "resolvedep:List packages providing the specified dependencies" + "search:Find any packages matching pattern" + "shell:Enter the 'yum shell'" + "update:Update one or more packages" + "upgrade:Upgrade one or more packages" + ) + + if (( CURRENT == 1 )); then + _describe -t commands 'yum command' _yum_cmds || compadd "$@" + else + local curcontext="$curcontext" + + cmd="${${_yum_cmds[(r)$words[1]:*]%%:*}}" + # Deal with any aliases + case $cmd in + remove) cmd="erase";; + whatprovides) cmd="provides";; + upgrade) cmd="update";; + esac + + if (( $#cmd )); then + curcontext="${curcontext%:*:*}:yum-${cmd}:" + + local update_policy + zstyle -s ":completion:${curcontext}:" cache-policy update_policy + if [[ -z "$update_policy" ]]; then + zstyle ":completion:${curcontext}:" cache-policy _yum_caching_policy + fi + + _call_function ret _yum_$cmd || _message 'no more arguments' + else + _message "unknown yum command: $words[1]" + fi + return ret + fi +} + +# Fills the installed pkg cache +_yum_all_pkgs() +{ + if ( [[ ${+_all_pkgs} -eq 0 ]] || _cache_invalid ALL ) && + ! _retrieve_cache ALL; + then + local prog="yum -C list all | sed 's/\s.*//' | grep '\.'" + _all_pkgs=( $(kages $prog 2>/dev/null) ) + _store_cache ALL _all_pkg + fi +} + +# Fills the installed pkg cache +_yum_installed_pkgs() +{ + if ( [[ ${+_installed_pkgs} -eq 0 ]] || _cache_invalid INSTALLED ) && + ! _retrieve_cache INSTALLED; + then + _installed_pkgs=( $(yum -C list installed | sed 's/\s.*//' | grep '\.' 2>/dev/null) ) + _store_cache INSTALLED _installed_pkgs + fi +} + +# Fills the available pkg cache +_yum_available_pkgs() +{ + if ( [[ ${+_available_pkgs} -eq 0 ]] || _cache_invalid AVAILABLE ) && + ! _retrieve_cache AVAILABLE; + then + _available_pkgs=( $(yum -C list available | sed 's/\s.*//' | grep '\.' 2>/dev/null) ) + _store_cache AVAILABLE _available_pkgs + fi +} + +# Fills the upgrade pkg cache +_yum_upgrade_pkgs() +{ + if ( [[ ${+_upgrade_pkgs} -eq 0 ]] || _cache_invalid UPGRADE ) && + ! _retrieve_cache UPGRADE; + then + _upgrade_pkgs=( $(yum -C list upgrade | sed 's/\s.*//' | grep '\.' 2>/dev/null) ) + _store_cache UPGRADE _upgrade_pkgs + fi +} + +# Gets the list of defined repos +yum_repos() { + local trepo + local -a tarray + tarray=( $(egrep -h '(^\[.*\]|^enabled.*=)' /etc/yum.repos.d/*.repo /etc/yum.conf | sed -e 's/ //g' | sed -e 's/\[//g' | sed -e 's/\].*$//g' 2>/dev/null) ) + local -i eindex=0 + local -i dindex=0 + for line in $tarray; do + if [[ "$line" = "enabled=1" ]]; then + enabled_yum_repos=($enabled_yum_repos $trepo) + elif [[ "$line" = "enabled=0" ]]; then + disabled_yum_repos=($disabled_yum_repos $trepo) + elif [[ "$line" != "main" ]]; then + trepo=$line + fi + done +} + +(( $+functions[_yum_disabled_repos_list] )) || _yum_disabled_repos_list() +{ + yum_repos + compadd "$@" -a -- disabled_yum_repos +} + +(( $+functions[_yum_enabled_repos_list] )) || _yum_enabled_repos_list() +{ + yum_repos + compadd "$@" -a -- enabled_yum_repos +} + +# Completion function for erase|remove +(( $+functions[_yum_erase] )) || _yum_erase() +{ + _yum_installed_pkgs + compadd "$@" -a -- _installed_pkgs +} + +# Completion function for install +(( $+functions[_yum_install] )) || _yum_install() +{ + _yum_available_pkgs + compadd "$@" -a -- _available_pkgs +} + +# Completion function for localinstall +(( $+functions[_yum_localinstall] )) || _yum_localinstall() +{ + _files -g '(#i)*.rpm(-.)' +} + +# Completion function for localupdate +(( $+functions[_yum_localupdate] )) || _yum_localupdate() +{ + _files -g '(#i)*.rpm(-.)' +} + +# Completion function for update/upgrade +(( $+functions[_yum_update] )) || _yum_update() +{ + _yum_upgrade_pkgs + compadd "$@" -a -- _upgrade_pkgs +} + +# Completion function for deplist +(( $+functions[_yum_deplist] )) || _yum_deplist() +{ + _yum_available_pkgs + compadd "$@" -a -- _available_pkgs +} + +_yum_all() +{ + _yum_all_pkgs + compadd "$@" -a -- _all_pkgs +} +_yum_list_or_info() +{ + local -a listlist + listlist=( + "all:all packages in repositories" + "available:packages available in repositories" + "updates:packages with updates available" + "installed:installed packages" + "extras:packages installed that are not available in any yum repository" + "obsoletes:packages installed that are obsoleted" + "recent:packages recently added to repositories" + ) + + if (( CURRENT == 2 )); then + _describe -t yum-list-subcmds "Yum info/list sub-commands" listlist || _yum_all + else + local subcmd + subcmd="${${listlist[(r)$words[2]:*]%%:*}}" + # Deal with any aliases + case $subcmd in + installed) _yum_erase;; + available) _yum_install;; + updates) _yum_update;; + esac + fi +} + +# Completion function for list +(( $+functions[_yum_list] )) || _yum_list() +{ + _yum_list_or_info +} + +# Completion function for info +(( $+functions[_yum_info] )) || _yum_info() +{ + _yum_list_or_info +} + +# Completion function for provides|whatprovides +(( $+functions[_yum_provides] )) || _yum_provides() +{ + _files +} + +# Completion function for resolvedep +(( $+functions[_yum_resolvedep] )) || _yum_resolvedep() +{ + _files +} + +# Completion function for clean +(( $+functions[_yum_clean] )) || _yum_clean() +{ + local -a cleanlist + cleanlist=( + "all:all cache" + "cache:all cache" + "dbcache:DB cache" + "headers:cache headers" + "packages:cache packages" + "metadata:cache meta-data" + ) + + if (( CURRENT == 2 )); then + _describe -t yum-clean-subcmds "Yum clean sub-commands" cleanlist + fi +} + +_yum_caching_policy() +{ + local _yumrepomds + + # rebuild if cache is more than a week old + oldp=( "$1"(mw+1) ) + (( $#oldp )) && return 0 + + _yumrepomds=( /var/cache/yum/**/repomd.xml ) + + if (( $#_yumrepomds )); then + for repo in $_yumrepomds; do + [[ "$repo" -nt "$1" ]] && return 0 + done + fi + + return 1 +} + +_yum "$@" diff --git a/Completion/Unix/Command/.distfiles b/Completion/Unix/Command/.distfiles index 9be819220..9f1a737ca 100644 --- a/Completion/Unix/Command/.distfiles +++ b/Completion/Unix/Command/.distfiles @@ -1,33 +1,218 @@ DISTFILES_SRC=' .distfiles -_a2ps _bittorrent _darcs -_dvi _gzip _man _rcs _w3m -_apachectl _enscript _iconv _mh _rlogin _webbrowser -_cdrecord _fakeroot _imagemagick _mount _sh _wget -_arp _fetchmail _init_d _mutt _slrn _whereis -_bison _find _ispell _mysql_utils _socket _whois -_bzip2 _finger _java _ncftp _ssh _xargs -_chown _flex _joe _nslookup _strip _yodl -_compress _gcc _killall _pack _stty _yp -_configure _gdb _look _patch _su _zcat -_cpio _getconf _lp _pbm _sudo _zdump -_cvs _gnu_generic _ls _perl _tar _zip -_dd _gprof _lynx _perldoc _telnet _pine -_dict _grep _lzop _prcs _tiff _elm -_diff _gs _make _psutils _tin _mail -_last _loadkeys _ruby _sysctl _links _samba -_user_admin _rsync _arping _spamassassin _mtools _ifconfig -_fsh _chkconfig _cdcd _irssi _mysqldiff _sccs -_aap _ant _antiword _apm _attr -_baz _bogofilter -_cal _chmod _du _ecasound _elinks _figlet -_getent _global _gpg _gphoto2 _less _lsof -_mencal _mpc _mt _mtr -_netcat _nice _nmap -_perforce _php _postfix _printenv _python -_raggle _rar _renice -_sablotron _screen _sed _subversion -_texinfo _tla _tidy -_unace _uniq _vorbis _vux _wiggle _xmlsoft -_bzr _cplay _date _git _quilt +_a2ps +_aap +_ant +_antiword +_apachectl +_apm +_arp +_arping +_attr +_baz +_bison +_bittorrent +_bogofilter +_bzip2 +_bzr +_cal +_ccal +_cdcd +_cdrdao +_cdrecord +_chkconfig +_chmod +_chown +_comm +_compress +_configure +_cowsay +_cp +_cpio +_cplay +_cssh +_cut +_cvs +_darcs +_date +_dd +_dhclient +_dict +_diff +_diffstat +_dmidecode +_du +_dvi +_ecasound +_elinks +_elm +_enscript +_env +_fakeroot +_fetchmail +_figlet +_find +_finger +_flasher +_flex +_fortune +_fsh +_fuser +_gcc +_gdb +_genisoimage +_getconf +_getent +_getmail +_git +_global +_gnu_generic +_gnutls +_gpg +_gphoto2 +_gprof +_grep +_groff +_growisofs +_gs +_guilt +_gzip +_iconv +_ifconfig +_imagemagick +_init_d +_ip +_irssi +_ispell +_java +_joe +_killall +_knock +_kvno +_last +_ldd +_less +_links +_loadkeys +_locate +_look +_lp +_ls +_lsof +_lynx +_lzop +_mail +_make +_man +_md5sum +_mencal +_mercurial +_metaflac +_mh +_mkdir +_module +_monotone +_mount +_mpc +_mt +_mtools +_mtr +_mutt +_mysql_utils +_mysqldiff +_ncftp +_netcat +_nice +_nmap +_nslookup +_pack +_patch +_pax +_pbm +_perforce +_perl +_perldoc +_php +_pine +_ping +_pkg-config +_pon +_postfix +_prcs +_printenv +_psutils +_pump +_python +_qemu +_quilt +_raggle +_rake +_ranlib +_rar +_rcs +_renice +_ri +_rlogin +_rrdtool +_rsync +_rubber +_ruby +_sablotron +_samba +_sccs +_screen +_sed +_sh +_showmount +_sisu +_slrn +_socket +_spamassassin +_sqsh +_ssh +_strip +_stty +_su +_subversion +_sudo +_surfraw +_sysctl +_tar +_tardy +_tcptraceroute +_telnet +_texinfo +_tidy +_tiff +_tin +_tla +_todo.sh +_toilet +_totd +_tracepath +_twisted +_unace +_uname +_unexpand +_uniq +_units +_user_admin +_vim +_vorbis +_vorbiscomment +_vux +_w3m +_webbrowser +_wget +_whereis +_whois +_wiggle +_xargs +_xmlsoft +_yafc +_yodl +_yp +_zcat +_zdump +_zip ' diff --git a/Completion/Unix/Command/_arp b/Completion/Unix/Command/_arp new file mode 100644 index 000000000..b46d2daf0 --- /dev/null +++ b/Completion/Unix/Command/_arp @@ -0,0 +1,14 @@ +#compdef arp + +local state line expl curcontext="$curcontext" + +_arguments -C \ + '(-d -s -f 1)-a[show entries for all or specified hosts]:host:->hostintable' \ + '(-a -s -f 1)-d[delete entry from table]:host:->hostintable' \ + '(-a -d -f 1)-s[create an arp entry]:host:_hosts:ethernet address::*:option:(temp trail pub)' \ + '(-a -d -s 1)-f[read multiple entries from file]:file:_files' \ + '(-a)1:host:->hostintable' + +[[ "$state" = hostintable ]] && + _wanted hosts expl 'host' compadd ${${${(f)"$(${words[1]} -a)"}##[ ?(]#}%%[ )]*} + diff --git a/Completion/Unix/Command/_cdrecord b/Completion/Unix/Command/_cdrecord index f651e5954..602cd5e8e 100644 --- a/Completion/Unix/Command/_cdrecord +++ b/Completion/Unix/Command/_cdrecord @@ -89,14 +89,14 @@ if [[ -n $state ]]; then case $state in device) - devices=( ${(f)"$(_call_program device cdrecord -scanbus 2>/dev/null \ + devices=( ${(f)"$(_call_program device $service -scanbus 2>/dev/null \ |grep '^ '|cut -c2-6,23-|sed 's/ /:/')"} ) _describe -t devices device devices && return ;; blank) btypes=( 'help:display list of available blanking types' - ${${${${(f)"$(_call_program blank-types cdrecord blank=help 2>&1)"}[2,-1]}#?}/[[:blank:]]##/:} + ${${${${(f)"$(_call_program blank-types $service blank=help 2>&1)"}[2,-1]}#?}/[[:blank:]]##/:} ) _describe -t blank-types 'blanking type' btypes && return ;; diff --git a/Completion/Unix/Command/_cp b/Completion/Unix/Command/_cp new file mode 100644 index 000000000..9838b1702 --- /dev/null +++ b/Completion/Unix/Command/_cp @@ -0,0 +1,32 @@ +#compdef cp + +_arguments -s \ + '(-a --archive)'{-a,--archive}'[same as -dpR]' \ + '(-b --backup)-b[backup]' \ + '(-b --backup)--backup=:method:(none off numbered t existing nil simple never)' \ + '--copy-contents[copy contents of special files when recursive]' \ + '-d[same as --no-dereference --preserve=link]' \ + '(-f --force)'{-f,--force}'[remove and retry for destinations that cannot be opened]' \ + '(-i --interactive)'{-i,--interactive}'[prompt before overwrite]' \ + '-H[follow command-line symbolic links]' \ + '(-l --link)'{-l,--link}'[link files instead of copying]' \ + '(-L --dereference)'{-L,--dereference}'[always follow symbolic links]' \ + '-p[same as --preserve=mode,ownership,timestamps]' \ + '--preserve=:attributes to preserve:_values -s , attribute mode ownership timestamps links all' \ + '--no-preserve=:attributes not to preserve:_values -s , attribute mode ownership timestamps links all' \ + '--parents[append source path to target directory]' \ + '-P[same as --no-dereference]' \ + '(-R -r --recursive)'{-R,-r,--recursive}'[copy directories recursively]' \ + '--remove-destination[remove each existing destination file before attempting to open it]' \ + '--reply=:how to handle the prompt about an existing destination file:(yes no query)' \ + '--sparse=:when to create sparse files:(auto always never)' \ + '--strip-trailing-slashes[remove any trailing slashes from each source argument]' \ + '(-s --symbolic-link)'{-s,--symbolic-link}'[make symbolic links instead of copies of non-directories]' \ + '(-S --suffix)'{-S,--suffix=}':backup suffix:' \ + '--target-directory=:target directory:_files -/' \ + '(-u --update)'{-u,--update}'[copy only when source is newer than destination or destination is missing]' \ + '(-v --verbose)'{-v,--verbose}'[explain what is being done]' \ + '(-x --one-file-system)'{-x,--one-file-system}'[stay on this file system]' \ + '--help' \ + '--version' \ + '*:file or directory:_files' diff --git a/Completion/Unix/Command/_cplay b/Completion/Unix/Command/_cplay index 24b159425..3b4219173 100644 --- a/Completion/Unix/Command/_cplay +++ b/Completion/Unix/Command/_cplay @@ -5,4 +5,4 @@ _arguments -s \ '-r[toggle playlist repeat mode]' \ '-R[toggle playlist random mode]' \ '-v[toggle PCM and MASTER volume control]' \ - '*:playlist or directory or audio file:_files' + '*:playlist or directory or audio file:_files -g "*.(mp3|mp2|ogg|669|amf|ams|dsm|far|it|med|mod|mt2|mtm|okt|s3m|stm|ult|gdm|xm|m3u|pls|spx|wav|au)"' diff --git a/Completion/Unix/Command/_diffstat b/Completion/Unix/Command/_diffstat new file mode 100644 index 000000000..9b4b2da6e --- /dev/null +++ b/Completion/Unix/Command/_diffstat @@ -0,0 +1,19 @@ +#compdef diffstat + +_arguments \ + '-c[prefix each line with hash mark]' \ + '-e:error file:_files' \ + '-f:histogram format:((0\:concise 1\:normal 2\:dots 3\:dots+normal 4\:value 5\:value+normal 6\:value+dots 7\:value+dots+normal))' \ + '-h[help]' \ + '-k[suppress merging of filenames in report]' \ + '-l[list only the filenames]' \ + '-n:minimum width for filenames:' \ + '-o:output file:_files' \ + '-p:number of path components:' \ + '-f:rounding code:((0\:none 1\:round 2\:round+adjustment))' \ + '-t[overrides histogram, generates csv output]' \ + '-u[suppress sorting of filenames in report]' \ + '-v[show progress]' \ + '-V[print version number]' \ + '-w:maximum width of histogram:' \ + '*:file specifications:_files' diff --git a/Completion/Unix/Command/_flasher b/Completion/Unix/Command/_flasher new file mode 100644 index 000000000..d5820e116 --- /dev/null +++ b/Completion/Unix/Command/_flasher @@ -0,0 +1,29 @@ +#compdef flasher + +_arguments \ + '(--fiasco -F)'{--fiasco,-F}':location of a FIASCO image:_files' \ + '(--kernel -k)'{--kernel,-k}':location of kernel image:_files' \ + '(--initfs -n)'{--initfs,-n}':location of initfs image:_files' \ + '(--rootfs -r)'{--rootfs,-r}':location of root JFFS2 image:_files' \ + '(--xloader -x)'{--xloader,-x}':location of X-Loader image:_files' \ + '(--secondary -s)'{--secondary,-s}':location of NOLO secondary bootloader image:_files' \ + '(--2nd -2)'{--2nd,-2}':location of NOLO cold flasher ("2nd") image:_files' \ + '(--unpack -u)'{--unpack,-u}'::unpack a FIASCO image:_files' \ + '(--flash -f)'{--flash,-f}'[load and flash all supplied images]' \ + '(--load -l)'{--load,-l}'[only load all supplied images]' \ + '(--boot -b)'{--boot,-b}'::kernel cmdline' \ + '(--reboot -R)'{--reboot,-R}'[reboot the board]' \ + '(--read-board-id -i)'{--read-board-id,-i}'[print out the board type]' \ + '(--serial-port -S)'{--serial-port,-S}':serial port used for cold flashing' \ + '(--initialize-port -I)'{--initialize-port,-I}':something' \ + '(--cold-flash -c)'{--cold-flash,-c}'[cold flash the device]' \ + '--enable-rd-mode[enable R&D mode on the device]' \ + '--disable-rd-mode[disable R&D mode on the device]' \ + '--set-rd-flags::R&D mode flags to set' \ + '--clear-rd-flags::R&D mode flags to clear' \ + '--query-rd-mode[query the device R&D mode status and flags]' \ + '--set-root-device:default root device' \ + '--query-root-device[query the default root device]' \ + '--enable-usb-host-mode[set the device into USB host mode]' \ + '--disable-usb-host-mode[set the device into USB peripheral mode]' \ + '--flash-only:components' diff --git a/Completion/Unix/Command/_gcc b/Completion/Unix/Command/_gcc new file mode 100644 index 000000000..402797aa2 --- /dev/null +++ b/Completion/Unix/Command/_gcc @@ -0,0 +1,335 @@ +#compdef gcc g++ -value-,LDFLAGS,-default- -value-,CFLAGS,-default- -value-,CPPFLAGS,-default- + +local curcontext="$curcontext" state line ret=1 expl args args2 +typeset -A opt_args + +if [[ "$service" = -value-* ]]; then + compset -q + words=( fake "$words[@]" ) + (( CURRENT++ )) + if [[ "$service" = *LDFLAGS ]]; then + args2=( '-R:runtime path:->rundir' ) + else + args2=() + fi +else + args2=( '*:input file:_files -g "*.([cCmisSoak]|cc|cxx|ii|k[ih])(-.)"' ) +fi + +args=() +case $MACHTYPE in +m68*) + args=( + -m68000 -m68020 -m68020-40 -m68030 -m68040 -m68881 + -mbitfield -mc68000 -mc68020 -mfpa -mnobitfield + -mrtd -mshort -msoft-float + ) + ;; +vax) + args=( + -mg -mgnu -munix + ) + ;; +c[1234]*) + args=( + -mc1 -mc2 -mc32 -mc34 -mc38 + -margcount -mnoargcount + -mlong32 -mlong64 + -mvolatile-cache -mvolatile-nocache + ) + ;; +amd290?0) + args=( + -m29000 -m29050 -mbw -mnbw -mdw -mndw + -mlarge -mnormal -msmall + -mkernel-registers -mno-reuse-arg-regs + -mno-stack-check -mno-storem-bug + -mreuse-arg-regs -msoft-float -mstack-check + -mstorem-bug -muser-registers + ) + ;; +arm) + args=( + -mapcs -m2 -m3 -m6 -mbsd -mxopen -mno-symrename + ) + ;; +m88k) + args=( + -m88000 -m88100 -m88110 -mbig-pic + -mcheck-zero-division -mhandle-large-shift + -midentify-revision -mno-check-zero-division + -mno-ocs-debug-info -mno-ocs-frame-position + -mno-optimize-arg-area -mno-serialize-volatile + -mno-underscores -mocs-debug-info + -mocs-frame-position -moptimize-arg-area + -mserialize-volatile -msvr3 + -msvr4 -mtrap-large-shift -muse-div-instruction + -mversion-03.00 -mwarn-passed-structs + '-mshort-data--:maximum displacement:' + ) + ;; +rs6000|powerpc*) + args=( + '-mcpu=:CPU type:(rios1 rios2 rsc 501 603 604 power powerpc 403 common)' + -mpower -mno-power -mpower2 -mno-power2 + -mpowerpc -mno-powerpc + -mpowerpc-gpopt -mno-powerpc-gpopt + -mpowerpc-gfxopt -mno-powerpc-gfxopt + -mnew-mnemonics -mno-new-mnemonics + -mfull-toc -mminimal-toc -mno-fop-in-toc -mno-sum-in-toc + -msoft-float -mhard-float -mmultiple -mno-multiple + -mstring -mno-string -mbit-align -mno-bit-align + -mstrict-align -mno-strict-align -mrelocatable -mno-relocatable + -mtoc -mno-toc -mtraceback -mno-traceback + -mlittle -mlittle-endian -mbig -mbig-endian + -mcall-aix -mcall-sysv -mprototype + ) + ;; +romp) + args=( + -mcall-lib-mul -mfp-arg-in-fpregs -mfp-arg-in-gregs + -mfull-fp-blocks -mhc-struct-return -min-line-mul + -mminimum-fp-blocks -mnohc-struct-return + ) + ;; +mips*) + args=( + '-mcpu=:CPU type:(r2000 r3000 r4000 r4400 r4600 r6000_' + -mabicalls -membedded-data + -membedded-pic -mfp32 -mfp64 -mgas -mgp32 -mgp64 + -mgpopt -mhalf-pic -mhard-float -mint64 -mips1 + -mips2 -mips3 -mlong64 -mlong-calls -mmemcpy + -mmips-as -mmips-tfile -mno-abicalls + -mno-embedded-data -mno-embedded-pic + -mno-gpopt -mno-long-calls + -mno-memcpy -mno-mips-tfile -mno-rnames -mno-stats + -mrnames -msoft-float + -m4650 -msingle-float -mmad + -mstats -EL -EB -nocpp + '-G:maximum size for small section objects:' + ) + ;; +i[3456]86|x86_64) + args=( + '-mtune=:CPU type:(i386 i486 i586 pentium pentium-mmx i686 pentiumpro pentium2 pentium3 pentium3m pentium-m pentium4 pentium4m prescott nocona k6 k6-2 k6-3 athlon athlon-tbird athlon-4 athlon-xp athlon-mp k8 opteron athlon64 athlon-fx winchip-c6 winchip2 c3 c3-2)' + '-march=:CPU type:(i386 i486 i586 pentium pentium-mmx i686 pentiumpro pentium2 pentium3 pentium3m pentium-m pentium4 pentium4m prescott nocona k6 k6-2 k6-3 athlon athlon-tbird athlon-4 athlon-xp athlon-mp k8 opteron athlon64 athlon-fx winchip-c6 winchip2 c3 c3-2)' + '-mfpmath=:FPU type:(387 sse sse,387)' + '-masm=:asm dialect:(att intel)' + -mieee-fp -mno-ieee-fp -msoft-float + -mno-fp-ret-in-387 -mno-fancy-math-387 + -malign-double -mno-align-double + -m128bit-long-double -m96bit-long-double + -msvr3-shlib -mno-svr3-shlib + -mrtd + '-mregparm=:number of integer argument registers:' + '-mpreferred-stack-boundary=:size of boundary:' + -mmmx -msse -msse2 -msse3 -m3dnow + -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-3dnow + -mpush-args -mno-push-args -maccumulate-outgoing-args + -mthreads + -mno-align-stringops -minline-all-stringops + -momit-leaf-frame-pointer + -mtls-direct-seg-refs -mno-tls-direct-seg-refs + -m32 -m64 + -mno-red-zone + '-mcmodel=:memory model:(small kernel medium large)' + -mno-wide-multiply + '-mreg-alloc=:default register allocation order:' + '-malign-jumps=: **2 base for jump goal alignment:' + '-malign-loops=: **2 base for loop alignment:' + '-malign-functions=: **2 base for function alignment:' + ) + ;; +hppa*) + args=( + -mdisable-fpregs -mdisable-indexing -mfast-indirect-calls + -mgas -mjump-in-delay -mlong-millicode-calls -mno-disable-fpregs + -mno-disable-indexing -mno-fast-indirect-calls -mno-gas + -mno-jump-in-delay -mno-millicode-long-calls + -mno-portable-runtime -mno-soft-float -msoft-float + -mpa-risc-1-0 -mpa-risc-1-1 -mportable-runtime + '-mschedule=:code scheduling constraints:(700 7100 7100LC)' + ) + ;; +i960) + args=( + -m{ka,kb,mc,ca,cf,sa,sb} + -masm-compat -mclean-linkage + -mcode-align -mcomplex-addr -mleaf-procedures + -mic-compat -mic2.0-compat -mic3.0-compat + -mintel-asm -mno-clean-linkage -mno-code-align + -mno-complex-addr -mno-leaf-procedures + -mno-old-align -mno-strict-align -mno-tail-call + -mnumerics -mold-align -msoft-float -mstrict-align + -mtail-call + ) + ;; +sparc) + args=( + -mapp-regs -mno-app-regs + -mfpu -mhard-float + -mno-fpu -msoft-float + -mhard-quad-float + -msoft-quad-float + -mno-unaligned-doubles + -munaligned-doubles + -mfaster-structs -mno-faster-structs + -mimpure-text + '-mcpu=:CPU type:(v7 cypress v8 supersparc sparclite f930 f934 hypersparc sparclite86x sparclet tsc701 v9 ultrasparc ultrasparc3)' + '-mtune=:CPU type:(cypress supersparc hypersparc f930 f934 sparclite86x tsc701 ultrasparc ultrasparc3)' + -mv8plus -mno-v8plus + -mvis -mno-vis + -mlittle-endian + -m32 -m64 + '-mcmodel=:memory model:(medlow medmid medany embmedany)' + -mstack-bias -mno-stack-bias + -mv8 + -mcypress -mepilogue -mflat + -mno-flat + -mno-epilogue + -msparclite -msupersparc + -mmedlow -mmedany + -mint32 -mint64 -mlong32 -mlong64 + ) + ;; +alpha*) + args=( + -mfp-regs -mno-fp-regs -mno-soft-float + -msoft-float + ) + ;; +clipper) + args=( + -mc300 -mc400 + ) + ;; +h8/300) + args=( + -mrelax -mh + ) + ;; +esac + + +_arguments -C -M 'L:|-{fW}no-=-{fW} r:|[_-]=* r:|=*' \ + "$args[@]" \ + -c -S -E -v -a -w -C -H -P -s '(-pg)-p' '(-p)-pg' \ + '-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))' \ + '-d-:dump:->dump' \ + '-g-::debugging information type:(gdb coff stabs stabs+ dwarf dwarf+ xcoff xcoff+)' \ + '-O-::optimization level:(0 1 2 3)' \ + '*-M-::output dependencies:((M\:only\ user\ header\ files MD\:output\ to\ file G\:treat\ missing\ header\ files\ as\ generated))' \ + '*-A-:define assertion:' \ + '*-D-:define macro:' \ + '*-U-:undefine macro:' \ + '*-Wp,-:preprocessor option:' \ + '*-Wl,-:linker option:' \ + '*-Xlinker:linker option:' \ + '*-u:pretend symbol to be undefined:' \ + '*-Wa,-:assembler option:' \ + '*-l:library:->library' \ + '*-L-:library search path:_files -/' \ + '*-I-:header file search path:_files -/' \ + '-B-:executable prefix:_files -/' \ + '-b:target machine:' \ + '-V:gcc version:' \ + '-print-file-name=:library:->library' \ + '-print-prog-name=:program:' \ + '*-include:include file:_files -g \*.h\(-.\)' \ + '*-imacros:macro input file:_files -g \*.h\(-.\)' \ + '*-idirafter:second include path directory:_files -/' \ + '*-iprefix:prefix:_files' \ + '*-iwithprefix:second include path directory:_files -/' \ + '*-iwithprefixbefore:main include path directory:_files -/' \ + '*-isystem:second include path directory (system):_files -/' \ + -nostdinc -trigraphs -undef -pipe -ansi \ + -fallow-single-precision -fcond-mismatch -fasm \ + -fbuiltin -fsigned-bitfields -fsigned-char \ + -funsigned-bitfields -funsigned-char -fwritable-strings \ + -traditional -traditional-cpp -trigraphs \ + -fall-virtual -fdollars-in-identifiers -felide-constructors \ + -fenum-int-equiv -fexternal-templates -ffor-scope \ + -fhandle-signatures -fmemoize-lookups -fdefault-inline -fgnu-keywords \ + -fnonnull-objects -foperator-names -fstrict-prototype \ + -fthis-is-variable -nostdinc++ -traditional \ + -fsyntax-only -pedantic -pedantic-errors \ + -Wall -Waggregate-return -Wbad-function-cast \ + -Wcast-align -Wcast-qual -Wchar-subscript -Wcomment \ + -Wconversion -Wenum-clash -Werror -Wformat \ + '-Wid-clash--:minimum identifier difference length:' \ + -Wimplicit -Wimport -Winline \ + '-Wlarger-than--:maximum object length:' \ + -Wmissing-declarations \ + -Wmissing-prototypes -Wnested-externs \ + -Wimport -Woverloaded-virtual -Wparentheses \ + -Wpointer-arith -Wredundant-decls -Wreorder -Wreturn-type -Wshadow \ + -Wstrict-prototypes -Wswitch -Wsynth -Wtemplate-debugging \ + -Wtraditional -Wtrigraphs -Wuninitialized -Wunused \ + -Wwrite-strings \ + -fpretend-float \ + -print-libgcc-file-name \ + -print-search-dirs -save-temps \ + -fcaller-saves -fcse-follow-jumps -fcse-skip-blocks \ + -fdelayed-branch -fexpensive-optimizations \ + -ffast-math -ffloat-store -fforce-addr -fforce-mem \ + -finline-functions -fkeep-inline-functions \ + -fdefault-inline -fdefer-pop -ffunction-cse \ + -finline -fpeephole -fomit-frame-pointer \ + -frerun-cse-after-loop -fschedule-insns \ + -fschedule-insns2 -fstrength-reduce -fthread-jumps \ + -funroll-all-loops -funroll-loops \ + -nostartfiles -nodefaultlibs -nostdlib \ + -static -shared -symbolic \ + '*-fcall-saved--:register saved by function call:' \ + '*-fcall-used--:register clobbered by function call:' \ + '*-ffixed--:fixed register:' \ + -finhibit-size-directive \ + -fno-common -fno-ident -fno-gnu-linker \ + -fpcc-struct-return -fpic -fPIC \ + -freg-struct-return -fshared-data -fshort-enums \ + -fshort-double -fvolatile -fvolatile-global \ + -fverbose-asm -fpack-struct \ + "$args2[@]" && ret=0 + + +case "$state" in +dump) + _values -s '' 'dump information' \ + 'M[only macro definitions]' \ + 'N[macro names]' \ + 'D[macro definitions and normal output]' \ + 'y[debugging information during parsing]' \ + 'r[after RTL generation]' \ + 'x[only generate RTL]' \ + 'j[after jump optimization]' \ + 's[after CSE]' \ + 'L[after loop optimization]' \ + 't[after second CSE pass]' \ + 'f[after flow analysis]' \ + 'c[after instruction combination]' \ + 'S[after first instruction scheduling pass]' \ + 'l[after local register allocation]' \ + 'g[after global register allocation]' \ + 'R[after second instruction scheduling pass]' \ + 'J[after last jump optimization]' \ + 'd[after delayed branch scheduling]' \ + 'k[after conversion from registers to stack]' \ + 'a[all dumps]' \ + 'm[print memory usage statistics]' \ + 'p[annotate assembler output]' && ret=0 + ;; +library) + _wanted libraries expl library \ + compadd - ${^=LD_LIBRARY_PATH:-/usr/lib /usr/local/lib}/lib*.(a|so*)(:t:fr:s/lib//) && ret=0 + ;; +rundir) + compset -P '*:' + compset -S ':*' + _files -/ -S/ -r '\n\t\- /:' "$@" + ;; +esac + +return ret + diff --git a/Completion/Unix/Command/_getconf b/Completion/Unix/Command/_getconf index 13eb51581..e8f9a1b3d 100644 --- a/Completion/Unix/Command/_getconf +++ b/Completion/Unix/Command/_getconf @@ -30,6 +30,13 @@ if [[ CURRENT -eq 2 ]]; then LFS64_CFLAGS LFS64_LDFLAGS LFS64_LIBS LFS64_LINTFLAGS \ && ret=0 + _requested -V confstring \ + expl 'configuration-dependent string variables' \ + compadd -S '' PATH GNU_LIBC_VERSION GNU_LIBPTHREAD_VERSION \ + LFS_CFLAGS LFS_LDFLAGS LFS_LIBS LFS_LINTFLAGS \ + LFS64_CFLAGS LFS64_LDFLAGS LFS64_LIBS LFS64_LINTFLAGS \ + && ret=0 + _requested pathconfig && while _next_label -V pathconfig expl 'system path configuration variables'; do compadd "$expl[@]" -S '' PIPE_BUF _POSIX_CHOWN_RESTRICTED \ diff --git a/Completion/Unix/Command/_gnutls b/Completion/Unix/Command/_gnutls new file mode 100644 index 000000000..b30408199 --- /dev/null +++ b/Completion/Unix/Command/_gnutls @@ -0,0 +1,126 @@ +#compdef gnutls-cli gnutls-cli-debug certtool srptool + +local _gnutls_supported _gnutls_supported_certtypes +local _gnutls_supported_protocols _gnutls_supported_macs +local _gnutls_supported_kx _gnutls_supported_comp +local _gnutls_cli_common_args + +_gnutls_cli_common_args=( + '(-d --debug)'{-d,--debug}':debug level' + '(-p --port)'{-p,--port}':port' + '(-h --help)'{-h,--help}'[help]' \ +) + +case "$service" in + (gnutls-cli) + +_gnutls_supported="$(gnutls-cli --list)" +_gnutls_supported_certtypes=(${(s:, :)${${(M)${(f)_gnutls_supported}:#Certificate types:*}#Certificate types: }}) +_gnutls_supported_protocols=(${(s:, :)${${(M)${(f)_gnutls_supported}:#Protocols:*}#Protocols: }}) +_gnutls_supported_ciphers=(${(s:, :)${${(M)${(f)_gnutls_supported}:#Ciphers:*}#Ciphers: }}) +_gnutls_supported_macs=(${(s:, :)${${(M)${(f)_gnutls_supported}:#MACs:*}#MACs: }}) +_gnutls_supported_kx=(${(s:, :)${${(M)${(f)_gnutls_supported}:#Key exchange algorithms:*}#Key exchange algorithms: }}) +_gnutls_supported_comp=(${(s:, :)${${(M)${(f)_gnutls_supported}:#Compression methods:*}#Compression methods: }}) + +_arguments \ + "$_gnutls_cli_common_args[@]" \ + '(-r --resume)'{-r,--resume}'[resume session]' \ + '(-s --starttls)'{-s,--starttls}'[start TLS on EOF or SIGALRM]' \ + '--crlf[Send CR LF instead of LF]' \ + '--x509fmtder[Use DER format for certificates to read from]' \ + '(-f --fingerprint)'{-f,--fingerprint}'[send the openpgp fingerprint instead of the key]' \ + '--disable-extensions[disable all the TLS extensions]' \ + '--xml[print the certificate information in XML format]' \ + '--print-cert[print the certificate in PEM format]' \ + '--recordsize:maximum record size to advertise:' \ + '(-V --verbose)'{-V,--verbose}'[more verbose output]' \ + '--ciphers:ciphers to enable:('"$_gnutls_supported_ciphers"')' \ + '--protocols:protocols to enable:('"$_gnutls_supported_protocols"')' \ + '--comp:compression methods to enable:('"$_gnutls_supported_comp"')' \ + '--macs:MACs to enable:('"$_gnutls_supported_macs"')' \ + '--kx:key exchange methods to enable:('"$_gnutls_supported_kx"')' \ + '--ctypes:certificate types to enable:('"$_gnutls_supported_certtypes"')' \ + '--x509cafile:certificate file to use:_files' \ + '--x509crlfile:CRL file to use:_files' \ + '--pgpkeyfile:PGP key file to use:_files' \ + '--pgpkeyring:PGP key ring file to use:_files' \ + '--pgptrustdb:PGP trustdb file to use:_files' \ + '--pgpcertfile:PGP public key (certificate) file to use:_files' \ + '--x509keyfile:X.509 key file to use:_files' \ + '--x509certfile:X.509 certificate file to use:_files' \ + '--srpusername:SRP username to use' \ + '--srppasswd:SRP password to use' \ + '--insecure[do not require server cert validation]' \ + '(-l --list)'{-l,--list}'[print list of the supported algorithms/modes]' \ + '(-v --version)'{-v,--version}'[print version number]' \ + '--copyright[print license]' \ + ':hostname:_hosts' + + ;; + (gnutls-cli-debug) + +_arguments \ + "$_gnutls_cli_common_args[@]" \ + '(-v --verbose)'{-v,--verbose}'[more verbose output]' \ + ':hostname:_hosts' + + ;; + + (certtool) +_arguments \ + '(-s --generate-self-signed)'{-s,--generate-self-signed}'[generate a self-signed certificate]' \ + '(-c --generate-certificate)'{-c,--generate-certificate}'[generate a signed certificate]' \ + '--generate-crl[generate a CRL]' \ + '(-u --update-certificate)'{-u,--update-certificate}'[update a signed certificate]' \ + '(-p --generate-privkey)'{-p,--generate-privkey}'[generate a private key]' \ + '(-q --generate-request)'{-q,--generate-request}'[generate a PKCS #10 certificate request]' \ + '(-e --verify-chain)'{-e,--verify-chain}'[verify a PEM encoded certificate chain]' \ + '--verify-crl[verify a CRL]' \ + '--generate-dh-params[generate PKCS #3 encoded Diffie Hellman parameters]' \ + '--get-dh-params[get the included PKCS #3 encoded Diffie Hellman parameters]' \ + '--load-privkey:private key file:_files' \ + '--load-request:certificate request file:_files' \ + '--load-certificate:certificate file:_files' \ + '--load-ca-privkey:certificate authority private key file:_files' \ + '--load-ca-certificate:certificate authority certificate file:_files' \ + '--password:password' \ + '(-i --certificate-info)'{-i,--certificate-info}'[print information on a certificate]' \ + '(-l --crl-info)'{-l,--crl-info}'[print information on a CRL]' \ + '--p12-info[print information on a PKCS #12 structure]' \ + '--p7-info[print information on a PKCS #7 structure]' \ + '--smime-to-p7[convert S/MIME to PKCS #7 structure]' \ + '(-k --key-info)'{-k,--key-info}'[print information on a private key]' \ + '--fix-key[regenerate the parameters in a private key]' \ + '--to-p12[generate a PKCS #12 structure]' \ + '(-8 --pkcs8)'{-8,--pkcs8}'[use PKCS #8 format for private keys]' \ + '--dsa[use DSA keys]' \ + '--hash:hash algorithm for signing:(MD5 SHA1 RMD160)' \ + '--export-ciphers[use weak encryption algorithms]' \ + '--inder[use DER format for input certificates and private keys]' \ + '--xml[use XML format for output certificates]' \ + '--outder[use DER format for output certificates and private keys]' \ + '--bits:number of bits for key generation' \ + '--outfile:output file:_files ' \ + '--infile:input file:_files ' \ + '--template:template file to use for non-interactive operation:_files' \ + '(-d --debug)'{-d,--debug}':debug level' \ + '(-h --help)'{-h,--help}'[show help]' \ + '(-v --version)'{-v,--version}'[show version]' \ + '--copyright[shows license]' + + ;; + (srptool) + +_arguments \ + '(-u --username)'{-u,--username}':username:_users' \ + '(-p --passwd)'{-p,--passwd}':password file:_files' \ + '(-i --index)'{-i,--index}':index of params in tpasswd.conf' \ + '(-s --salt)'{-s,--salt}':salt size for crypt algorithm' \ + '--verify[just verify password]' \ + '(-c --passwd-conf)'{-c,--passwd-conf}':password conf file:_files' \ + '--create-conf:generate a tpasswd.conf file:_files' \ + '(-v --version)'{-v,--version}'[show version]' \ + '(-h --help)'{-h,--help}'[show help]' + + ;; +esac diff --git a/Completion/Unix/Command/_joe b/Completion/Unix/Command/_joe new file mode 100644 index 000000000..96ad0a4f1 --- /dev/null +++ b/Completion/Unix/Command/_joe @@ -0,0 +1,39 @@ +#compdef joe + +_arguments \ + '-asis[characters with codes >127 will be displayed non-inverted]' \ + '-backpath[backup file directory]:backup file directory:_files -/' \ + '-baud[inserts delays for baud rates below 19200]:baud rate:(57600 38400 19200 9600 4800 2400 1200 300)' \ + '-beep[beep on command errors or when cursor goes past extremes]' \ + '-columns[sets the number of screen columns]:num of columns' \ + '-csmode[continued search mode]' \ + '-dopadding[catch up after long terminal commands]' \ + '-exask[^KX verify the file name that it is about to write]' \ + '-force[make sure that last line of the file has a line-feed]' \ + '-help[start editor with help screen on]' \ + '-keepup[update column number and control-key prefix after each keystroke]' \ + '-lightoff[make block highlighting go away after any block command]' \ + '-lines[set the number of screen lines]:num of screen lines' \ + '-marking[text between ^KB and the cursor is highlighted]' \ + '-mid[scroll window and make cursor go to center after]' \ + '-nobackups[prevents making backup files]' \ + '-nonotice[prevents displaying copyright notice on startup]' \ + '-nosta[eliminate top-most status line]' \ + '-noxon[turn off ^S/^Q processing]' \ + '-orphan[extra files get placed in orphaned buffers instead of new windows]' \ + '-pg[specify the number of lines to keep after PgUp/PgDn]:num of lines to keep' \ + '-skiptop[prevents use of top n screen lines]:num of top lines to skip' \ + '+-[number of lines]:number of lines' \ + '-crlf[use CR+LF as end of line sequence, instead of just LF]' \ + '-wordwrap[wrap the previous word when you type past the right margin]' \ + '-autoindent[indentation is duplicated onto the next line]' \ + '-overwrite[typing overwrites existing characters]' \ + '-lmargin[set the left margin]:left margin' \ + '-rmargin[set the right margin]:right margin' \ + '-tab[set the TAB character width]:tab width' \ + '-indentc[set the indentation character for ^K, and ^K.]:indent char for ^K, and ^K.' \ + '-istep[set the indentation step for ^K, and ^K.]:indent step for ^K, and ^K.' \ + '-linums[display line numbers before each line]' \ + '-rdonly[make file read-only]' \ + '-keymap[use an alternate section of joerc for keybindings]:keymap name' \ + '*:files:_files' diff --git a/Completion/Unix/Command/_mh b/Completion/Unix/Command/_mh index 5a9348069..69f6c2da2 100644 --- a/Completion/Unix/Command/_mh +++ b/Completion/Unix/Command/_mh @@ -56,6 +56,12 @@ elif [[ "$prev" = -(no|)cc ]]; then _wanted -C "$prev" values expl 'CC address' compadd all to cc me elif [[ "$prev" = -[rw]cache ]]; then _wanted -C "$prev" values expl cache compadd public private never ask +elif [[ "$prev" = -textfield ]]; then + _wanted -C "$prev" -x headers expl header compadd -M 'm:{a-zA-Z}={A-Za-z}' \ + Subject From To cc +elif [[ "$prev" = -datefield ]]; then + _wanted -C "$prev" -x headers expl header compadd -M 'm:{a-zA-Z}={A-Za-z}' \ + Delivery-Date elif [[ $service = mhparam ]]; then _wanted parameters expl 'MH parameter' compadd - \ ${${(f)"$(mhparam -all)"}%%:*} diff --git a/Completion/Unix/Command/_ping b/Completion/Unix/Command/_ping new file mode 100644 index 000000000..e59f6fa9f --- /dev/null +++ b/Completion/Unix/Command/_ping @@ -0,0 +1,63 @@ +#compdef ping + +if _pick_variant iputils=iputils unix -V; then + + _arguments \ + '-a[audible]' \ + '-A[adaptive]' \ + '-b[allow pinging a broadcast address]' \ + '-B[do not allow ping to change source address]' \ + '-c:count' \ + '-d[set SO_DEBUG on the socket]' \ + '-f[flood ping]' \ + '-i:interval in seconds' \ + '-I:iface:_net_interfaces' \ + '-l:preload number' \ + '-L[suppress loopback of multicast packets]' \ + '-n[numeric output only]' \ + '-p:padding pattern' \ + '-Q:QoS TOS bits' \ + '-q[quiet]' \ + '-r[bypass normal routing tables]' \ + '-R[record route]' \ + '-s:packet size in bytes' \ + '-S:sndbuf' \ + '-t:timeout in seconds' \ + '-T:timestamp option:(tsonly tsandaddr tsprespec)' \ + '-M:Path MTU Discovery strategy:((do\:prohibit\ fragmentation want\:fragment\ locally dont\:do\ not\ set\ DF\ flag))' \ + '-U[print full user-to-user latency]' \ + '-v[verbose]' \ + '-w:deadline in seconds' \ + '-W:seconds to wait for a response' \ + ':host:_hosts' + +else + +# FreeBSD 4.11 + + _arguments \ + '-A[audible for no packet]' \ + '-Q[somewhat quiet]' \ + '-R[record route]' \ + '-a[audible for each packet]' \ + '-d[set SO_DEBUG on the socket]' \ + '-f[flood ping]' \ + '-n[numeric output only]' \ + '-q[quiet]' \ + '-r[bypass normal routing tables]' \ + '-v[verbose]' \ + '-c:count' \ + '-i:wait seconds' \ + '-l:preload number' \ + '-m:ttl' \ + '-p:padding pattern' \ + '-P:IPsec policy' \ + '-s:packet size in bytes' \ + '-S:src addr' \ + '-t:timeout in seconds' \ + '-L[suppress loopback of multicast packets]' \ + '-I:iface:_net_interfaces' \ + '-T:ttl for multicasted packets' \ + ':host:_hosts' + +fi diff --git a/Completion/Unix/Command/_quilt b/Completion/Unix/Command/_quilt index cbb1d90df..a2fd799a6 100644 --- a/Completion/Unix/Command/_quilt +++ b/Completion/Unix/Command/_quilt @@ -1,22 +1,30 @@ #compdef quilt -local _quilt_subcommands expl curcontext="$curcontext" - _arguments \ '--trace' \ '--quiltrc:config file:_files' \ '--version' \ - '*::quilt command:->subcmd' && return 0 - - - _quilt_subcommands=(add files import previous setup annotate fold mail - push snapshot applied fork new refresh top delete graph next remove - unapplied diff grep patches rename upgrade edit header pop series) + ':quilt command:(add files import previous setup annotate fold mail push + snapshot applied fork new refresh top delete graph next remove unapplied + diff grep patches rename upgrade edit header pop series)' \ + '*::subcmd:->subcmd' && return 0 +case "$state" in + (subcmd) -if (( CURRENT == 1 )); then - _describe -t subcommand 'subcommand' _quilt_subcommands -else - # this part should be tailored for subcmds - _files -fi + case "$words[1]" in + (applied|delete|files|graph|header|next|previous|refresh|unapplied) + _wanted -V 'patches' expl 'patch' compadd ${(f)"$(quilt series)"} + ;; + (push) + _wanted -V 'unapplied patches' expl 'patch' compadd ${(f)"$(quilt unapplied)"} + ;; + (pop) + _wanted -V 'applied patches' expl 'patch' compadd ${(f)"$(quilt applied)"} + ;; + (*) + _files + ;; + esac + ;; +esac diff --git a/Completion/Unix/Command/_sed b/Completion/Unix/Command/_sed new file mode 100644 index 000000000..0175364d9 --- /dev/null +++ b/Completion/Unix/Command/_sed @@ -0,0 +1,27 @@ +#compdef sed + +local args + +args=( + '(-n --quiet --silent)'{-n,--quiet,--silent}'[suppress automatic printing of pattern space]' + '(1)*'{-e,--expression=-}'[add sed commands to run]:sed script' + '(1)*'{-f,--file=-}'[add contents of file to commands to run]:file:_files' + '(-e)1: :_guard "^-*" sed script' + ':input file:_files' +) + +if _pick_variant gnu=GNU unix --version; then + args+=( + '(-i --in-place)'{-i-,--in-place=-}'[edit files in place]::suffix for backup' + '(-l --line-length)'{-l,--line-length=-}'[specify line-wrap length for the l command]' + '(-r --regexp-extended)'{-r,--regexp-extended}'[use extended regular expressions]' + '(-s --separate)'{-s,--separate}'[consider files separately instead of as a combined stream]' + '(-u --unbuffered)'{-u,--unbuffered}'[disable data buffering]' + '(- 1 :)--help[print program usage]' + '(- 1 :)'{-V,--version}'[print program version]' + ) +else + args=( "${(@)args:#(|\(*\))(|\*)--*}" ) +fi + +_arguments "$args[@]" diff --git a/Completion/Unix/Command/_su b/Completion/Unix/Command/_su new file mode 100644 index 000000000..6d0f2cd9f --- /dev/null +++ b/Completion/Unix/Command/_su @@ -0,0 +1,69 @@ +#compdef su + +local -A opt_args +local -a args state context +local shell=${words[(i)(-s|--shell=*)]} first='1:user name:_users' +local usr=root line + +if _pick_variant gnu="Free Software Foundation" unix --version; then + args=( + '(--command)-c[pass command to shell]:command string:->command' + '(-c)--command=-[pass command to shell]:command string:->command' + '-f[pass -f to shell (csh)]' + '(--login)-l[use a login shell]' + '(-l)--login[use a login shell]' + '(-p --preserve-environment)-m[do not reset environment]' + '(-m --preserve-environment)-p[do not reset environment]' + '(-m -p)--preserve-environment[do not reset environment]' + '(--shell)-s[run the specified shell]:shell:->shell' + '(-s)--shell=-[run the specified shell]:shell:->shell' + ) +else + args=( + '-c[pass command to shell]:command string:->command' + '-l[use a login shell]' + '-s[run the specified shell]:shell:->shell' + ) +fi + +if [[ $#words -ge 2 && $words[2] != -* && CURRENT -ne 2 ]]; then + usr=$words[2] + first= +fi + +[[ $words[shell] == -s ]] && ((shell++)) + +if [[ CURRENT -ne shell && -n ${words[shell]} ]]; then + shell=${words[shell]#*=} +else + shell="${${(M@)${(@f)$(rest" && return + +case $state in + (command) + compset -q + _normal + return + ;; + (shell) + compadd ${(f)^"$() + # use long format if no more than the given number of matches + (( ${(P)#1} <= ${elt##*=} )) && (( ok = 1 )) + break + ;; + + (*($what|all|true|1|yes)[^=]#) + # always use long format + (( ok = 1 )) + break + ;; + esac +done + +(( ok )) || return 1 + +zmodload -i zsh/stat 2>/dev/null || return 1 + +dir=${2:+$2/} +dir=${(Q)dir} + +for f in ${(PQ)1}; do + if [[ ! -e "$dir$f" ]]; then + listfiles+=("$dir$f") + continue + fi + + # Borrowed from Functions/Example/zls + stat -s -H stat -F "%b %e %H:%M" - "$dir$f" >/dev/null 2>&1 + + listfiles+=("$stat[mode] ${(l:3:)stat[nlink]} ${(r:8:)stat[uid]} \ + ${(r:8:)stat[gid]} ${(l:8:)stat[size]} $stat[mtime] $f") +done + +(( ${#listfiles} )) && listopts=(-d listfiles -l -o) + +return 0 diff --git a/Completion/Unix/Type/_path_commands b/Completion/Unix/Type/_path_commands new file mode 100644 index 000000000..714e2e232 --- /dev/null +++ b/Completion/Unix/Type/_path_commands @@ -0,0 +1,77 @@ +#autoload + +(( $+functions[_path_commands_caching_policy] )) || +_path_commands_caching_policy() { + +local oldp file +typeset -a dbfiles + +# rebuild if cache is more than a week old +oldp=( "$1"(Nmw+1) ) +(( $#oldp )) && return 0 + +dbfiles=(/usr/share/man/index.(bt|db|dir|pag)(N) \ + /usr/man/index.(bt|db|dir|pag)(N) \ + /var/cache/man/index.(bt|db|dir|pag)(N) \ + /var/catman/index.(bt|db|dir|pag)(N) \ + /usr/share/man/*/whatis(N)) + +for file in $dbfiles; do + [[ $file -nt $1 ]] && return 0 +done + +return 1 +} + +_path_commands() { +local need_desc expl ret=1 + +if zstyle -T ":completion:${curcontext}:" verbose; then + local update_policy first + if [[ $+_command_descriptions -eq 0 ]]; then + first=yes + typeset -A -g _command_descriptions + fi + zstyle -s ":completion:${curcontext}:" cache-policy update_policy + [[ -z "$update_policy" ]] && zstyle ":completion:${curcontext}:" \ + cache-policy _path_commands_caching_policy + if ( [[ -n $first ]] || _cache_invalid command-descriptions ) && \ + ! _retrieve_cache command-descriptions; then + local line + for line in "${(f)$(_call_program command-descriptions whatis -s 1 -r .\\\*\; whatis -s 6 -r .\\\* 2> /dev/null)}"; do + [[ -n ${line:#(#b)([^ ]#) #\([^ ]#\)( #\[[^ ]#\]|)[ -]#(*)} ]] && continue; + [[ -z $match[1] || -z $match[3] || -z ${${match[1]}:#*:*} ]] && continue; + _command_descriptions[$match[1]]=$match[3] + done + _store_cache command-descriptions _command_descriptions + fi + + (( $#_command_descriptions )) && need_desc=yes +fi + +if [[ -n $need_desc ]]; then + typeset -a dcmds descs cmds + local desc cmd sep + for cmd in ${(@)commands[(I)$PREFIX*]}; do + desc=$_command_descriptions[$cmd] + if [[ -z $desc ]]; then + cmds+=$cmd + else + dcmds+=$cmd + descs+="$cmd:$desc" + fi + done + zstyle -s ":completion:${curcontext}:" list-separator sep || sep=-- + zformat -a descs " $sep " $descs + descs=("${(@r:COLUMNS-1:)descs}") + _wanted commands expl 'external command' \ + compadd "$@" -ld descs -a dcmds && ret=0 + _wanted commands expl 'external command' compadd "$@" -a cmds && ret=0 +else + _wanted commands expl 'external command' compadd "$@" -k commands && ret=0 +fi + +return $ret +} + +_path_commands "$@" diff --git a/Completion/X/Command/.distfiles b/Completion/X/Command/.distfiles index 302ceaf1b..8ad17e1ac 100644 --- a/Completion/X/Command/.distfiles +++ b/Completion/X/Command/.distfiles @@ -1,8 +1,14 @@ DISTFILES_SRC=' .distfiles -_gnome-gv -_gv _netscape _xauth _xfig _mozilla _xterm _xwit -_nedit _vnc _x_utils _xdvi _xmodmap _xset _xv -_acroread _dcop _gqview _xloadimage _mplayer -_kfmclient _urxvt _xpdf +_acroread _dcop +_gnome-gv _gqview _gv _kfmclient +_mozilla _mplayer _nautilus +_nedit _netscape +_qiv +_setxkbmap +_urxvt _vnc +_x_utils _xauth _xdvi _xfig _xloadimage +_xmodmap _xpdf _xscreensaver _xset _xterm +_xv _xwit +_xrandr ' diff --git a/Completion/Zsh/Command/_precommand b/Completion/Zsh/Command/_precommand new file mode 100644 index 000000000..535c18260 --- /dev/null +++ b/Completion/Zsh/Command/_precommand @@ -0,0 +1,6 @@ +#compdef - nohup eval time rusage noglob nocorrect exec catchsegv + +shift words +(( CURRENT-- )) + +_normal -- cgit 1.4.1