From 926b98cad2c0b75f17058934de84cb0b952f45a5 Mon Sep 17 00:00:00 2001 From: Paul Ackersviller Date: Sun, 8 Apr 2007 18:05:20 +0000 Subject: Merge from trunk of 20937-20944 and later for same files. --- Completion/Unix/Command/_fortune | 15 +++++++++ Completion/Unix/Command/_fuser | 67 ++++++++++++++++++++++++++++++++++++++ Completion/Unix/Command/_groff | 45 +++++++++++++++++++++++++ Completion/Unix/Command/_knock | 9 +++++ Completion/Unix/Command/_showmount | 10 ++++++ 5 files changed, 146 insertions(+) create mode 100644 Completion/Unix/Command/_fortune create mode 100644 Completion/Unix/Command/_fuser create mode 100644 Completion/Unix/Command/_groff create mode 100644 Completion/Unix/Command/_knock create mode 100644 Completion/Unix/Command/_showmount (limited to 'Completion/Unix/Command') diff --git a/Completion/Unix/Command/_fortune b/Completion/Unix/Command/_fortune new file mode 100644 index 000000000..c0eca56a3 --- /dev/null +++ b/Completion/Unix/Command/_fortune @@ -0,0 +1,15 @@ +#compdef fortune + +_arguments \ + '-a[choose from all lists of maxims, both offensive and not]' \ + '-c[show the cookie file from which the fortune came]' \ + '-e[consider all fortune files to be of equal size]' \ + '-f[print out the list of files which would be searched]' \ + '-l[long dictums only]' \ + '-m[print all matches to regex]:BRE' \ + '-n[set longest length to be short]:length' \ + '-o[choose only from potentially offensive aphorisms]' \ + '-s[short apothegms only]' \ + '-i[ignore case for -m patterns]' \ + '-w[wait before termination for a time based on msg length]' \ + '*:databases' diff --git a/Completion/Unix/Command/_fuser b/Completion/Unix/Command/_fuser new file mode 100644 index 000000000..6c291473f --- /dev/null +++ b/Completion/Unix/Command/_fuser @@ -0,0 +1,67 @@ +#compdef fuser + +local -a args arg1 +typeset -A opt_args + +if _pick_variant -c $words[1] psmisc=psmisc unix -V; then + + (( $+functions[_fuser_services] )) || + _fuser_services() { + local expl suf ret=1 + + [[ $opt_args[-n] = ??p || $EUID = 0 ]] || return + + if compset -P '*/'; then + _wanted protocols expl protocol compadd tcp udp + elif compset -P '*,*,'; then + compset -S '/*' || [[ -n $opt_args[-n] ]] || suf=( -qS / ) + _ports $suf && ret=0 + elif compset -P '*,'; then + compset -S ',*' || suf=( -S , -r "/ \t\n\-" ) + _hosts $suf && ret=0 + else + compset -S ',*' || suf=( -S ${${opt_args[-n]/?*/,}:-/} -r "/, \t\n\-" ) + _ports $suf && ret=0 + fi + + return ret + } + + _arguments \ + '(-s)-a[show all files specified on the command line]' \ + {-c,-m}'[list all processes accessing files on the filesystem specified by name]' \ + '-k[kill processes accessing the file]' \ + '-i[ask for confirmation before killing]' \ + '-l[list all known signal names]' \ + '-n[select name space]:namespace:(file udp tcp)' \ + '(-a)-s[silent operation]' \ + '-signal[send alternate signal with -k]:signal:_signals' \ + '-u[append the user name of the process owner to each PID]' \ + '-v[verbose mode]' \ + '-V[display version information]' \ + '-4[search only for IPv4 sockets]' \ + '-6[search only for IPv6 sockets]' \ + '*:name: _alternative "files:file:_files" "services:service:_fuser_services"' + +else + case $OSTYPE in + solaris2.9 ) + args=( + '-n[list only processes with non-blocking mandatory locks]' + '-s[send alternate signal with -k]:signal:_signals' + ) + ;; + sysv4 ) + (( $+words[(r)-k] )) && arg1=( ':name: _alternative signals\:signal\:_signals\ -p files:file:_files' ) + ;; + esac + + _arguments \ + '(-f)-c[list all processes accessing files on the filesystem specified by name]' \ + '(-c)-f[list all processes accessing named files]' \ + '-k[kill processes accessing the file]' \ + '-u[append the user name of the process owner to each PID]' \ + $args \ + $arg1 \ + '*:file:_files' +fi diff --git a/Completion/Unix/Command/_groff b/Completion/Unix/Command/_groff new file mode 100644 index 000000000..4f3b8c617 --- /dev/null +++ b/Completion/Unix/Command/_groff @@ -0,0 +1,45 @@ +#compdef groff + +local _troff_options + +_troff_options=('-a[ascii approximation of output]' + '-b[backtrace on error or warning]' + '-c[disable color output]' + '-C[enable compatibility mode]' + '*-d[define string]:definition:' + '-E[disable troff error messages]' + '-f[set default font family]:font family:' + '-F[set path for font DESC files]:path:' + '-i[process standard input after specified input files]' + '-m[include macro file]:name:(man mandoc mdoc me mm ms www)' + '-M[dir path for macro files]:path:' + '-n[number for the first page]:number:' + '-o[output only pages in list]:list:' + '*-r[set number register]:setting:' + '*-w[enable warning name]:name:' + '*-W[disable warning name]:name') + +_arguments \ + '-e[preprocess with eqn]' \ + '-g[preprocess with grn]' \ + '-G[preprocess with grap]' \ + '(-h --help)'{-h,--help}'[help]' \ + '-I[add search dir for soelim]:directory:_files -/' \ + '-l[send output to spooler program for printing]' \ + '*-L[pass arg to spooler program]:spooler argument:' \ + '-N[do not allow newlines within eqn delimeters]' \ + '-p[preprocess with pic]' \ + '*-P[pass option to postprocessor]:option:' \ + '-R[preprocess with refer]' \ + '-s[preprocess with soelim]' \ + '(-U)-S[safer mode]' \ + '-t[preprocess with tbl]' \ + '-T[set output device]:device:((ascii\:ASCII\ character\ set cp1047\:EBDIC\ code\ page\ IBM\ cp1047 nippon\:Japanese-EUC\ character\ set dvi\:TeX\ DVI\ format html\:HTML\ output ascii8\:8-bit\ clean latin1\:ISO\ 8859-1 lbp\:Canon\ CAPSL\ printers lj4\:HP\ LaserJet4-compatible\ printers ps\:PostScript\ output utf8\:Unicode\ \(ISO\ 10646\)\ character\ set X75\:75dpi\ X\ Window\ System\ output X75-12\:75dpi\ X\ Window\ System\ output\ \(12pt\) X100\:100dpi\ X\ Window\ System\ output X100-12\:100dpi\ X\ Window\ System\ output\ \(12pt\)))' \ + '(-S)-U[unsafe mode]' \ + '(-v --version)'{-v,--version}'[version]' \ + '-V[output the pipeline that would be run but do not execute]' \ + '-X[use gxditview instead of the usual postprocessor]' \ + '-z[suppress output generated by troff]' \ + '-Z[do not postprocess the output of troff]' \ + "$_troff_options[@]" \ + ':file:_files' diff --git a/Completion/Unix/Command/_knock b/Completion/Unix/Command/_knock new file mode 100644 index 000000000..3cf83e3c1 --- /dev/null +++ b/Completion/Unix/Command/_knock @@ -0,0 +1,9 @@ +#compdef knock + +_arguments \ + '(-u --udp)'{-u,--udp}'[UDP mode]' \ + '(-v --verbose)'{-v,--verbose}'[verbose]' \ + '(-V --version -h --help -u --udp -v --verbose)'{-V,--version}'[display version]' \ + '(-h --help -u --udp -v --verbose -V --version)'{-h,--help}'[help]' \ + '1:host:_hosts' \ + '*:port:_ports' diff --git a/Completion/Unix/Command/_showmount b/Completion/Unix/Command/_showmount new file mode 100644 index 000000000..913091198 --- /dev/null +++ b/Completion/Unix/Command/_showmount @@ -0,0 +1,10 @@ +#compdef showmount + +_arguments \ + '(-a --all)'{-a,--all}'[list both hostname and mounted dir in host:dir format]' \ + '(-d --directories)'{-d,--directories}'[list only the directories mounted by some client]' \ + '(-e --exports)'{-e,--exports}'[show server export list]' \ + '(-h --help)'{-h,--help}'[help]' \ + '(-v --version)'{-v,--version}'[version]' \ + '--no-headers[suppress descriptive headers from output]' \ + ':host:_hosts' -- cgit 1.4.1