From 92ec72844c9b3db9cadb5572d244b16c966b719c Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Tue, 29 Aug 2017 00:32:41 +0200 Subject: unposted: add missing #autoload directive --- Completion/Unix/Type/_bpf_filters | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Completion/Unix') diff --git a/Completion/Unix/Type/_bpf_filters b/Completion/Unix/Type/_bpf_filters index c62481e09..54e2172c9 100644 --- a/Completion/Unix/Type/_bpf_filters +++ b/Completion/Unix/Type/_bpf_filters @@ -1,3 +1,5 @@ +#autoload + # spaces are valid instead of word ends, perhaps better to just do compset -q local -a networks fields dirs protos relop -- cgit v1.2.3 From e5c11eb7b55d96b740db1684b8ff89d412f4df15 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Tue, 29 Aug 2017 00:38:32 +0200 Subject: 41616: update completion options to entr 3.8 --- ChangeLog | 2 ++ Completion/Unix/Command/_entr | 18 ++++++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) (limited to 'Completion/Unix') diff --git a/ChangeLog b/ChangeLog index 268bf5d67..1c77435d3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2017-08-29 Oliver Kiddle + * 41616: Completion/Unix/Command/_entr: update options to 3.8 + * unposted: Completion/Unix/Type/_bpf_filters: add missing #autoload directive diff --git a/Completion/Unix/Command/_entr b/Completion/Unix/Command/_entr index 8a830ae71..a8d43fc5e 100644 --- a/Completion/Unix/Command/_entr +++ b/Completion/Unix/Command/_entr @@ -1,9 +1,23 @@ #compdef entr +local curcontext="$curcontext" state state_descr line ret=1 +typeset -A opt_args + _arguments -s -S \ '-c[execute clear before invoking utility]' \ '-d[track directories and exit if a new file is added]' \ '-p[postpone first execution of the utility]' \ '-r[reload a persistent child process]' \ - '(-):command name:_command_names -e' \ - '*::arguments:_normal' + '(*)-s[evaluate the first argument using interpreter specified by $SHELL]' \ + '(-): :->command' \ + '*::arguments:_normal' && ret=0 + +if [[ -n $state ]]; then + if (( $+opt_args[-s] )); then + _cmdstring && ret=0 + else + _command_names -e && ret=0 + fi +fi + +return ret -- cgit v1.2.3 From 386eb378a758370360c3455aa983db416e505c8b Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Tue, 29 Aug 2017 00:41:34 +0200 Subject: 41617: complete new tracepath options --- ChangeLog | 2 ++ Completion/Linux/Command/_tracepath | 9 +++++++++ Completion/Unix/Command/_tracepath | 5 ----- 3 files changed, 11 insertions(+), 5 deletions(-) create mode 100644 Completion/Linux/Command/_tracepath delete mode 100644 Completion/Unix/Command/_tracepath (limited to 'Completion/Unix') diff --git a/ChangeLog b/ChangeLog index 1c77435d3..94c8a8f0d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2017-08-29 Oliver Kiddle + * 41617: Completion/Linux/Command/_tracepath: complete new options + * 41616: Completion/Unix/Command/_entr: update options to 3.8 * unposted: Completion/Unix/Type/_bpf_filters: diff --git a/Completion/Linux/Command/_tracepath b/Completion/Linux/Command/_tracepath new file mode 100644 index 000000000..f0f777d96 --- /dev/null +++ b/Completion/Linux/Command/_tracepath @@ -0,0 +1,9 @@ +#compdef tracepath tracepath6 + +_arguments -s -S \ + '-n[print IP addresses numerically]' \ + '-b[print both host names and IP addresses]' \ + '-l+[set the initial packet length]:length (bytes)' \ + '-m+[set maximum hops]:maximum [30]' \ + '-p+[set initial destination port to use]:port:_ports' \ + ':destination:_hosts' diff --git a/Completion/Unix/Command/_tracepath b/Completion/Unix/Command/_tracepath deleted file mode 100644 index eb49e567d..000000000 --- a/Completion/Unix/Command/_tracepath +++ /dev/null @@ -1,5 +0,0 @@ -#compdef tracepath tracepath6 - -_arguments \ - ':destination:_hosts' \ - ':port:_ports' -- cgit v1.2.3 From 8b4d2329c71377fcab7d73bc0656094557c720a9 Mon Sep 17 00:00:00 2001 From: "Андрей Стоцкий (_RuRo_)" Date: Mon, 28 Aug 2017 20:24:56 +0300 Subject: 41618: Added some arguments autocompletion to _todo.sh. --- ChangeLog | 5 +++++ Completion/Unix/Command/_todo.sh | 12 ++++++++++++ 2 files changed, 17 insertions(+) (limited to 'Completion/Unix') diff --git a/ChangeLog b/ChangeLog index 94c8a8f0d..39042f8e0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2017-08-29 Андрей Стоцкий (_RuRo_) + + * 41618: Completion/Unix/Command/_todo.sh: Added some arguments + autocompletion to _todo.sh. + 2017-08-29 Oliver Kiddle * 41617: Completion/Linux/Command/_tracepath: complete new options diff --git a/Completion/Unix/Command/_todo.sh b/Completion/Unix/Command/_todo.sh index eb0be55e5..287c9ff78 100644 --- a/Completion/Unix/Command/_todo.sh +++ b/Completion/Unix/Command/_todo.sh @@ -17,12 +17,24 @@ local -a cmdlist itemlist match mbegin mend integer NORMARG _arguments -s -n : \ + '-@[hide context names]' \ + '-\+[hide project names]' \ + '-c[color mode]' \ '-d[alternate config file]:config file:_files' \ '-f[force, no confirmation]' \ '-h[display help]' \ '-p[plain mode, no colours]' \ + '-P[hide priority labels]' \ + "-a[don't auto-archive tasks when done]" \ + '-A[auto-archive tasks when done]' \ + '-n[automatically remove blank lines]' \ + '-N[preserve line numbers]' \ + '-t[add current date to task on creation]' \ + "-T[don't add current date to task]" \ '-v[verbose mode, confirmation messages]' \ + '-vv[extra verbose (debug)]' \ '-V[display version etc.]' \ + '-x[disable final filter]' \ '1:command:->commands' \ '*:arguments:->arguments' && return 0 -- cgit v1.2.3 From 383dc2a6f5d8ad0713311a3dc358cdc71a2dcf03 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Thu, 17 Aug 2017 04:19:10 +0000 Subject: 41558: _tmux: Complete option names for show-options and show-window-options. --- ChangeLog | 5 +++++ Completion/Unix/Command/_tmux | 29 +++++++++++++++++++++++------ 2 files changed, 28 insertions(+), 6 deletions(-) (limited to 'Completion/Unix') diff --git a/ChangeLog b/ChangeLog index 307a02b86..e10fb6197 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2017-08-30 Daniel Shahaf + + * 41558: Completion/Unix/Command/_tmux: Complete option names + for show-options and show-window-options. + 2017-08-27 Peter Stephenson * 41608 (plus tests): Src/exec.c, Test/C03traps.ztst: ERR_EXIT diff --git a/Completion/Unix/Command/_tmux b/Completion/Unix/Command/_tmux index 7ef20c666..9339d6556 100644 --- a/Completion/Unix/Command/_tmux +++ b/Completion/Unix/Command/_tmux @@ -745,7 +745,7 @@ _tmux-set-option() { local mode=session local curcontext="$curcontext" state line ret=1 typeset -A opt_args - _arguments -C -s \ + _arguments -C -s : \ '-a[append to string options]' \ '-g[set a global session option]' \ '-o[prevent setting of an option that is already set]' \ @@ -769,7 +769,7 @@ _tmux-set-window-option() { [[ -n ${tmux_describe} ]] && print "set a window option" && return local curcontext="$curcontext" state line ret=1 typeset -A opt_args - _arguments -C -s \ + _arguments -C -s : \ '-a[append to string options]' \ '-g[set a global window option]' \ '-o[prevent setting of an option that is already set]' \ @@ -820,21 +820,38 @@ _tmux-show-messages() { _tmux-show-options() { [[ -n ${tmux_describe} ]] && print "show session options" && return - _arguments -s \ + local mode=session + local curcontext="$curcontext" state line ret=1 + typeset -A opt_args + _arguments -C -s : \ '-g[show global options]' \ '-q[suppress errors about unknown or ambiguous options]' \ '-s[show server options]' \ '-v[show only the option value, not the name]' \ '-w[show window options]' \ - '-t+[specify target session]:target session:__tmux-sessions' + '-t+[specify target session]:target session:__tmux-sessions' \ + '*:: :->name_or_value' && ret=0 + + if (( ${+opt_args[-w]} )); then + mode=window + elif (( ${+opt_args[-s]} )); then + mode=server + fi + __tmux-options-complete ${mode} ${state} && ret=0 + return ret } _tmux-show-window-options() { [[ -n ${tmux_describe} ]] && print "show window options" && return - _arguments -s \ + local curcontext="$curcontext" state line ret=1 + typeset -A opt_args + _arguments -C -s : \ '-g[show global options]' \ '-v[show only the option value, not the name]' \ - '-t+[specify target window]:target window:__tmux-windows' + '-t+[specify target window]:target window:__tmux-windows' \ + '*:: :->name_or_value' && ret=0 + __tmux-options-complete window ${state} && ret=0 + return ret } _tmux-source-file() { -- cgit v1.2.3 From 9a4fb22d893ff7c308965185ba15d2b4741029f8 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Thu, 17 Aug 2017 04:19:11 +0000 Subject: 41557: _tmux: show-environment, set-environment: Make -g,-t mutually exclusive. tmux does not error out on the combination, but it does ignore one of the two when both are specified. --- ChangeLog | 3 +++ Completion/Unix/Command/_tmux | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'Completion/Unix') diff --git a/ChangeLog b/ChangeLog index e10fb6197..c0fdf37e2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2017-08-30 Daniel Shahaf + * 41557: Completion/Unix/Command/_tmux: show-environment, + set-environment: Make -g,-t mutually exclusive. + * 41558: Completion/Unix/Command/_tmux: Complete option names for show-options and show-window-options. diff --git a/Completion/Unix/Command/_tmux b/Completion/Unix/Command/_tmux index 9339d6556..0f142bb0e 100644 --- a/Completion/Unix/Command/_tmux +++ b/Completion/Unix/Command/_tmux @@ -733,10 +733,10 @@ _tmux-set-buffer() { _tmux-set-environment() { [[ -n ${tmux_describe} ]] && print "(un)set an environment variable" && return _arguments -s -A "-*" -S \ - '-g[modify global environment]' \ + '(-t)-g[modify global environment]' \ '-r[remove variable before starting new processes]' \ '-u[unset a variable]' \ - '-t[specify target session]:target session:__tmux-sessions' \ + '(-g)-t[specify target session]:target session:__tmux-sessions' \ ':name' ':value' } @@ -805,9 +805,9 @@ _tmux-show-buffer() { _tmux-show-environment() { [[ -n ${tmux_describe} ]] && print "display the environment" && return _arguments -s \ - '-g[show global environment]' \ + '(-t)-g[show global environment]' \ '-s[format output as Bourne shell commands]' \ - '-t+[specify target session]:target session:__tmux-sessions' + '(-g)-t+[specify target session]:target session:__tmux-sessions' \ } _tmux-show-messages() { -- cgit v1.2.3 From eb6c012f644f801d1e1524d80b09644976a17eda Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Thu, 17 Aug 2017 17:17:53 +0000 Subject: 41564: _tmux: Complete environment variables and their values for set-environment and show-environment. Also, teach show-environment not to offer --options after positional arguments. --- ChangeLog | 4 ++ Completion/Unix/Command/_tmux | 99 ++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 98 insertions(+), 5 deletions(-) (limited to 'Completion/Unix') diff --git a/ChangeLog b/ChangeLog index c0fdf37e2..19846e790 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2017-08-30 Daniel Shahaf + * 41564: Completion/Unix/Command/_tmux: Complete environment + variables and their values for set-environment and + show-environment. + * 41557: Completion/Unix/Command/_tmux: show-environment, set-environment: Make -g,-t mutually exclusive. diff --git a/Completion/Unix/Command/_tmux b/Completion/Unix/Command/_tmux index 0f142bb0e..7999be3eb 100644 --- a/Completion/Unix/Command/_tmux +++ b/Completion/Unix/Command/_tmux @@ -732,12 +732,33 @@ _tmux-set-buffer() { _tmux-set-environment() { [[ -n ${tmux_describe} ]] && print "(un)set an environment variable" && return - _arguments -s -A "-*" -S \ + local mode=session action=add + local curcontext="$curcontext" state line ret=1 + typeset -A opt_args + _arguments -C -s -A "-*" -S : \ '(-t)-g[modify global environment]' \ - '-r[remove variable before starting new processes]' \ - '-u[unset a variable]' \ + '(-u)-r[remove variable before starting new processes]' \ + '(-r)-u[unset a variable]' \ '(-g)-t[specify target session]:target session:__tmux-sessions' \ - ':name' ':value' + ': :->name' '(-u -r)2: :->value' && ret=0 + + if (( ${+opt_args[-g]} )); then + mode=global + fi + if (( ${+opt_args[-u]} )); then + action=unset + fi + if (( ${+opt_args[-r]} )); then + action=remove + fi + + # TODO: the exclusion "(-g -r)2:" doesn't work, so simulate it here + if [[ $action == (remove|unset) ]] && [[ $state == value ]]; then + __tmux-nothing-else + else + __tmux-environment-variables $mode $state $action && ret=0 + fi + return ret } _tmux-set-option() { @@ -804,10 +825,21 @@ _tmux-show-buffer() { _tmux-show-environment() { [[ -n ${tmux_describe} ]] && print "display the environment" && return - _arguments -s \ + local mode=session + local curcontext="$curcontext" state line ret=1 + typeset -A opt_args + _arguments -C -A "-*" -s : \ '(-t)-g[show global environment]' \ '-s[format output as Bourne shell commands]' \ '(-g)-t+[specify target session]:target session:__tmux-sessions' \ + '1:: :->name' && ret=0 + + if (( ${+opt_args[-g]} )); then + mode=global + fi + + __tmux-environment-variables $mode $state show && ret=0 + return ret } _tmux-show-messages() { @@ -997,6 +1029,63 @@ function __tmux-clients() { _describe -t clients 'clients' clients } +function __tmux-environment-variables() { + local mode="$1" state="$2" action="$3" + + local -a dash_g + case $mode in + (global) dash_g=(-g);; + (session) dash_g=();; + (*) return 1;; # bug in the caller + esac + + local hint + case $action in + (add|remove) hint=" (or specify a new one)";; + (unset|show) hint="";; + (*) return 1;; # bug in the caller + esac + + case ${state} in + (name) + local -a vars_and_vals=( ${(@f)"$(command tmux 2>/dev/null show-env $dash_g)"} ) + local -a descriptions + local k_v k v + for k_v in $vars_and_vals; do + k=${k_v%%=*} + if [[ $k == -* ]]; then + k=${k#-} + v='(remove)' + else + v=${k_v#*=} + fi + descriptions+=( "${k//:/\\:}:$v" ) + done + # TODO: this if/else is because '_describe ${hint:+"-x"}' prints the "No matches" error in addition to the message. + local msg="${dash_g[1]:+"global "}environment variables${hint}" + if _describe -t parameters $msg descriptions; then + : + elif [[ -n $hint ]]; then + _message $msg + fi + ;; + (value) + local var_and_val=${(@f)"$(command tmux 2>/dev/null show-env $dash_g -- ${(Q)words[-2]})"} + # TODO: this if/else is because '_description -x' prints the "No matches" error in addition to the message. + if [[ -n $var_and_val ]]; then + local -a expl + _description -x parameter-values expl "Value for ${words[-2]}" + compadd "$expl[@]" - ${var_and_val#*=} + else + _message "Value for ${words[-2]}" + fi + ;; + (*) + return 1 + ;; + esac +} + function __tmux-format() { _message 'not implemented yet' } -- cgit v1.2.3 From 1e44c649a40f0e3e555bcd8941a22381b92a9c1f Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Fri, 18 Aug 2017 04:23:44 +0000 Subject: 41566: _tmux: Complete only attached sessions for detach-session. --- ChangeLog | 3 +++ Completion/Unix/Command/_tmux | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'Completion/Unix') diff --git a/ChangeLog b/ChangeLog index 19846e790..968cc83fa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2017-08-30 Daniel Shahaf + * 41566: Completion/Unix/Command/_tmux: Complete only attached + sessions for detach-session. + * 41564: Completion/Unix/Command/_tmux: Complete environment variables and their values for set-environment and show-environment. diff --git a/Completion/Unix/Command/_tmux b/Completion/Unix/Command/_tmux index 7999be3eb..48fe29aee 100644 --- a/Completion/Unix/Command/_tmux +++ b/Completion/Unix/Command/_tmux @@ -302,7 +302,7 @@ _tmux-detach-client() { _arguments -s \ '-a[kill all clients except for the named by -t]' \ '-P[send SIGHUP to parent process]' \ - '-s+[specify target session and kill its clients]:session:__tmux-sessions' \ + '-s+[specify target session and kill its clients]:session:__tmux-sessions-attached' \ '-t+[specify target client]:client:__tmux-clients' } @@ -1366,6 +1366,13 @@ function __tmux-sessions() { _describe -t sessions 'sessions' sessions "$@" } +function __tmux-sessions-attached() { + local -a sessions + sessions=( ${${(f)"$(command tmux 2> /dev/null list-sessions)"}/:[ $'\t']##/:} ) + sessions=( ${(M)sessions:#*"(attached)"} ) + _describe -t sessions 'attached sessions' sessions "$@" +} + function __tmux-socket-name() { local expl sdir local curcontext="${curcontext}" -- cgit v1.2.3 From 73514c40f68fd7f66b64317d6e26793d400414ac Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Fri, 18 Aug 2017 04:23:45 +0000 Subject: 41567: _tmux: Complete detached sessions first for attach-session. --- ChangeLog | 3 +++ Completion/Unix/Command/_tmux | 21 ++++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) (limited to 'Completion/Unix') diff --git a/ChangeLog b/ChangeLog index 968cc83fa..6dcbdf530 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2017-08-30 Daniel Shahaf + * 41567: Completion/Unix/Command/_tmux: Complete detached + sessions first for attach-session. + * 41566: Completion/Unix/Command/_tmux: Complete only attached sessions for detach-session. diff --git a/Completion/Unix/Command/_tmux b/Completion/Unix/Command/_tmux index 48fe29aee..f71f7c33e 100644 --- a/Completion/Unix/Command/_tmux +++ b/Completion/Unix/Command/_tmux @@ -168,7 +168,7 @@ _tmux-attach-session() { '-c+[specify working directory for the session]:directory:_directories' \ '-d[detach other clients attached to target session]' \ '-r[put the client into read-only mode]' \ - '-t+[specify target session]:target session:__tmux-sessions' \ + '-t+[specify target session]:target session: __tmux-sessions-separately' \ "-E[don't apply update-environment option]" } @@ -1373,6 +1373,25 @@ function __tmux-sessions-attached() { _describe -t sessions 'attached sessions' sessions "$@" } +# Complete attached-sessions and detached-sessions as separate tags. +function __tmux-sessions-separately() { + local ret=1 + local -a sessions detached_sessions attached_sessions + sessions=( ${${(f)"$(command tmux 2> /dev/null list-sessions)"}/:[ $'\t']##/:} ) + detached_sessions=( ${sessions:#*"(attached)"} ) + attached_sessions=( ${(M)sessions:#*"(attached)"} ) + + # ### This seems to work without a _tags loop but not with it. I suspect + # ### that has something to do with _describe doing its own _tags loop. + _tags detached-sessions attached-sessions + # Placing detached before attached means the default behaviour of this + # function better suits its only current caller, _tmux-attach-session(). + _requested detached-sessions && _describe -t detached-sessions 'detached sessions' detached_sessions "$@" && ret=0 + _requested attached-sessions && _describe -t attached-sessions 'attached sessions' attached_sessions "$@" && ret=0 + + return ret +} + function __tmux-socket-name() { local expl sdir local curcontext="${curcontext}" -- cgit v1.2.3 From ef9d13c3d136c38c0cdbebd30e0f91e9eb4a0000 Mon Sep 17 00:00:00 2001 From: Marc Aldorasi Date: Sun, 3 Sep 2017 21:29:48 -0400 Subject: 41637: add explicit objdump completion --- ChangeLog | 5 ++ Completion/Unix/Command/_objdump | 106 ++++++++++++++++++++++++++++++++++++++- 2 files changed, 109 insertions(+), 2 deletions(-) (limited to 'Completion/Unix') diff --git a/ChangeLog b/ChangeLog index 9be81ffd6..01fe41838 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2017-09-04 Peter Stephenson + + * 41637: Marc Aldorasi: Completion/Unix/Command/_objdump: + explicit completion instead of generating from _object_files. + 2017-09-02 Peter Stephenson * 41623: Etc/FAQ.yo: update to align with Yodl 3. diff --git a/Completion/Unix/Command/_objdump b/Completion/Unix/Command/_objdump index cc213d911..e012b4cbc 100644 --- a/Completion/Unix/Command/_objdump +++ b/Completion/Unix/Command/_objdump @@ -1,3 +1,105 @@ -#compdef objdump +#compdef objdump eu-objdump -_arguments -- '*:object file:_object_files' +local args files variant context state state_descr line +typeset -A opt_args + +files='*:object file:_object_files' + +_pick_variant -r variant binutils=GNU elfutils=elfutils unix --version + +args=( + "(-d --disassemble)"{-d,--disassemble}"[Display assembler code of executable sections]" + "(-r --reloc)"{-r,--reloc}"[Display relocation information]" + "(-s --full-contents)"{-s,--full-contents}"[Display the full contents of all sections requested]" + "*"{-j+,--section=}"[Only display information for section]:section:(.bss .data .dynamic .dynsym .got .interp .shstrtab .symtab .text)" +) + +case $variant in + binutils) + args+=( + "(-a --archive-headers)"{-a,--archive-headers}"[Display archive header information]" + "(-f --file-headers)"{-f,--file-headers}"[Display the contents of the overall file header]" + "(-p --private-headers)"{-p,--private-headers}"[Display object format specific file header contents]" + "*"{-P,--private=}"[Display object format specific contents]:option" + "(-h --section-headers --headers)"{-h,--section-headers,--headers}"[Display the contents of the section headers]" + "(-x --all-headers)"{-x,--all-headers}"[Display the contents of all headers]" + "(-D --disassemble-all)"{-D,--disassemble-all}"[Display assembler contents of all sections]" + "(-S --source)"{-S,--source}"[Intermix source code with disassembly]" + "(-g --debugging)"{-g,--debugging}"[Display debug information in object file]" + "(-e --debugging-tags)"{-e,--debugging-tags}"[Display debug information using ctags style]" + "(-G --stabs)"{-G,--stabs}"[Display (in raw form) any STABS info in the file]" + + "*-W-[Display DWARF info in the file]::dwarf section:->short_dwarf_names" + "*--dwarf=-[Display DWARF info in the file]::dwarf section:->dwarf_names" + + "(-t --syms)"{-t,--syms}"[Display the contents of the symbol table(s)]" + "(-T --dynamic-syms)"{-T,--dynamic-syms}"[Display the contents of the dynamic symbol table]" + "(-R --dynamic-reloc)"{-R,--dynamic-reloc}"[Display the dynamic relocation entries in the file]" + #@ Read options from + + "(- *)"{-v,--version}"[Display this program's version number]" + "(- *)"{-i,--info}"[List object formats and architectures supported]" + "(- *)"{-H,--help}"[Display this information]" + + "(-b --target)"{-b+,--target=}"[Specify the target object format]:bfdname:->bfdname" + "(-m --architecture)"{-m+,--architecture=}"[Specify the target architecture]:machine:->machine" + "*"{-M+,--disassembler-options=}"[Pass text OPT on to the disassembler]:opt:->disassembler_options" + + "(-E --endian)-E+[Assume endianess when disassembling]:endianess:((B\:\"Assume big endian format when disassembling\" L\:\"Assume little endian format when disassembling\"))" + "(-E --endian)--endian=[Assume endianess when disassembling]:endianess:((big\:\"Assume big endian format when disassembling\" little\:\"Assume little endian format when disassembling\"))" + + "--file-start-context[Include context from start of file (with -S)]" + "*"{-I+,--include=}"[Add directory to search list for source files]:directory:_files -/" + "(-l --line-numbers)"{-l,--line-numbers}"[Include line numbers and filenames in output]" + "(-F --file-offsets)"{-F,--file-offsets}"[Include file offsets when displaying information]" + "(-C --demangle)-C[Decode mangled/processed symbol names]" + "(-C --demangle)--demangle=-[Decode mangled/processed symbol names]::style:(auto gnu lucid arm hp edg gnu-v3 java gnat)" + "(-w --wide)"{-w,--wide}"[Format output for more than 80 columns]" + "(-z --disassemble-zeroes)"{-z,--disassemble-zeroes}"[Do not skip blocks of zeroes when disassembling]" + + "--start-address=[Only process data whose address is >= ADDR]:addr" + "--stop-address=[Only process data whose address is <= ADDR]:addr" + "--prefix-addresses[Print complete address alongside disassembly]" + "(--show-raw-insn --no-show-raw-insn)"--{,no-}show-raw-insn"[Display hex alongside symbolic disassembly]" + "--insn-width=[Display WIDTH bytes on a single line for -d]:width" + "--adjust-vma=[Add offset to all displayed section addresses]:offset" + "--special-syms[Include special symbols in symbol dumps]" + "--prefix=[Add prefix to absolute paths for -S]:prefix" + "--prefix-strip=[Strip initial directory names for -S]:level" + "--dwarf-depth=[Do not display DIEs at depth N or greater]:n" + "--dwarf-start=[Display DIEs starting with N, at the same depth or deeper]:n" + "--dwarf-check[Make additional dwarf internal consistency checks]" + ) + ;; + elfutils) + args+=( + "--color=-[Colorize the output]::when:(always auto never)" + "(- *)"{-\?,--help}"[Display help]" + "(- *)--usage[Display usage]" + "(- *)"{-V,--version}"[Display program version]" + + ) + ;; +esac + +_arguments -s -S : "$args[@]" $files + +case "$state" in + short_dwarf_names) + _values -s "" "dwarf section" "l[rawline]" "L[decodedline]" "i[info]" "a[abbrev]" "p[pubnames]" "r[aranges]" "m[macro]" "f[frames]" "F[frames-interp]" "s[str]" "o[loc]" "R[Ranges]" "t[pubtypes]" + ;; + dwarf_names) + _values -s , "dwarf section" rawline decodedline info abbrev pubnames aranges macro frames frames-interp str loc Ranges pubtypes gdb_index trace_info trace_abbrev trace_aranges addr cu_index + ;; + bfdname) + _values "object format" "${(z)${(@M)${(f)$(_call_program targets objdump --help)}##* supported targets:*}##*: }" + ;; + machine) + _values "machine architecture" "${(@)${(z)${(@M)${(f)$(_call_program targets objdump --help)}##* supported architectures:*}##*: }//:/\\:}" + ;; + disassembler_options) + _values -s , "disassembler options" "${(@)${(@)${(@M)${(f)${(ps.-M switch.)$(_call_program targets objdump --help)}[2]}:# [^ ]*}# }%% *}" + ;; +esac + + -- cgit v1.2.3 From 2c4e5c4acb5964581eae28c5fda2526c6fc6237b Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Tue, 29 Aug 2017 02:28:09 +0000 Subject: 41620 (tweaked per 41622): _mkdir: Don't offer a linux-specific option in the 'zsh' variant. --- ChangeLog | 5 +++++ Completion/Unix/Command/_mkdir | 14 +++++--------- 2 files changed, 10 insertions(+), 9 deletions(-) (limited to 'Completion/Unix') diff --git a/ChangeLog b/ChangeLog index 01fe41838..4af9acfe1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2017-09-04 Daniel Shahaf + + * 41620 (tweaked per 41622): Completion/Unix/Command/_mkdir: + Don't offer a linux-specific option in the 'zsh' variant. + 2017-09-04 Peter Stephenson * 41637: Marc Aldorasi: Completion/Unix/Command/_objdump: diff --git a/Completion/Unix/Command/_mkdir b/Completion/Unix/Command/_mkdir index f2299f7c7..afa9cc1f8 100644 --- a/Completion/Unix/Command/_mkdir +++ b/Completion/Unix/Command/_mkdir @@ -9,14 +9,6 @@ args=( '(-)*: :->directories' ) -case "$OSTYPE" in - linux*) - args+=( - '(-Z --context)'{-Z,--context=}'[set SELinux context]:SELinux context' - ) - ;; -esac - _pick_variant -r variant gnu=gnu zsh='\(eval\)' $OSTYPE --help # It can still happen that there is a precommand command or builtin in the line. # In such cases, the variant has to be modified suitably, after further checking @@ -41,13 +33,17 @@ case $variant in ) ;| gnu) + if [[ $OSTYPE == linux* ]]; then + args+=( + '(-Z --context)'{-Z,--context=}'[set SELinux context]:SELinux context' + ) + fi args+=( '(- :)--help[display help information]' '(- :)--version[display version information]' ) ;; zsh) # remove all options - args=( '*: :->directories' ) ;; *) # non-GNU: remove long options args=( ${${${args:#(|*\))--*}//--[^ )]#/}/\( #\)/} ) -- cgit v1.2.3 From 1e536747aee3d39d7e960add67f19fcf6e9ee284 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Tue, 29 Aug 2017 02:28:10 +0000 Subject: 41621: _mkdir: Honour the 'command' and 'builtin' precommand modifiers. --- ChangeLog | 3 +++ Completion/Unix/Command/_mkdir | 25 ++++++++++++------------- 2 files changed, 15 insertions(+), 13 deletions(-) (limited to 'Completion/Unix') diff --git a/ChangeLog b/ChangeLog index 4af9acfe1..9ccfc461b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2017-09-04 Daniel Shahaf + * 41621: Completion/Unix/Command/_mkdir: Honour the 'command' + and 'builtin' precommand modifiers. + * 41620 (tweaked per 41622): Completion/Unix/Command/_mkdir: Don't offer a linux-specific option in the 'zsh' variant. diff --git a/Completion/Unix/Command/_mkdir b/Completion/Unix/Command/_mkdir index afa9cc1f8..2850b405d 100644 --- a/Completion/Unix/Command/_mkdir +++ b/Completion/Unix/Command/_mkdir @@ -9,22 +9,21 @@ args=( '(-)*: :->directories' ) -_pick_variant -r variant gnu=gnu zsh='\(eval\)' $OSTYPE --help # It can still happen that there is a precommand command or builtin in the line. # In such cases, the variant has to be modified suitably, after further checking # the variant of the _command_ mkdir. - -# I currently don't know of any way to find out what precommands are present on -# the line. The variant should be modified like this once a way is found out: - -# if [[ $variant == zsh ]]; then -# if [[ $precommand = *command* ]]; then -# _mkdir_command () { command mkdir "$@" } -# _pick_variant -c _mkdir_command -r variant gnu=gnu unix --help -# fi -# elif [[ $precommand = *builtin* ]]; then -# variant=zsh -# fi +# +# $precommands is defined in _main_complete +if (( ${+precommands[(r)command]} )); then + _mkdir_command () { command mkdir "$@" } + _pick_variant -c _mkdir_command -r variant gnu=gnu unix --help + unfunction _mkdir_command +elif (( ${+precommands[(r)builtin]} )) || (( ${+builtins[mkdir]} )) || [[ "$(type -w mkdir)" == "*: builtin" ]]; then + variant=zsh +else + _pick_variant -r variant gnu=gnu zsh='\(eval\)' $OSTYPE --help +fi +# Now $variant is set. case $variant in gnu|freebsd*|dragonfly*) -- cgit v1.2.3 From 6401caa1836fcd0c0325423eb5a8eedb6c7400cd Mon Sep 17 00:00:00 2001 From: Jun-ichi Takimoto Date: Sat, 9 Sep 2017 01:02:23 +0900 Subject: 41628 (plus 41645 by Oliver): _ps: update options also do not reset compstate[insert] --- ChangeLog | 5 +++ Completion/Unix/Command/_ps | 100 +++++++++++++++++++++++++++++++++----------- 2 files changed, 81 insertions(+), 24 deletions(-) (limited to 'Completion/Unix') diff --git a/ChangeLog b/ChangeLog index ea7a644b8..39f334370 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2017-09-09 Jun-ichi Takimoto + + * 41628 (plus 41645 by Oliver): Completion/Unix/Command/_ps: + update options; do not reset compstate + 2017-09-05 Peter Stephenson * 41641: Src/math.c: more arithmetic operations need to be diff --git a/Completion/Unix/Command/_ps b/Completion/Unix/Command/_ps index 6f67f7933..a8208a365 100644 --- a/Completion/Unix/Command/_ps +++ b/Completion/Unix/Command/_ps @@ -11,7 +11,7 @@ _ps_props() { case $OSTYPE in linux-gnu) opts=( ${${(f)"$(_call_program properties $words[1] L)"}%% *} ) ;; - freebsd*) opts=( $(_call_program properties $words[1] L) ) ;; + *bsd*|dragonfly*|darwin*) opts=( $(_call_program properties $words[1] L) ) ;; solaris*) opts=( ${=${(f)"$(_call_program properties $words[1] - 2>&1)"}[-3,-1]} ) ;; esac @@ -19,8 +19,8 @@ _ps_props() { } local curcontext="$curcontext" state line expl ret=1 -local short long -local -a args bsd bsdarg pids +local short long pids +local -a args bsd bsdarg local -A equivs args=( @@ -46,26 +46,20 @@ args=( bsd=( 'a[include processes belonging to other users]' - 'e[show environment after command]' '(j s u v X)l[output in long format]' '(l s u v X)j[output in job control format]' 'x[include processes with no controlling terminal]' - '(j l s v X)u[output in resource usage format]' '(j l s u X)v[output in virtual memory format]' '*w[wide output]' - 'H[show threads as if they were processes]' 'L[display all format specifiers]' 'S[include child process data with the parent]' 'T[select processes attached to current terminal]' - 'Z[show security data]' ) bsdarg=( '*p[select processes by ID]' '*t[select processes by attached terminal]' - '*U[select processes by effective user]' 'O[specify additional output fields]' 'o[specify output format]' - 'N[set namelist file for WCHAN display]' ) case $OSTYPE in @@ -82,26 +76,73 @@ case $OSTYPE in '-Z[show zone with which process is associated]' ) ;; + linux-gnu|dragonfly*|freebsd*|netbsd*|openbsd*) + bsd+=( + 'e[show environment after command]' + '(j l s v X)u[output in resource usage format]' + ) + bsdarg+=( + 'N[set namelist file for WCHAN display]' + '*U[select processes by effective user]' + ) + ;| + linux-gnu|dragonfly*|freebsd*|openbsd*) + bsd+=( 'H[show threads as if they were processes]' ) + ;| darwin*|dragonfly*|freebsd*|netbsd*|openbsd*) bsd+=( 'A[select every process]' - 'C[ignore resident time for CPU percentage]' 'c[show just executable name for command]' 'h[repeat header lines, one per page of output]' '(r)m[sort by memory usage]' '(m)r[sort by CPU usage]' ) - bsdarg+=( - 'M[extract values from specified core]' - ) + ;| + darwin*|dragonfly*|freebsd*|netbsd*) + bsd+=( 'C[ignore resident time for CPU percentage]' ) + ;| + dragonfly*|freebsd*|netbsd*|openbsd*) + bsdarg+=( 'M[extract values from specified core]' ) ;| linux-gnu|netbsd*) bsdarg+=( 'k[specify sort order]' ) ;| - darwin*|freebsd*) bsdarg+=( 'G[select processes by real group]' ) ;| + darwin*|freebsd*) + bsd+=( 'X[skip processes with no controlling terminal]' ) + bsdarg+=( '*G[select processes by real group]' ) + ;| + freebsd*|dragonfly*) + bsd+=( 'f[show command and environment for swapped out processes]' ) ;| + netbsd*|openbsd*) + bsdarg+=( 'W[extract swap information from specified file]' ) + ;| + darwin*) + bsd+=( + 'd[select all processes except session leaders]' + 'E[show environment after command]' + 'f[full listing]' + 'M[show threads corresponding to each process]' + ) + bsdarg+=( + '*g[select processes by process group leader]' + '*U[select processes by real user]' + ) + if [[ $words[CURRENT] = -* ]]; then + bsd+=( 'e[select every process]' ) + bsdarg+=( 'u[select processes by user id]' ) + else + bsd+=( + 'e[show environment after command]' + '(j l v)u[output in resource usage format]' + ) + fi + ;; + dragonfly*) + bsd+=( 'R[subsort by parent/child chain]' ) + ;; freebsd*) bsd+=( 'd[show process hierarchy]' - 'f[show command and environment for swapped out processes]' '*J[select processes by jail ID]' + 'Z[show mac label]' ) ;; netbsd*) bsd+=( '(j l u v)s[output in thread format]' ) ;; @@ -109,7 +150,6 @@ case $OSTYPE in bsd+=( 'k[display information about kernel threads]' ) - bsdarg+=( 'W[extract swap information from the specified file]' ) ;; linux-gnu) args+=( @@ -127,7 +167,8 @@ case $OSTYPE in '--cumulative[include child process data with the parent]' '-n[set namelist file for WCHAN display]:file:_files' '(--no-headers --no-heading)'{--no-headers,--no-heading}'[suppress headers]' - '--sort=[specify sort order]:order:_ps_props -s' + '(-q --quick-pid -a -A -d -e -N --deselect -C -p --pid --ppid -G --Group -g --group -s --sid -t --tty -u --user -U --User --forest -H --sort)'{-q+,--quick-pid=}'[select processes by ID (quick mode)]:process ID:_sequence -s , _pids' + '--sort=[specify sort order]:order:_sequence -s , _ps_props -s' '-w[wide output]' '-m[show threads after processes]' '-T[show threads, with SPID column]' @@ -150,23 +191,33 @@ case $OSTYPE in '(j l u v X)s[output in signal format]' 'V[display version information]' '(j l s u v)X[output in register format]' + 'Z[show security data]' ) + bsdarg+=( 'q[select processes by ID (quick mode)]' ) ;; esac -if (( CURRENT > 1 )) && [[ $OSTYPE != solaris* || ( $OSTYPE = linux-gnu && $words[CURRENT-1] != -* ) ]]; then +if (( CURRENT > 1 )) && [[ $OSTYPE != (solaris*|linux-gnu) || + ( $OSTYPE = linux-gnu && $words[CURRENT-1] != -* ) ]]; then case $words[CURRENT-1] in *k) - _wanted -C option-k-1 properties expl 'property' _sequence -s , _ps_props -s - && return - ;; + local sopt + [[ $OSTYPE = linux-gnu ]] && sopt='-s' + _wanted -C option-k-1 properties expl 'property' \ + _sequence -s , _ps_props $sopt - && return ;; + *g) [[ $OSTYPE = darwin* ]] && _wanted -C option-g-1 processes \ + expl 'process ID' _sequence -s , _pids && return ;; *G) _sequence -s , _groups && return ;; *J) _sequence _jails -0 && return ;; *[MNW]) _files && return ;; *t) _wanted -C option-t-1 ttys expl tty _sequence -s , _ttys -D && return ;; - *p) _wanted -C option-p-1 processes expl 'process ID' _sequence -s , _pids && return;; + *[pq]) _wanted -C "option-${words[CURRENT-1][-1]}-1" processes \ + expl 'process ID' _sequence -s , _pids && return ;; *U) _wanted -C option-U-1 users expl user _sequence -s , _users && return ;; + *u) [[ $OSTYPE = darwin* && $words[CURRENT-1] = -* ]] && \ + _wanted -C option-u-1 users expl user _sequence -s , _users && return ;; *[oO]) _wanted -C "option-${words[CURRENT-1][-1]}-1" properties \ expl 'property' _sequence -s , _ps_props - && return ;; esac @@ -175,13 +226,14 @@ fi if [[ $OSTYPE = (*bsd*|darwin*|dragonfly*) ]]; then compset -P - && pids=1 else - _arguments -C -s $args '*:: :->rest' && ret=0 - [[ -z "$state" || $OSTYPE = solaris* ]] && return ret + [[ $OSTYPE = solaris* ]] || args+=( '*:: :->rest' ) + _arguments -C -s $args && ret=0 + [[ -z "$state" ]] && return ret fi _values -s '' -S ' ' 'options' $bsd && ret=0 _values -S ' ' 'options' $bsdarg && ret=0 if [[ -z $pids ]]; then - _pids && compstate[insert]= + _pids && ret=0 fi return ret -- cgit v1.2.3 From 9429663af32488ce81aee19ac04697b07fc241ab Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Fri, 15 Sep 2017 18:31:11 +0200 Subject: 41709: update options in Linux sysstat completions --- ChangeLog | 5 +++ Completion/Linux/Command/_sysstat | 70 +++++++++++++++++++++++++-------------- Completion/Unix/Command/_iostat | 22 ++++++++---- 3 files changed, 67 insertions(+), 30 deletions(-) (limited to 'Completion/Unix') diff --git a/ChangeLog b/ChangeLog index d6cc06270..b6213b62f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2017-09-15 Oliver Kiddle + + * 41709: Completion/Linux/Command/_sysstat, + Completion/Unix/Command/_iostat: update options in completion + 2017-09-15 Peter Stephenson * unposted: Doc/Zsh/params.yo: nodref -> noderef. diff --git a/Completion/Linux/Command/_sysstat b/Completion/Linux/Command/_sysstat index e976b4705..855bf0a70 100644 --- a/Completion/Linux/Command/_sysstat +++ b/Completion/Linux/Command/_sysstat @@ -1,15 +1,17 @@ #compdef mpstat cifsiostat isag sadf sar pidstat -# -V can appear with other options, so (- *) isn't needed. #TODO: # sysstat-nfsiostat - there seems to be two nfsiostat(1)s. one from oracle and one by redhat. _mpstat() { - _arguments : \ - '-A[equivalent to -u -I ALL -P ALL]' \ - '-I[report interrupt statistics]:interrupt:(SUM CPU SCPU ALL)' \ - '-P[specify processor number]:processor: _values -s "," processor ON ALL {1..$(_call_program processors getconf _NPROCESSORS_ONLN)}' \ + _arguments -S : \ + '(-n -u -I -N -P)-A[equivalent to -n -u -I ALL -N ALL -P ALL]' \ + '(-A)-I[report interrupt statistics]:interrupt:(SUM CPU SCPU ALL)' \ + '(-A)-N[specify NUMA nodes]:NUMA node' \ + '(-A)-n[report summary CPU statistics based on NUMA node placement]' \ + '-o[display statistics in JSON]:format:(JSON)' \ + '(-A)-P[specify processor number]:processor: _values -s "," processor ON ALL {0..$(_call_program processors getconf _NPROCESSORS_ONLN)}' \ '-u[report CPU utilization]' \ - '-V[print version number]' \ + '(- 1 2)-V[display version information]' \ '1: : _guard "^-*" interval' \ '2: : _guard "^-*" count' } @@ -20,7 +22,8 @@ _cifsiostat() { '(-m)-k[display statistics in kB/s]' \ '(-k)-m[display statistics in MB/s]' \ '-t[print timestamp for each report]' \ - '-V[print version number]' \ + '(- 1 2)-V[print version number]' \ + '--human[print sizes in human readable format]' \ '1: : _guard "^-*" interval' \ '2: : _guard "^-*" count' } @@ -34,50 +37,62 @@ _isag() { } _sadf() { - local ret=1 + local i ret=1 # any options after `--' are for sar(1) - if ! (( CURRENT > $words[(i)--] )); then + if (( CURRENT <= $words[(i)--] )); then _arguments : \ '-C[display comments in file]' \ - '(-j -p -x)-d[output file in SQL format]' \ + '-c[convert an old datafile to the new format]' \ '-e[set ending time of report]:ending time (HH\:MM\:SS)' \ '-H[display only the header of the report]' \ - '(-j -p -x)-h[print on a single line when used with -d]' \ - '(-d -p -x)-j[output file in JSON]' \ + '(-g -j -p -r -x)-h[print on a single line when used with -d]' \ + '-O[specify output options]: : _values -s , option + autoscale height\:value oneday packed showidle showinfo skipempty showhints' \ '-P[restrict processor dependant statistics]:processor number(zero indexed) or ALL:(ALL)' \ - '(-j -x -d)-p[print in format parsable by tools like awk]' \ '-s[set starting time of report]:starting time (HH\:MM\:SS)"' \ '(-t -U)-T[display timestamp in local time]' \ '(-T -U)-t[display timestamp in file\''s original localtime]' \ '(-t -T)-U[display in seconds since epoch (UTC)]' \ - '-V[print version number]' \ - '(-j -d -p)-x[output file in XML]' \ + '(- 1 2 3)-V[print version number]' \ '1: : _guard "^-*" interval' \ '2: : _guard "^-*" count' \ - '3:data file:_files' && ret=0 + '3:data file:_files' \ + + '(format)' \ + '-d[output file in SQL format]' \ + '-g[print data in SVG format]' \ + '-j[output file in JSON]' \ + '-p[print in format parsable by tools like awk]' \ + '-r[print raw contents of data file]' \ + '-x[output file in XML]' \ + && ret=0 else - _arguments : '*::sar: _sar' && ret=0 + (( i = words[(i)--] - 1, CURRENT -= i )) + shift i words + _sar && ret=0 fi return ret } _sar() { - _arguments : \ - '-A[equivalent to -bBdFHqrRSuvwWy -I SUM -I XALL -m ALL -n ALL -u ALL -P ALL]' \ + _arguments -s : \ + '-A[equivalent to -bBdFHqrRSuvwWy -I SUM -I XALL -m ALL -n ALL -r ALL -u ALL -P ALL]' \ '-B[report paging statistics]' \ '-b[report I/O and transfer rate statistics]' \ '-C[display comments from sadc]' \ + '-D[use saYYYYMMDD instead of saDD as the standard system activity daily data file name]' \ '-d[report activity for each block device]' \ '-e[set ending time of report]:ending time (HH\:MM\:SS)' \ '-F[display statistics for mounted filesystems]' \ '-f[extract records from file]:record:_files' \ '-H[report hugepages utilization]' \ '-h[display help]' \ + '--human[print sizes in human readable format]' \ '*-I[report statistics for interrupts]:interrupts: _values -s "," interrupts 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 SUM ALL XALL' \ '-i[select records as close as possible to interval]:interval' \ '-j[display persistent device names]:type:(ID LABEL PATH UUID)' \ '-m[report power management statistics]:keywords: _values -s "," keywords CPU FAN FREQ IN TEMP USB ALL' \ '-n[report network statistics]:keywords: _values -s "," keywords DEV EDEV NFS NFSD SOCK IP EIP ICMP EICMP TCP ETCP UDP SOCK6 IP6 EIP6 ICMP6 EICMP6 UDP6 ALL' \ + '-o[save readings to file in binary form]:file:_files' \ '-P[report per-processor statistics]:processor: _values -s "," processors ALL' \ '-p[pretty-print device names]' \ '-q[report queue length and load averages]' \ @@ -85,8 +100,10 @@ _sar() { '-r[report memory utilization statistics]' \ '-S[report swap space utilization]' \ '-s[set starting time of report]:start time (HH\:MM\:SS)' \ + '--sadc[print name of data collector]' \ + '-t[display timestamps in original local time of file creator]' \ '-u[report CPU utilization]: :(ALL)' \ - '-V[print version number]' \ + '(- 1 2)-V[display version information]' \ '-v[report status of kernel tables]' \ '-W[report swapping statistics]' \ '-w[report task creation and system switching activity]' \ @@ -96,22 +113,27 @@ _sar() { } _pidstat() { - _arguments : \ + _arguments -s : \ '-C[filter tasks by string]:task filter' \ '-d[report I/O statistics]' \ - '-h[display on horizontally]' \ + '-e[execute specified program and monitor it with pidstat]:*::command: _normal' \ + '-H[display timestamp in seconds since the epoch]' \ + '-h[display horizontally]' \ '-I[divide CPU usage by number of processors]' \ '-l[display process name along with arguments]' \ - '-p[select pid]:pid: _sequence _pids' \ + '*-p[select pid]:pid: _sequence _pids' \ + '-R[report realtime priority and scheduling policy information]' \ '-r[report page faults and memory]' \ '-s[report stack utilization]' \ '-T[specifies what to monitor]:type:(TASK CHILD ALL)' \ '-t[display statistics for threads]' \ '-U[display real username of tasks]::username:_users' \ '-u[report cpu utilization]' \ - '-V[print version number]' \ + '(- 1 2)-V[display version information]' \ '-v[display values from kernel table]' \ '-w[report task switching activity]' \ + '-G[include only processes with specified name]:process name' \ + '--human[print sizes in human readable format]' \ '1: : _guard "^-*" interval' \ '2: : _guard "^-*" count' } diff --git a/Completion/Unix/Command/_iostat b/Completion/Unix/Command/_iostat index 88fc6a103..e95d62f80 100644 --- a/Completion/Unix/Command/_iostat +++ b/Completion/Unix/Command/_iostat @@ -1,6 +1,7 @@ #compdef iostat -local -a args +local -a args parser +parser=( -s -S -A '-*' ) case $OSTYPE:l in *bsd*) @@ -109,23 +110,32 @@ case $OSTYPE:l in ) ;; *linux*) + parser=( -s ) args=( '-c[display CPU utilization report]' '-d[display device utilization report]' - '-T[only display global statistics for group_name]' - '-g[display statistics for a group of devices]:group name' - '-h[human readable device utilization report]' - '-j[display persistent device name]' + '*-g[display statistics for a group of devices]:group name' + '-H[only display global statistics for group]' + '(--human)-h[human readable device utilization report]' + '--human[print sizes in human readable format]' + '-j[display persistent device name]:name type:(ID LABEL PATH UUID)' '(-m)-k[display statistics in kB/s]' '(-k)-m[display statistics in MB/s]' '-N[display registered device mapper names]' + '-o[display statistics in JSON]:format:(JSON)' + '-p[display statistics for block devices]' + '-t[display the time for each report]' + '(- *)-V[display version information]' + '-x[display extended statistics]' + '-y[omit first statistics report following system boot]' + '-z[omit output for devices lacking activity]' '*::device:_files -W /dev -g "*(-%)"' ) ;; esac if (( $#args )); then - _arguments -s -w -A '-*' : $args + _arguments $parser : $args return fi -- cgit v1.2.3 From c1f789d2aadb770a8195def524dc49519f47b0ca Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Fri, 15 Sep 2017 18:36:24 +0200 Subject: 41710: new smartctl completion --- ChangeLog | 3 ++ Completion/Unix/Command/_smartmontools | 61 ++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 Completion/Unix/Command/_smartmontools (limited to 'Completion/Unix') diff --git a/ChangeLog b/ChangeLog index b6213b62f..2c36b9461 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2017-09-15 Oliver Kiddle + * 41710: Completion/Unix/Command/_smartmontools: + new smartctl completion + * 41709: Completion/Linux/Command/_sysstat, Completion/Unix/Command/_iostat: update options in completion diff --git a/Completion/Unix/Command/_smartmontools b/Completion/Unix/Command/_smartmontools new file mode 100644 index 000000000..c60322ee0 --- /dev/null +++ b/Completion/Unix/Command/_smartmontools @@ -0,0 +1,61 @@ +#compdef smartctl + +local context state state_descr line + +_arguments -s -S \ + '(H -i --info)'{-i,--info}'[show identity information for device]' \ + '(H)--identify=-[show words and bits from indentification data]: : _values -S "" "words and bits" + "(n v)b[print all bits]" + "w[print all words]" + "(b v)n[suppress printing bits]" + "(b n)v[print all bits from valid words]"' \ + '(H)*'{-g+,--get=}'[get device setting]:setting:(all aam apm lookahead security wcache rcache wcreorder)' \ + '(H -a --all -x --xall -H --health -i --info -c --capabilities -A --attributes --scan --scan-open)'{-a,--all}'[show all SMART information for device]' \ + '(H -x --xall -a --all -H --health -i --info -c --capabilities -A --attributes --scan --scan-open)'{-x,--xall}'[show all information for device]' \ + '(H 1 --scan-open --identify -x --xall -a --all -H --health -i --info -c --capabilities -A --attributes)--scan[scan for devices]' \ + '(H 1 --scan --identify -x --xall -a --all -H --health -i --info -c --capabilities -A --attributes)--scan-open[scan for devices and try to open each device]' \ + '(H -q --quietmode)'{-q+,--quietmode=}'[set smartctl quiet mode]:quiet mode:(errorsonly silent noserial)' \ + '(H -d --device)'{-d+,--device=}'[specify device type]:device type:(ata scsi nvme sat usbcypress usbjmicron usbprolific usbsunplus marvell areca 3ware hpt megaraid cciss auto test)' \ + '(H)*'{-T+,--tolerance=}'[specify how tolerant smartctl should be of ATA SMART command failures]:tolerance:(normal conservative permissive verypermissive)' \ + '(H -b --badsum)'{-b+,--badsum=}'[set action if checksum error is detected]:action:(warn exit ignore)' \ + '(H)*'{-r+,--report=}'[report transactions]:transaction type:(ioctl ataioctl scsiioctl nvmeioctl)' \ + '(H -n --nocheck)'{-n+,--nocheck=}'[exit if the device is in a low-power mode]:power mode causing exit:(never sleep standby idle)' \ + '(H -s --smart)--smart=[enable/disable SMART on device]:enable:(on off)' \ + '(H -o --offlineauto)'{-o+,--offlineauto=}'[enable/disable automatic offline test on device]:enable:(on off)' \ + '(H -S --saveauto)'{-S+,--saveauto=}'[enable/disable attribute autosave on device]:enable:(on off)' \ + '(H -s --set)'{-s+,--set=}'[enable/disable/change device setting]:setting:->settings' \ + '(H -H --health)'{-H,--health}'[show device SMART health status]' \ + '(H -c --capabilities)'{-c,--capabilities}'[show device SMART capabilities]' \ + '(H -A --attributes)'{-A,--attributes}'[show device SMART vendor-specific attributes and values]' \ + '(H)*'{-f+,--format=}'[set output format for attributes]:format:(old brief hex,id hex,val hex)' \ + '(H)*'{-l+,--log=}'[show device log]:log:(error selftest selective directory xerror xselftest background sasphy sataphy scttemp scttempsts scttemphist scttempint scterc devstat ssd gplog smartlog nvmelog)' \ + '(H)*'{-v+,--vendorattribute=}'[set display option for vendor attribute]:vendor attribute:->vendorattrs' \ + '(H -F --firmwarebug)'{-F+,--firmwarebug=}'[use firmware bug workaround]:bug:(none nologdir samsung samsung2 samsung3 xerrorlba swapid)' \ + '(H -P --presets)'{-P+,--presets=}'[specify whether to use drive-specific presets]:preset usage:(use ignore show showall)' \ + '(H -B --drivedb)'{-B+,--drivedb=}'[read drive database from file]:file:->plusfiles' \ + '(H -t --test)'{-t+,--test=}'[run specified self-test]:self-test:(offline short long conveyance force vendor select pending afterselect,on afterselect,off scttempint)' \ + '(H -C --captive)'{-C,--captive}'[run self-test in captive mode]' \ + '(H -X --abort)'{-X,--abort}'[abort any non-captive self-test]' \ + '(H --scan --scan-open)1:disk device:_files -g "*(-%)" -P / -W /' \ + + 'H' \ + '(- 1)'{-h,--help,--usage}'[display help information]' \ + '(- 1)'{-V,--version,--copyright,--license}'[display version, licence and build information]' && return + +case $state in + vendorattrs) + _wanted -C $context vendor-attributes expl 'vendor attribute' compadd - \ + ${${${(f)"$(_call_program vendor-attributes $words[1] -v help)"}[(r)*help*,-1]#$'\t'}%%\[*} + ;; + plusfiles) + compset -P \+ || state_descr[1]+=" (prefix with + to prepend entries)" + _wanted -C $context files expl $state_descr _files + ;; + settings) + local values + [[ $context = option-s-1 ]] && + values+=( {on\[en,off\[dis}'able SMART on device]' ) + + _values -S , setting $values {aam,apm,standby}':value' \ + {lookahead,{w,r}cache,wcreorder}':enable:(on off)' security security-freeze + ;; +esac -- cgit v1.2.3 From 8e9fe082be378f23d5802e231b2051da18f00f10 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Fri, 15 Sep 2017 20:24:04 +0200 Subject: 41711: new dconf completion --- ChangeLog | 2 ++ Completion/Unix/Command/_dconf | 71 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 Completion/Unix/Command/_dconf (limited to 'Completion/Unix') diff --git a/ChangeLog b/ChangeLog index 2c36b9461..9805dc82d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2017-09-15 Oliver Kiddle + * 41711: Completion/Unix/Command/_dconf: new dconf completion + * 41710: Completion/Unix/Command/_smartmontools: new smartctl completion diff --git a/Completion/Unix/Command/_dconf b/Completion/Unix/Command/_dconf new file mode 100644 index 000000000..bfb314c72 --- /dev/null +++ b/Completion/Unix/Command/_dconf @@ -0,0 +1,71 @@ +#compdef dconf + +local curcontext="$curcontext" state line cmds ret=1 +local cmd=$words[1] + +cmds=( + 'help:display help information' + 'read:read the value of a key' + 'list:list the contents of a directory' + 'write:change the value of a key' + 'reset:reset the value of a key or directory' + 'compile:compile a binary database from keyfiles' + 'update:update the system databases' + 'watch:watch a path for changes' + 'dump:dump an entire subpath to stdout' + 'load:populate a subpath from stdin' +) + +if (( CURRENT == 2 )); then + _describe -t commands command cmds + return +fi + +curcontext="${curcontext%:*}-$words[2]:" +shift words +(( CURRENT-- )) + +case $words[1] in + dump|list|load) state=dirs ;; + watch) state=keys ;; + read) + _arguments -A "-*" '-d[read default values]' '1:key:->keys' && ret=0 + ;; + write) + _arguments '1:key:->keys' '2:value' && ret=0 + ;; + reset) + _arguments -A "-*" '-f[reset entire directory]' '1:key:->keys' && ret=0 + [[ $+opt_args[-f] = 1 && state = keys ]] && state=dirs + ;; + compile) + _arguments '1:file:_files' '2:path:_directories' && ret=0 + ;; + help) + _describe -t commands command cmds && ret=0 + ;; + *) _default && ret=0 ;; +esac + +case $state in + keys) + compset -P '*/' + dirs=( ${${${(f)"$(_call_program keys dconf _complete \'\' "${IPREFIX:-/}")"}#$IPREFIX}%% #} ) + _tags keys + while _tags; do + if _requested keys; then + _description keys expl keu + compadd "$expl[@]" -qS ' ' ${dirs:#*/} && ret=0 + compadd "$expl[@]" -S '' ${(M)dirs:#*/} && ret=0 + fi + (( ret )) || break + done + ;; + dirs) + compset -P '*/' + _wanted keys expl directory compadd -S '' - \ + ${${(f)"$(_call_program keys dconf _complete / "${IPREFIX:-/}")"}#$IPREFIX} && ret=0 + ;; +esac + +return ret -- cgit v1.2.3 From b138acf42e52dcdf470f5001aa7ffa1e70eb60f3 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Mon, 18 Sep 2017 15:53:29 +0200 Subject: 41725: assorted minor updates to completion functions --- ChangeLog | 11 ++++++++ Completion/BSD/Command/_sysrc | 10 ++++--- Completion/Linux/Command/_mii-tool | 7 ++--- Completion/Redhat/Command/_scl | 2 +- Completion/Unix/Command/_dhclient | 1 + Completion/Unix/Command/_env | 3 ++- Completion/Unix/Command/_getfacl | 22 ++++++++-------- Completion/Unix/Command/_gpg | 54 ++++++++++++++++++++++---------------- Completion/Unix/Command/_ls | 1 + Completion/Unix/Command/_screen | 12 +++++---- Completion/Unix/Command/_setfacl | 4 +-- Completion/Unix/Command/_strip | 1 + Completion/Unix/Command/_truss | 3 +++ Completion/Unix/Command/_vim | 4 +-- Completion/Unix/Command/_wget | 29 +++++++++++++++----- 15 files changed, 107 insertions(+), 57 deletions(-) (limited to 'Completion/Unix') diff --git a/ChangeLog b/ChangeLog index 3e0f957ab..50ba33b1c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,16 @@ 2017-09-18 Oliver Kiddle + * 41725: Completion/BSD/Command/_sysrc, + Completion/Linux/Command/_mii-tool, + Completion/Redhat/Command/_scl, Completion/Unix/Command/_env, + Completion/Unix/Command/_dhclient, + Completion/Unix/Command/_getfacl, Completion/Unix/Command/_gpg, + Completion/Unix/Command/_ls, Completion/Unix/Command/_screen, + Completion/Unix/Command/_setfacl, + Completion/Unix/Command/_strip, Completion/Unix/Command/_truss, + Completion/Unix/Command/_vim, Completion/Unix/Command/_wget: + assorted minor updates to completion functions + * 41724: Completion/Linux/Command/_ethtool: update completion for new options diff --git a/Completion/BSD/Command/_sysrc b/Completion/BSD/Command/_sysrc index 246d73bd3..f0c12a2be 100644 --- a/Completion/BSD/Command/_sysrc +++ b/Completion/BSD/Command/_sysrc @@ -44,9 +44,13 @@ _sysrc() { local k v opt if (( $+opt_args[lista--L] )); then _services && ret=0 - elif [[ -prefix *=* ]]; then - # do you really want to go down this hole? - _message -e values value + elif compset -P 1 '*='; then + case $IPREFIX in + *_enable=) _wanted values expl value compadd YES NO && ret=0 ;; + *_program=) _files -g "*(-*)" && ret=0 ;; + *_interface(|s)=) _net_interfaces && ret=0 ;; + *) _message -e values value ;; + esac else if zstyle -T ":completion:${curcontext%:*}:values" verbose; then opt=d diff --git a/Completion/Linux/Command/_mii-tool b/Completion/Linux/Command/_mii-tool index 8da6da69d..72c47a479 100644 --- a/Completion/Linux/Command/_mii-tool +++ b/Completion/Linux/Command/_mii-tool @@ -1,12 +1,13 @@ #compdef mii-tool -_arguments -s \ - '(-V --version)'{-V,--version}'[display version information]' \ +_arguments -s -S \ + '(- *)'{-V,--version}'[display version information]' \ '(-v --verbose)'{-v,--verbose}'[verbose output]' \ '(-R --reset)'{-R,--reset}'[reset MII to poweron state]' \ '(-r --restart)'{-r,--restart}'[restart autonegotiation]' \ '(-w --watch)'{-w,--watch}'[monitor for link status changes]' \ '(-l --log)'{-l,--log}'[write events to syslog]' \ - '(-A --advertise)'{-A,--advertise=}'[advertise only specified media]:medium:_values -s , medium 100baseT4 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD 100baseTx 10baseT' \ + '(-A --advertise)'{-A,--advertise=}'[advertise only specified media]:medium:_values -s , medium 1000baseTx-HD 1000baseTx-FD 100baseT4 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD 1000baseTx 100baseTx 10baseT' \ '(-F --force)'{-F,--force=}'[force specified medium]:medium:(100baseT4 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD 100baseTx 10baseT)' \ + '(-p --phy)'{-p,--phy=}'[set PHY (MII address) to report]:MII address' \ '*:interface:_net_interfaces' diff --git a/Completion/Redhat/Command/_scl b/Completion/Redhat/Command/_scl index b7bba2b13..b9eaff11a 100644 --- a/Completion/Redhat/Command/_scl +++ b/Completion/Redhat/Command/_scl @@ -8,7 +8,7 @@ local -a state line force alts cmd _arguments -C $force \ '(- 1)'{-l,--list}'[list installed software collections or packages within a collection]' \ - '(-l --list)1:action:(enable run load unload list-collections list-packages man register deregister)' \ + '(-l --list)1:action:(enable run load unload list-collections list-enabled list-packages man register deregister)' \ '(- *)--help' \ '(-)*:collections:->collections' && ret=0 diff --git a/Completion/Unix/Command/_dhclient b/Completion/Unix/Command/_dhclient index 10cb551e0..a9f06d81f 100644 --- a/Completion/Unix/Command/_dhclient +++ b/Completion/Unix/Command/_dhclient @@ -60,6 +60,7 @@ case $OSTYPE in '-V[specify vendor-class-identifier option]:option' '--request-options[specify list of options the client is to request from the server]:options' '--timeout[specify time after which dhclient will decide that no DHCP servers can be contacted]:timeout' + '--dad-wait-time[specify maximum time to wait for duplicate address detection]:time (seconds)' ) ;; esac diff --git a/Completion/Unix/Command/_env b/Completion/Unix/Command/_env index 9b2a1e011..214c61e54 100644 --- a/Completion/Unix/Command/_env +++ b/Completion/Unix/Command/_env @@ -7,7 +7,8 @@ case $variant in gnu) args=( '(-)'{-i,--ignore-environment}'[start with empty environment]' - '(--ignore-environment -i --help --version)*'{-u,--unset=}'[remove variable from the environment]:env var to remove:_parameters -g "*export*"' + '(--ignore-environment -i --help --version)*'{-u+,--unset=}'[remove variable from the environment]:env var to remove:_parameters -g "*export*"' + '(-C --chdir)'{-C+,--chdir=}'[change working directory]:directory:_directories' '(- *)--help[display help information]' '(- *)--version[display version information]' ) diff --git a/Completion/Unix/Command/_getfacl b/Completion/Unix/Command/_getfacl index b6f1d0932..15be06a1c 100644 --- a/Completion/Unix/Command/_getfacl +++ b/Completion/Unix/Command/_getfacl @@ -11,19 +11,19 @@ _arguments -s -S \ '*: :_files' else _arguments -s -S \ - '--access[display the file access control list only]' \ + '(-a --access)'{-a,--access}'[display the file access control list only]' \ '(-d --default)'{-d,--default}'[display the default access control list only]' \ - '--omit-header[do not display the comment header]' \ - '--all-effective[print all effective rights]' \ - '--no-effective[print no effective rights]' \ - '--skip-base[skip files that only have the base entries]' \ + '(-c --omit-header)'{-c,--omit-header}"[don't display the comment header]" \ + '(-e --all-effective)'{-e,--all-effective}'[print all effective rights]' \ + '(-E --no-effective)'{-E,--no-effective}'[print no effective rights]' \ + '(-s --skip-base)'{-s,--skip-base}'[skip files that only have the base entries]' \ '(-R --recursive)'{-R,--recursive}'[recurse into subdirectories]' \ '(-L --logical)'{-L,--logical}'[logical walk, follow symbolic links]' \ - '(-P --physical)'{-P,--physical}'[physical walk, do not follow symbolic links]' \ - '--tabular[use tabular output format]' \ - '--numeric[print numeric user/group identifiers]' \ - '--absolute-names[don'"'"'t strip leading '"'"'/'"'"' in pathnames]' \ - '--version[print version and exit]' \ - '--help[this help text]' \ + '(-P --physical)'{-P,--physical}"[physical walk, don't follow symbolic links]" \ + '(-t --tabular)'{-t,--tabular}'[use tabular output format]' \ + '(-n --numeric)'{-n,--numeric}'[print numeric user/group identifiers]' \ + '(-p --absolute-names)'{-p,--absolute-names}"[don't strip leading '/' in pathnames]" \ + '(- *)'{-v,--version}'[display version information]' \ + '(- *)'{-h,--help}'[display help information]' \ '*: :_files' fi diff --git a/Completion/Unix/Command/_gpg b/Completion/Unix/Command/_gpg index d7a8ece4c..239a032a1 100644 --- a/Completion/Unix/Command/_gpg +++ b/Completion/Unix/Command/_gpg @@ -38,17 +38,17 @@ fi [[ $service = gpg ]] && args+=( '--decrypt-files[decrypt multiple files]' '(-b --detach-sign)'{-b,--detach-sign}'[make a detached signature]' - '--clearsign[make a clear text signature]' + --clear{,-}sign'[make a clear text signature]' '--store[store only]' '--verify[verify a signature]' '--verify-files[verify a list of files]' '(-f --encrypt-files)'{-f,--encrypt-files}'[encrypt files]' - '--list-keys[list all keys]' + '(-k --list-keys)'{-k,--list-keys}'[list all keys]' '--list-public-keys[list all public keys]' - '--list-secret-keys[list all secret keys]' - '--list-sigs[lists keys and signatures]:key attachment:->public-keys' - '--list-options[modify what the various --list-* commands show]' - '--check-sigs[list key, signatures and check them]:key attachment:->public-keys' + '(-K --list-secret-keys)'{-K,--list-secret-keys}'[list all secret keys]' + --list-sig{,nature}s'[lists keys and signatures]:key attachment:->public-keys' + '--list-options[modify what the various --list-* commands show]: :->option-list' + --check-sig{,nature}s'[list key, signatures and check them]:key attachment:->public-keys' '--fingerprint[list all keys with their fingerprints]:key attachment:->public-keys' '--list-packets[list only the sequence of packets]' '--gen-key[generate a new pair key]' @@ -60,6 +60,7 @@ fi '--delete-secret-and-public-keys:key attachment:->secret-keys' '--gen-revoke[generate a revocation certificate]' '--desig-revoke[generate a designated revocation certificate]' + '--passwd[change a passphrase]' '--export[export all keys from all keyrings]' '--send-keys[send keys to a keyserver]:key attachment:->public-keyids' '--export-secret-keys:key attachment:->secret-keys' @@ -67,7 +68,7 @@ fi '--import[import a gpg key from a file]:attachment (file):_files' '--fast-import[import a file without adding to trustdb]:attachment (file):_files' '--fetch-keys[fetch key at URIs]:uri:' - '--recv-keys[receive a list of keys from a keyserver]:key attachment:->public-keyids' + --rec{eive,v}-keys'[receive a list of keys from a keyserver]:key attachment:->public-keyids' '--refresh-keys[update all keys from a keyserver]' '--search-keys[search for keys on a key server]' '--update-trustdb[update the trust database]' @@ -79,7 +80,11 @@ fi '--enarmor[en-Armor a file or stdin]' '--print-md[print message digests]:algorithm:->ciphers::file:_files' '--print-mds[print message digests]::file:_files' - '--gen-random:count' '--gen-prime' + '--tofu-policy:policy:(good unknown bad ask auto):*:keys:->public-keys' + '--tofu-default-policy:policy:(good unknown bad ask auto)' + '--quick-generate-key:user-id: :algorithm:(default future-default rsa dsa elg ed25519 cv25519): : _values -s , usage - default sign auth encr::expiration' + '--quick-add-key:fingerprint: :algorithm:(default future-default rsa dsa elg ed25519 cv25519): : _values -s , usage - default sign auth encr::expiration' + '--gen-random:quality level:(0 1 2):count (bytes)' '--gen-prime' '--warranty[print warranty info]' '(-a --armor)'{-a,--armor}'[create ASCII armored output]' '--default-key[specify default user ID for signatures]:key:->secret-keys' @@ -126,11 +131,11 @@ fi '--s2k-mode:value' '--compress-algo:compression algorithm:((0\:disable\ compression 1\:zlib 2\:rfc1950))' '--personal-'{cipher,digest,compress}'-preferences:string' - '--card-edit[present smartcard menu]' '--card-status[show smartcard content]' + --{card-edit,edit-card}'[present smartcard menu]' '--card-status[show smartcard content]' '--change-pin[present menu to change smartcard pin]' '--list-config[display internal configuration parameters]' '--hidden-recipient[hidden recipient]:recipient:->public-keys' - '--dump-options[show all options]' '--default-preference-list:string' + '--default-preference-list:string' '--fetch-keys:URIs' '--hidden-encrypt-to:recipient:->public-keys' '--compress-level:integer' @@ -139,17 +144,14 @@ fi '--max-output[maximum output generated when processing file]:bytes:' '--gpg-agent-info[override GPG_AGENT_INFO]:' '--primary-keyring:file:_files' - '--verify-options:parameters:_multi_parts -q -S, "," - "(show-photos show-policy-urls show-notations show-std-notations - show-user-notations show-keyserver-urls show-uid-validity show-unusable-uids - show-primary-uid-only pka-lookups pka-trust-increase)"' + '--verify-options: :->verify-options' '--debug:flags:' '--status-file:file:_files' '--attribute-file:file:_files' '--load-extension:file:_files' '--s2k-count:integer' '--sig-notation:name=value:' '--cert-notation:name=value:' '--passphrase-file:file:_files' '--passphrase-repeat:integer:' '--command-file:file:_files' '--trustdb-name:file:_files' - '--trust-model:trust model:((pgp classic direct always auto))' + '--trust-model:trust model:(pgp classic tofu tofu+pgp direct always auto)' '--sig-policy-url:string:' '--cert-policy-url:string:' '--sig-keyserver-url:string:' '--comment[comment]:comment:' '--no-comments[disable comments]' @@ -163,8 +165,8 @@ fi '--multifile[process multiple files]' '--keyid-format[key id format]:key format:((short 0xshort long 0xlong))' '--exit-on-status-write-error[exit immediately on error write]' - '--limit-card-insert-tries:integer:' - '--reader-port[card reader port]:port:' + '--limit-card-insert-tries:integer' + '--reader-port[card reader port]:port' '--ctapi-driver[file to use to access smartcard reader]:file:_files' '--pcsc-driver[file to use to access smartcard reader]:file:_files' '--auto-key-locate:parameters' @@ -176,7 +178,7 @@ extra=( ${allopts:|extra} ) _arguments -C -s -S -A "-*" $args $extra '*:args:->args' && ret=0 if [[ $state = args ]]; then - if (( ${+opt_args[--export]} || ${+opt_args[--list-keys]} || ${+opt_args[--list-public-keys]} )); then + if (( ${+opt_args[--export]} || ${+opt_args[-k]} || ${+opt_args[--list-keys]} || ${+opt_args[--list-public-keys]} )); then state=public-keys elif (( ${+opt_args[--list-secret-keys]} )); then state=secret-keys @@ -205,19 +207,27 @@ fi case "$state" in public-keys) _wanted public-keys expl 'public key' \ - compadd ${${(Mo)$(_call_program public-keys gpg $needed --list-public-keys --list-options no-show-photos 2>/dev/null):%<*>}//(<|>)/} && return + compadd ${${(Mo)$(_call_program public-keys $words[1] $needed --list-public-keys --list-options no-show-photos):%<*>}//(<|>)/} && return ;; secret-keys) _wanted secret-keys expl 'secret key' compadd \ - ${${(Mo)$(_call_program secret-keys gpg $needed --list-secret-keys --list-options no-show-photos 2>/dev/null):%<*>}//(<|>)/} && return + ${${(Mo)$(_call_program secret-keys $words[1] $needed --list-secret-keys --list-options no-show-photos):%<*>}//(<|>)/} && return ;; ciphers) _wanted ciphers expl cipher compadd \ - ${${(s.,.)${(M)${(f)"$(_call_program ciphers gpg $needed --version)"}:#Cipher*}#*:}# } && return + ${${(s.,.)${(M)${(f)${"$(_call_program ciphers $words[1] $needed --version)"}//,$'\n' #/, }:#Cipher*}#*:}# } && return ;; (public-keyids) _wanted public-keys expl 'public keyid' \ - compadd ${${${(M)${(f)"$(_call_program public-keyids gpg $needed --list-public-keys --list-options no-show-photos 2>/dev/null)"}:%pub*}#pub */}%% *} && return + compadd ${(M)${${(f)"$(_call_program public-keyids $words[1] $needed --list-public-keys --list-options no-show-photos)"}## #}:#[0-9A-F](#c40)} && return + ;; + (option-list) + _sequence _wanted options expl option \ + compadd - {no-,}show-{photos,usage,policy-urls,{std,user}-notations,keyserver-urls,uid-validity,unusable-{uids,subkeys},keyring,sig-{expire,subpackets}} && return + ;; + (verify-options) + _sequence _wanted options expl option \ + compadd - {no-,}show-{photos,policy-urls,{std,user}-notations,keyserver-urls,uid-validity,unusable-uids,primary-uid-only} {no-,}pka-{lookups,trust-increase} && return ;; esac diff --git a/Completion/Unix/Command/_ls b/Completion/Unix/Command/_ls index 955b0894d..d10c4f9bf 100644 --- a/Completion/Unix/Command/_ls +++ b/Completion/Unix/Command/_ls @@ -168,6 +168,7 @@ else '--color=-[control use of color]:color:(never always auto)' "*--hide=[like -I, but overridden by -a or -A]:pattern: " + '--hyperlink=[output terminal codes to link files using file::// URI]::when:(none auto always)' '(--classify -F --indicator-style -p --file-type)'{--classify,-F}'[append file type indicators]' '(--file-type -p --indicator-style -F --classify)--file-type[append file type indicators except *]' '(--file-type -p --indicator-style -F --classify)-p[append / to directories]' diff --git a/Completion/Unix/Command/_screen b/Completion/Unix/Command/_screen index ebc8ba155..862da7544 100644 --- a/Completion/Unix/Command/_screen +++ b/Completion/Unix/Command/_screen @@ -66,14 +66,16 @@ _arguments -C \ '-f-[set flow control]:flow control:((n\:flow\ control\ off a\:flow\ control\ auto \:flow\ control\ on))' \ '-h[set the size of the scrollback history buffer]:buffer size' \ '-i[interrupt output sooner when flow control is on]' \ - '(-l)-ln[login mode off (do not update utmp database)]' \ + "(-l)-ln[login mode off (don't update utmp database)]" \ '(-ln)-l[login mode on (update utmp database)]' \ - '(-)'{-ls,-list}'[list sessions/socket directory]' \ + '(- *)'{-ls,-list}'[list sessions/socket directory]: :->any-sessions' \ "-L[terminal's last character can be safely updated]" \ + '-Logfile[set logfile name]:log file:_files' \ '-m[ignore $STY variable, do create a new screen session]' \ '-O[choose optimal output rather than exact vt100 emulation]' \ '-p[preselect the named window]:window number or name:((\=\:windowlist -\:blank\ window \:window\ number))' \ '-q[quiet startup, exit with non-zero return code if unsuccessful]' \ + '-Q[send response to stdout of command qwery process]:screen command:(echo info lastmsg number select time title windows)' \ '-r[reattach to a detached screen process]: :->detached-sessions' \ '-Dr: :->any-sessions' \ '-dr: :->any-sessions' \ @@ -85,12 +87,12 @@ _arguments -C \ "-t[set title (window's name)]:title" \ '-T[use term as $TERM for windows, rather than "screen"]:terminal type:_terminals' \ '-U[tell screen to use UTF-8 encoding]' \ - '(-)-v[print screen version]' \ - '(-)-wipe[do nothing, clean up SockDir]' \ + '(- *)-v[print screen version]' \ + '(- *)-wipe[do nothing, clean up SockDir]: :->any-sessions' \ '-x[attach to a not detached screen (multi display mode)]: :->attached-sessions' \ '-Dx: :->any-sessions' \ '-dx: :->any-sessions' \ - '-X[execute command as a screen command in the specified session]:screencmd:(${scr_cmds[@]})' \ + '-X[execute command as a screen command in the specified session]:screen command:(${scr_cmds[@]})' \ '*:: :->normal' && ret=0 if [[ -n $state ]]; then diff --git a/Completion/Unix/Command/_setfacl b/Completion/Unix/Command/_setfacl index af6c4d4e5..5c573a581 100644 --- a/Completion/Unix/Command/_setfacl +++ b/Completion/Unix/Command/_setfacl @@ -29,7 +29,7 @@ _arguments -s -S \ '(-P --physical)'{-P,--physical}'[physical walk, do not follow symbolic links]' \ '--restore=[restore ACLs]:file:_files' \ '--test[test mode (ACLs are not modified)]' \ - '--version[print version and exit]' \ - '--help[this help text]' \ + '(- *)'{-v,--version}'[display version information]' \ + '(- *)'{-h,--help}'[display help information]' \ '*: :_files' fi diff --git a/Completion/Unix/Command/_strip b/Completion/Unix/Command/_strip index f244b0ace..0703c50e4 100644 --- a/Completion/Unix/Command/_strip +++ b/Completion/Unix/Command/_strip @@ -25,6 +25,7 @@ if _pick_variant gnu=GNU solaris --version; then '(-s --strip-all)'{-s,--strip-all}'[remove all symbols]' '(-g -S -d --strip-debug)'{-g,-S,-d,--strip-debug}'[remove debugging symbols]' '--strip-unneeded[remove symbols not needed for relocation processing]' + "--no-merge-notes[don't attempt to remove redundant notes]" '*'{-K+,--keep-symbol=}'[keep given symbol]:symbol name' '*'{-N+,--strip-symbol=}'[strip given symbol]:symbol name' '(*)-o+[output file]:output file:_files' diff --git a/Completion/Unix/Command/_truss b/Completion/Unix/Command/_truss index 656c94244..d56839e02 100644 --- a/Completion/Unix/Command/_truss +++ b/Completion/Unix/Command/_truss @@ -15,6 +15,9 @@ args=( ) case $OSTYPE in + solaris2.<11->) + args+=( '(-c)-A[include absolute timestamps in output]' ) + ;| aix*|solaris*) args+=( '(-c)-E[include delta timestamps of time spent within the system call]' diff --git a/Completion/Unix/Command/_vim b/Completion/Unix/Command/_vim index 9fd2d63e8..f10d54ade 100644 --- a/Completion/Unix/Command/_vim +++ b/Completion/Unix/Command/_vim @@ -1,4 +1,4 @@ -#compdef vim gvim gex gview nvim rvim rview rgvim rgview evim eview vimdiff gvimdiff +#compdef vim gvim gex gview nvim rvim rview rgvim rgview evim eview vimdiff gvimdiff mvim (( $+functions[_vim_files] )) || _vim_files () { @@ -99,7 +99,7 @@ if [[ "$state" = server ]]; then elif [[ $state = verbosity ]]; then _tags numbers files while _tags; do - _requested numbers && _describe 'verbosity [10]' "( + _requested numbers && _describe -V 'verbosity [10]' "( 0:don\'t' display any messages' 1:'display when viminfo file is read or written' 2:'display sourced files' diff --git a/Completion/Unix/Command/_wget b/Completion/Unix/Command/_wget index 8a9cc871a..2a7390fba 100644 --- a/Completion/Unix/Command/_wget +++ b/Completion/Unix/Command/_wget @@ -1,6 +1,6 @@ #compdef wget -local curcontext="$curcontext" state line +local curcontext="$curcontext" state line expl typeset -A opt_args _arguments -C -s \ @@ -19,12 +19,15 @@ _arguments -C -s \ '(--force-html -F)'{--force-html,-F}'[treat input file as html]' \ '(--base -B)'{--base=,-B+}'[prepend URL to relative links]:base URL:_urls' \ '--config=[specify config file]:config file:_files' \ + '(--config)--no-config' '--rejected-log=:file:_files' \ '(--tries -t)'{--tries=,-t+}'[set number of retries]:number of retries' \ '--retry-connrefused[retry even if connection is refused]' \ '(--output-document -O)'{--output-document=,-O+}'[specify file to write documents to]:output file:_files' \ '(--continue -c)'{--continue,-c}'[continue getting an existing file]' \ + '--start-pos=:offset' '--show-progress' \ '--progress=[set progress gauge type]:gauge type:->gauge' \ '(--timestamping -N)'{--timestamping,-N}'[retrieve only files newer than existing]' \ + '--no-if-modified-since' \ "--no-use-server-timestamps[don't set the local file's timestamp by the one on the server]" \ '(--server-response -S)'{--server-response,-S}'[print server response]' \ "--spider[don't download anything]" \ @@ -49,11 +52,15 @@ _arguments -C -s \ '(--http-user --ftp-user)--user[set both ftp and http user]:user' \ '(--http-password --ftp-password)--password[set both ftp and http password]:password' \ '(--password --http-password --ftp-password)--ask-password:[prompt for passwords]' \ + '--use-askpass=:command:_command_names -e' \ '--no-iri[turn off IRI support]' \ '--local-encoding=[specify local encoding for IRIs]:encoding' \ '--remote-encoding=[specify default remote encoding]:encoding' \ '--unlink[remove file before clobber]' \ + '--no-xattr[turn off storage of metadata in extended file attributes]' \ + '(-nd --no-directories)'{-nd,--no-directories}"[don't create directories]" \ '(--force-directories -x)'{--force-directories,-x}'[force creation of directories]' \ + '(-nH --no-host-directories)'{-nH,--no-host-directories}"[don't create host directories]" \ '--protocol-directories[use protocol name in directories]' \ '(--directory-prefix -P)'{--directory-prefix=,-P+}'[specify prefix to save files to]:prefix:_files -/' \ '--cut-dirs=:number:' \ @@ -92,15 +99,20 @@ _arguments -C -s \ '--private-key-type=[specify private key type]:key type:key type:(PEM DER)' \ "--ca-certificate=[specify file with bundle of CA's]:file:_files" \ "--ca-directory=[specify dir where hash list of CA's are stored]:directory:_directories" \ + '--crl-file=[specify file with bundle of CRLs]:file:_files' \ + '--pinnedpubkey=:file:_files' \ '--random-file[specify file with random data for seeding generator]:file:_files' \ '--egd-file=[specify filename of EGD socket]:file:_files' \ + '--no-hsts[disable HSTS]' \ + '--hsts-file[specify path of HSTS database]:file:_files' \ '(--user)--ftp-user=:user' \ '(--password --ask-password)--ftp-password=:password' \ "--no-remove-listing[don't remove \`.listing' files]" \ '--no-glob[turn off FTP file name globbing]' \ '--no-passive-ftp' \ '--preserve-permissions[preserve remote file permissions with ftp]' \ - '--retr-symlinks' \ + --retr-symlinks --ftps-implicit --ftps-resume-ssl \ + --ftps-clear-data-connection --ftps-fallback-to-ftp \ '--warc-file=:file:_files' --warc-header=:string --warc-max-size=:number \ --warc-cdx --warc-dedup=:file:_files --no-warc-compression --no-warc-digests \ --no-warc-keep-log --warc-tempdir=:directory:_directories \ @@ -108,6 +120,7 @@ _arguments -C -s \ '(--level -l)'{--level=,-l+}'[specify maximum recursion depth]:level' \ '--delete-after' \ '(--convert-links -k)'{--convert-links,-k}'[convert links to be relative]' \ + --convert-file-only \ '--backups=:max backups' \ '(--backup-converted -K)'{--backup-converted,-K}'[backup files before conversion]' \ '(--mirror -m -r -N -l)'{--mirror,-m}'[mirror (-r -N -l inf --no-remove-listing)]' \ @@ -129,8 +142,6 @@ _arguments -C -s \ '(-np --no-parent)'{-np,--no-parent}"[don't ascend to parent directory]" \ '--no-verbose' \ '--no-clobber' \ - '--no-directories' \ - '--no-host-directories' \ '--no-use-server-timestamps[do not set timestamp to server provided value]' \ '--htmlify=:htmlify:' \ '--no:no:->noflags' \ @@ -154,10 +165,15 @@ case "$state" in _values -s , 'filename char restriction' \ '(windows)unix' \ '(unix)windows' \ - '(unix windows)nocontrol' + '(unix windows)nocontrol' \ + ascii \ + '(uppercase)lowercase' \ + '(lowercase)uppercase' ;; header) local -a headers + local suf=': ' + compquote suf headers=( Accept{,-{Charset,Encoding,Language,Datetime}} Authorization @@ -191,7 +207,6 @@ case "$state" in X-ATT-DeviceId X-Wap-Profile ) - headers=($^headers\\:\ ) - _describe -t header 'HTTP header' headers + _wanted headers expl 'HTTP header' compadd -S $suf -a headers ;; esac -- cgit v1.2.3 From 256201eecdd0770f295f7cea804a0fb0881affea Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Mon, 18 Sep 2017 22:33:37 +0200 Subject: 41727: run tidy -xml-config to get HTML options for completion --- ChangeLog | 5 ++ Completion/Unix/Command/_tidy | 134 +++++++++++------------------------------- 2 files changed, 38 insertions(+), 101 deletions(-) (limited to 'Completion/Unix') diff --git a/ChangeLog b/ChangeLog index d0a03ee80..3d0483c6c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2017-09-18 Oliver Kiddle + + * 41727: Completion/Unix/Command/_tidy: run tidy -xml-config + to get HTML options for completion + 2017-09-18 Barton E. Schaefer * 41723: Src/loop.c: one more case of 41627 in "while" loops. diff --git a/Completion/Unix/Command/_tidy b/Completion/Unix/Command/_tidy index ec2d74238..a4dccd5f5 100644 --- a/Completion/Unix/Command/_tidy +++ b/Completion/Unix/Command/_tidy @@ -1,43 +1,31 @@ #compdef tidy -# HTML Tidy for Linux/x86 released on 1st March 2003 +local -a opts -local -a access autobool boolean doctype encoding +opts=( ${${${(s..)"$(_call_program options $words[1] -xml-config)"}##*}/<\/name>*/;} ) +opts=( ${opts/;Integer*/:number} ) +opts=( ${opts/;Boolean*/:boolean:(yes no)} ) +opts=( ${opts/;AutoBool*/:value:(auto yes no)} ) +opts=( ${opts/;(String|Tag)*/:value} ) +opts=( ${opts/(#b);(enum|Encoding|DocType)*(*)<*([^<]#)<*/:value [${match[2]%% *}]:(${(j. .)${(@s., .)match[3]}%% *})} ) +opts=( ${(M)opts:#*:*} ) -access=( 1 2 3 ) -boolean=( yes no ) -autobool=( auto $boolean ) -doctype=( auto omit strict loose transitional ) -encoding=( ascii latin1 raw utf8 iso2022 mac utf16le utf16be utf16 win1252 ibm858 big5 shiftjis ) - -_arguments \ +_arguments -s -A "-*" --$^opts \ '(-indent -i)'{-indent,-i}'[indent element content]' \ '-wrap[wrap text at the specified (default is 68)]:column:' \ '(-upper -u)'{-upper,-u}'[force tags to upper case (default is lower case)]' \ '(-clean -c)'{-clean,-c}'[replace FONT, NOBR and CENTER tags by CSS]' \ '(-bare -b)'{-bare,-b}'[strip out smart quotes and em dashes, etc.]' \ + '(-gdoc -g)'{-gdoc,-g}'[produce clean version of html exported by Google Docs]' \ '(-numeric -n)'{-numeric,-n}'[output numeric rather than named entities]' \ '(-errors -e)'{-errors,-e}'[only show errors]' \ '(-quiet -q)'{-quiet,-q}'[suppress nonessential output]' \ - '-omit[omit optional end tags]' \ + '-omit[omit optional start and end tags]' \ '-xml[specify the input is well formed XML]' \ '(-asxml -asxhtml -ashtml)'{-asxml,-asxhtml}'[convert HTML to well formed XHTML]' \ '(-asxml -asxhtml)-ashtml[force XHTML to well formed HTML]' \ '-access[do additional accessibility checks ( = 1, 2, 3)]:priority level:(${access[@]})' \ '-raw[output values above 127 without conversion to entities]' \ - '( -latin0 -latin1 -iso2022 -utf8 -mac -win1252 -ibm858 -utf16le -utf16be -utf16 -shiftjis -big5)-ascii[use US-ASCII for output, ISO-8859-1 for input]' \ - '(-ascii -latin1 -iso2022 -utf8 -mac -win1252 -ibm858 -utf16le -utf16be -utf16 -shiftjis -big5)-latin0[use US-ASCII for output, ISO-8859-1 for input]' \ - '(-ascii -latin0 -iso2022 -utf8 -mac -win1252 -ibm858 -utf16le -utf16be -utf16 -shiftjis -big5)-latin1[use ISO-8859-1 for both input and output]' \ - '(-ascii -latin0 -latin1 -utf8 -mac -win1252 -ibm858 -utf16le -utf16be -utf16 -shiftjis -big5)-iso2022[use ISO-2022 for both input and output]' \ - '(-ascii -latin0 -latin1 -iso2022 -mac -win1252 -ibm858 -utf16le -utf16be -utf16 -shiftjis -big5)-utf8[use UTF-8 for both input and output]' \ - '(-ascii -latin0 -latin1 -iso2022 -utf8 -win1252 -ibm858 -utf16le -utf16be -utf16 -shiftjis -big5)-mac[use MacRoman for input, US-ASCII for output]' \ - '(-ascii -latin0 -latin1 -iso2022 -utf8 -mac -ibm858 -utf16le -utf16be -utf16 -shiftjis -big5)-win1252[use Windows-1252 for input, US-ASCII for output]' \ - '(-ascii -latin0 -latin1 -iso2022 -utf8 -mac -win1252 -utf16le -utf16be -utf16 -shiftjis -big5)-ibm858[use IBM-858 (CP850+Euro) for input, US-ASCII for output]' \ - '(-ascii -latin0 -latin1 -iso2022 -utf8 -mac -win1252 -ibm858 -utf16be -utf16 -shiftjis -big5)-utf16le[use UTF-16LE for both input and output]' \ - '(-ascii -latin0 -latin1 -iso2022 -utf8 -mac -win1252 -ibm858 -utf16le -utf16 -shiftjis -big5)-utf16be[use UTF-16BE for both input and output]' \ - '(-ascii -latin0 -latin1 -iso2022 -utf8 -mac -win1252 -ibm858 -utf16le -utf16be -shiftjis -big5)-utf16[use UTF-16 for both input and output]' \ - '(-ascii -latin0 -latin1 -iso2022 -utf8 -mac -win1252 -ibm858 -utf16le -utf16be -utf16 -big5)-shiftjis[use Shift_JIS for both input and output]' \ - '(-ascii -latin0 -latin1 -iso2022 -utf8 -mac -win1252 -ibm858 -utf16le -utf16be -utf16 -shiftjis )-big5[use Big5 for both input and output]' \ '(-out -o)'{-out,-o}'[specify the output markup file]:output file:_files' \ '-config[set configuration options from the specified ]:configuration file:_files' \ '-f[write errors to the specified ]:error file:_files' \ @@ -46,81 +34,25 @@ _arguments \ '(- *)'{-help,-h,-\?}'[list the command line options]' \ '(- *)-help-config[list all configuration options]' \ '(- *)-show-config[list the current configuration settings]' \ - '--indent-spaces:number of spaces:' \ - '--wrap:column:' \ - '--wrap-attributes:boolean:(${boolean[@]})' \ - '--wrap-script-literals:boolean:(${boolean[@]})' \ - '--wrap-sections:boolean:(${boolean[@]})' \ - '--wrap-asp:boolean:(${boolean[@]})' \ - '--wrap-jste:boolean:(${boolean[@]})' \ - '--wrap-php:boolean:(${boolean[@]})' \ - '--literal-attributes:boolean:(${boolean[@]})' \ - '--tab-size:tab size:' \ - '--markup:boolean:(${boolean[@]})' \ - '--quiet:boolean:(${boolean[@]})' \ - '--tidy-mark:boolean:(${boolean[@]})' \ - '--indent:boolean:(${autobool[@]})' \ - '--indent-attributes:boolean:(${boolean[@]})' \ - '--hide-endtags:boolean:(${boolean[@]})' \ - '--input-xml:boolean:(${boolean[@]})' \ - '--output-xml:boolean:(${boolean[@]})' \ - '--output-xhtml:boolean:(${boolean[@]})' \ - '--output-html:boolean:(${boolean[@]})' \ - '--add-xml-pi:boolean:(${boolean[@]})' \ - '--add-xml-decl:boolean:(${boolean[@]})' \ - '--assume-xml-procins:boolean:(${boolean[@]})' \ - '--raw:boolean:(${boolean[@]})' \ - '--uppercase-tags:boolean:(${boolean[@]})' \ - '--uppercase-attributes:boolean:(${boolean[@]})' \ - '--bare:boolean:(${boolean[@]})' \ - '--clean:boolean:(${boolean[@]})' \ - '--logical-emphasis:boolean:(${boolean[@]})' \ - '--word-2000:boolean:(${boolean[@]})' \ - '--drop-empty-paras:boolean:(${boolean[@]})' \ - '--drop-font-tags:boolean:(${boolean[@]})' \ - '--drop-proprietary-attribute:boolean:(${boolean[@]})' \ - '--enclose-text:boolean:(${boolean[@]})' \ - '--enclose-block-text:boolean:(${boolean[@]})' \ - '--alt-text:alternate text:' \ - '--add-xml-space:boolean:(${boolean[@]})' \ - '--fix-bad-comments:boolean:(${boolean[@]})' \ - '--split:boolean:(${boolean[@]})' \ - '--break-before-br:boolean:(${boolean[@]})' \ - '--numeric-entities:boolean:(${boolean[@]})' \ - '--quote-marks:boolean:(${boolean[@]})' \ - '--quote-nbsp:boolean:(${boolean[@]})' \ - '--quote-ampersand:boolean:(${boolean[@]})' \ - '--write-back:boolean:(${boolean[@]})' \ - '--keep-time:boolean:(${boolean[@]})' \ - '--show-warnings:boolean:(${boolean[@]})' \ - '--error-file:error file:_files' \ - '--output-file:output file:_files' \ - '--show-body-only:boolean:(${boolean[@]})' \ - '--slide-style:style sheet file:_files' \ - '--new-inline-tags:tag names:' \ - '--new-blocklevel-tags:tag names:' \ - '--new-empty-tags:tag names:' \ - '--new-pre-tags:tag names:' \ - '--char-encoding:encoding:(${encoding[@]})' \ - '--input-encoding:encoding:(${encoding[@]})' \ - '--output-encoding:encoding:(${encoding[@]})' \ - '--doctype:doctype:(${doctype[@]})' \ - '--fix-backslash:boolean:(${boolean[@]})' \ - '--gnu-emacs:boolean:(${boolean[@]})' \ - '--fix-uri:boolean:(${boolean[@]})' \ - '--lower-literals:boolean:(${boolean[@]})' \ - '--hide-comments:boolean:(${boolean[@]})' \ - '--indent-cdata:boolean:(${boolean[@]})' \ - '--force-output:boolean:(${boolean[@]})' \ - '--show-errors:maximum number of errors:' \ - '--ascii-chars:boolean:(${boolean[@]})' \ - '--join-classes:boolean:(${boolean[@]})' \ - '--join-styles:boolean:(${boolean[@]})' \ - '--escape-cdata:boolean:(${boolean[@]})' \ - '--repeated-attributes:value:(keep-first keep-last)' \ - '--output-bom:boolean:(${autobool[@]})' \ - '--replace-color:boolean:(${boolean[@]})' \ - '--css-prefix:CSS class name:' \ - '--accessibility-check:priority level:(${access[@]})' \ - '--newline:newline character:(LF CRLF CR)' \ - '*:file:_files' + "(*)-help-option[show a description of specified configuration option]:config option:(${(@j. .)opts%%:*})" \ + '(-lang -language)'{-lang,-language}'[set the two-letter language code]:language:_locales' \ + '-xml-help[list the command line options in XML format]' \ + '-xml-config[list all configuration options in XML format]' \ + "-xml-strings[output all of Tidy's strings in XML format]" \ + '-xml-error-strings[output error constants and strings in XML format]' \ + '-xml-options-strings[output option descriptions in XML format]' \ + '*:file:_files' \ + + '(encoding)' \ + '-ascii[use US-ASCII for output, ISO-8859-1 for input]' \ + '-latin0[use US-ASCII for output, ISO-8859-1 for input]' \ + '-latin1[use ISO-8859-1 for both input and output]' \ + '-iso2022[use ISO-2022 for both input and output]' \ + '-utf8[use UTF-8 for both input and output]' \ + '-mac[use MacRoman for input, US-ASCII for output]' \ + '-win1252[use Windows-1252 for input, US-ASCII for output]' \ + '-ibm858[use IBM-858 (CP850+Euro) for input, US-ASCII for output]' \ + '-utf16le[use UTF-16LE for both input and output]' \ + '-utf16be[use UTF-16BE for both input and output]' \ + '-utf16[use UTF-16 for both input and output]' \ + '-shiftjis[use Shift_JIS for both input and output]' \ + '-big5[use Big5 for both input and output]' -- cgit v1.2.3 From 1051d48bf5fe519511261f46ae28923fb86a4c54 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Mon, 18 Sep 2017 22:38:18 +0200 Subject: 41728: new completion for flac and update options in metaflac completion --- ChangeLog | 3 + Completion/Unix/Command/_flac | 120 ++++++++++++++++++++++++++++++++++++++ Completion/Unix/Command/_metaflac | 54 ----------------- 3 files changed, 123 insertions(+), 54 deletions(-) create mode 100644 Completion/Unix/Command/_flac delete mode 100644 Completion/Unix/Command/_metaflac (limited to 'Completion/Unix') diff --git a/ChangeLog b/ChangeLog index 3d0483c6c..808c96b48 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2017-09-18 Oliver Kiddle + * 41728: Completion/Unix/Command/_flac (was _metaflac): new + completion for flac and update options in metaflac completion + * 41727: Completion/Unix/Command/_tidy: run tidy -xml-config to get HTML options for completion diff --git a/Completion/Unix/Command/_flac b/Completion/Unix/Command/_flac new file mode 100644 index 000000000..82b6f0160 --- /dev/null +++ b/Completion/Unix/Command/_flac @@ -0,0 +1,120 @@ +#compdef flac metaflac + +local shortops common shared blocktypes level + +shortops=( + --show-md5sum + --show-min-blocksize + --show-max-blocksize + --show-min-framesize + --show-max-framesize + --show-sample-rate + --show-channels + --show-bps + --show-total-samples + --show-vendor-tag + '--show-tag=:FLAC tag' + '--remove-tag=:FLAC tag' + '--remove-first-tag=:FLAC tag' + --remove-all-tags + '*--set-tag=:FLAC tag and value: ' + '*--set-tag-from-file=:tag' + '--import-tags-from=:flat file:_files' + '--export-tags-to=:new file: ' + '--import-cuesheet-from=:file:_files' + '--export-cuesheet-to=:new file:_files' + '--import-picture-from=:file or specification:_files' + '--export-picture-to=:file:_files' + --scan-replay-gain + --remove-replay-gain + --add-replay-gain + '*--add-seekpoint=:seek point' + '--add-padding=:length (bytes)' +) + +blocktypes=( STREAMINFO PADDING APPLICATION SEEKTABLE VORBIS_COMMENT PICTURE ) +common=( + '--block-number=:block number' + '(--except-block-type)--block-type=:block type:_sequence compadd - $blocktypes' + '(--block-type)--except-block-type=:block type:_sequence compadd - $blocktypes' +) +shared=( + '--no-utf8-convert' + '--preserve-modtime' +) +level=( -{,-compression-level-}{0,1,2,3,4,5,6,7,8} --best --fast ) + +case $service in + flac) + _arguments -s -S $shared \ + '(H -c --stdout)'{-c,--stdout}'[write output to stdout]' \ + '(H -s --silent --totally-silent)'{-s,--silent}"[don't output runtime statistics]" \ + '(H)--totally-silent' \ + '(H -w --warnings-as-errors)'{-w,--warnings-as-errors}'[treat all warnings as errors]' \ + '(H -f --force)'{-f,--force}'[overwrite output files]' \ + '(H -o --output-name -c --stdout)'{-o,--output-name=}'[specify output file name]' \ + '(H)--output-prefix=[prepend specified string to output file names]' \ + '(H)--delete-input-file' \ + '(H)--keep-foreign-metadata' \ + '(H)--skip=[skip initial samples from each input]:skip (mm:ss.ss)' \ + '(H)--until=[stop at specified sample for each input]:stop (+-mm:ss.ss)' \ + '(H)--ogg[use ogg as a transport layer]' \ + '(H)--serial-number=[serial number to use for the FLAC stream]:serial number' \ + '(H --force-aiff-format --force-rf64-format --force-wave64-format)--format-raw-format' \ + '*:file:_files -F line -g "(#i)*.(${${opt_args[(i)decode-*]:+flac|oga}:-wav|aif|aiff|raw|rf64|w64})(-.)"' \ + - 'H' \ + '(-)'{-v,--version}'[display version information]' \ + '(-)'{-h,--help}'[display help information]' \ + '(-)'{-H,--explain}'[display detailed explanation of usage and options]' \ + - encode \ + '(-V --verify)'{-V,--verify}'[verify a correct encoding]' \ + --lax --ignore-chunk-sizes '!--sector-align' --replay-gain \ + '--cuesheet=:file:_files' \ + '--picture=:specification:' \ + \*{-T,--tag}'[add a FLAC tag]:field=value' \ + '--tag-from-file=:field=file' \ + \*{-S,--seekpoint=}':seek point' \ + '(-P --padding)'{-P,--padding=}'[add space for metadata]:length (bytes)' \ + "($level[*])"$^level \ + '(-b --blocksize)'{-b,--blocksize=}'[specify block size in samples]:size:(192 576 1152 2304 4608 256 512 1024 2048 4096 8192 16384)' \ + '(-m --mid-side -M --adaptive-mid-side)'{-m,--mid-side}'[try mid-side coding for each frame]' \ + '(-m --mid-side -M --adaptive-mid-side)'{-M,--adaptive-mid-side}'[adaptive mid-side coding for all frames]' \ + '(-e --exhaustive-model-search)'{-e,--exhaustive-model-search}'[do exhaustive model search]' \ + \*{-A,--apodization=}'[window audio data with given the function]:function:(bartlett bartlett_hann blackman blackman_harris_4term_92dbconnes flattop gauss hamming hann kaiser_bessel nuttall rectangle triangle tukey welch)' \ + '(-l --max-lpc-order)'{-l,--max-lpc-order=}'[specify max LPC order]:order' \ + '(-p --qlp-coeff-precision-search -q --qlp-coeff-precision)'{-p,--qlp-coeff-precision-search}'[exhaustively search LP coeff quantization]' \ + '(-p --qlp-coeff-precision-search -q --qlp-coeff-precision)'{-q,--qlp-coeff-precision=}'[specify precision]:precision (bits)' \ + '(-r --rice-partition-order)'{-r,--rice-partition-order=}'[set min/max residual partition order]:order' \ + '--endian=:byte order:(big little)' \ + '--channels=:channels' \ + '--bps=:bits per sample' \ + '--sample-rate=:sample rate (Hz)' \ + '--sign=:sign of samples [signed]:(signed unsigned)' \ + '--input-size=:size (bytes)' \ + - decode \ + '(-d --decode -t --test -a --analyze)'{-d,--decode}'[decode a FLAC encoded file]' \ + '(-d --decode -t --test -a --analyze --delete-input-file)'{-t,--test}'[test a FLAC encoded file]' \ + '(-d --decode -t --test -a --analyze --delete-input-file)'{-a,--analyze}'[analyze a FLAC encoded file]' \ + '(-d --decode -t --test)'{--residual-text,--residual-gnuplot} \ + '(-F --decode-through-errors)'{-F,--decode-through-errors}'[continue decoding through stream errors]' \ + '--apply-replaygain-which-is-not-lossless=:specification' \ + '--cue=[set the beginning and ending cuepoints to decode]:cue point' \ + '(--force-raw-format --force-rf64-format --force-wave64-format)--force-aiff-format' \ + '(--force-raw-format --force-aiff-format --force-wave64-format)--force-rf64-format' \ + '(--force-raw-format --force-aiff-format --force-rf64-format)--force-wave64-format' \ + ;; + metaflac) + _arguments -S $shared \ + '(--no-filename)--with-filename[prefix output with filename]' \ + '(--with-filename)--no-filename' \ + '--dont-use-padding[always rewrite the file]' \ + "*:FLAC file:_files -g \*.flac\(-.\)" \ + - 'short' $shortops \ + - 'list' $common --list \ + '--application-data-format=:format:(text hexdump)' \ + - 'remove' $common --remove \ + - '(ops)' \ + '(-)--help' '(-)--version' \ + --remove-all --merge-padding --sort-padding + ;; +esac diff --git a/Completion/Unix/Command/_metaflac b/Completion/Unix/Command/_metaflac deleted file mode 100644 index 65b9eb292..000000000 --- a/Completion/Unix/Command/_metaflac +++ /dev/null @@ -1,54 +0,0 @@ -#compdef metaflac - -local _metaflac_opts _metaflac_shorts _metaflac_opers - -_metaflac_opts=( - '--preserve-modtime' - '--with-filename[prefix output with filename]' - '--no-filename' - '--no-utf8-convert' - '--dont-use-padding[always rewrite the file]' -) -_metaflac_shorts=( - '--show-md5sum' - '--show-min-blocksize' - '--show-max-blocksize' - '--show-min-framesize' - '--show-max-framesize' - '--show-sample-rate' - '--show-channels' - '--show-bps' - '--show-total-samples' - '--show-vendor-tag' - '--show-tag=:FLAC tags' - '--remove-tag=:FLAC tags: ' - '--remove-first-tag=:FLAC tags: ' - '--remove-all-tags' - '--set-tag=:FLAC tag and value: ' - '--import-tags-from=:flat file:_files' - '--export-tags-to=:new file: ' - '--import-cuesheet-from=:file:_files' - '--export-cuesheet-to=:new file: ' - '--add-replay-gain' - '--add-seekpoint=:: ' - '--add-padding=length' - -) -_metaflac_opers=( - '--block-number=:: ' - '--block-type=:: ' - '--except-block-type=:: ' - '--application-data-format=:: ' - '--list' - '--remove' - '--remove-all' - '--merge-padding' - '--sort-padding' -) - -_arguments "$_metaflac_opts[@]" \ - "*:FLAC file:_files -g \*.flac\(-.\)" \ - - "shortcuts" \ - "$_metaflac_shorts[@]" \ - - "(operations)" \ - "$_metaflac_opers[@]" -- cgit v1.2.3 From fde84f9e0bcd5099912b28fd918c9676f5d21625 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Mon, 18 Sep 2017 22:41:13 +0200 Subject: 41729: update options for gnutls completion plus cleanup and rearrange the function --- ChangeLog | 3 + Completion/Unix/Command/_gnutls | 285 ++++++++++++++++++++++++---------------- 2 files changed, 173 insertions(+), 115 deletions(-) (limited to 'Completion/Unix') diff --git a/ChangeLog b/ChangeLog index 808c96b48..c1c2d7701 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2017-09-18 Oliver Kiddle + * 41729: Completion/Unix/Command/_gnutls: update options for + gnutls plus cleanup and rearrange the function + * 41728: Completion/Unix/Command/_flac (was _metaflac): new completion for flac and update options in metaflac completion diff --git a/Completion/Unix/Command/_gnutls b/Completion/Unix/Command/_gnutls index 169e38b38..0b307d9b7 100644 --- a/Completion/Unix/Command/_gnutls +++ b/Completion/Unix/Command/_gnutls @@ -1,126 +1,181 @@ -#compdef gnutls-cli gnutls-cli-debug certtool srptool +#compdef gnutls-cli gnutls-cli-debug gnutls-serv 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 +local -a args -_gnutls_cli_common_args=( - '(-d --debug)'{-d,--debug}':debug level' - '(-p --port)'{-p,--port}':port' - '(-h --help)'{-h,--help}'[help]' +args=( + '(- :)'{-h,--help}'[display help information]' + '(- :)--version=[display version information]:information:((v\:simple c\:copyright n\:full))' + '(- :)-v[display version information]' + '(- :)'{-\!,--more-help}'[display help information through a pager]' + '(-d --debug)'{-d,--debug}'[enable debugging]:debug level' + \*{-V,--verbose}'[more verbose output]' ) 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]' \ + gnutls-*) + args+=( + '(-p --port)'{-p,--port}'[specify port or service to connect to]:port:_ports' + ) + ;| + gnutls-cli*) + args+=( + '(--app-proto --starttls-proto)'{--app-proto,--starttls-proto}"=[specify application protocol to use to obtain the server's certificate]:protocol:(https ftp smtp imap ldap xmpp lmtp pop3 nntp sieve postgres)" ':hostname:_hosts' + ) + ;| + gnutls-cli|gnutls-serv) + args+=( + "--sni-hostname=[specify server's hostname for server name indication extension]:hostname" + "--noticket[don't accept session tickets]" + '(-u --udp)'{-u,--udp}'[use DTLS (datagram TLS) over UDP]' + '--mtu=[set MTU for datagram TLS]:mtu' + '--srtp-profiles=[offer SRTP profiles]:string' + '(-b --heartbeat)'{-b,--heartbeat}'[activate heartbeat support]' + '--x509fmtder[use DER format for certificates to read from]' + '--priority=[specify TLS algorithms and protocols to enable]:(NORMAL PFS SECURE128 SECURE192 SUITEB128 SUITEB192 LEGACY PERFORMANCE NONE)' + '--x509cafile=[specify certificate file to use]:file:_files' + '--x509crlfile=[specify CRL file to use]:file:_files' + '--pgpkeyfile=[specify PGP key file to use]:file:_files' + '--pgpkeyring=[specify PGP key ring file to use]:file:_files' + '--pgpcertfile=[specify PGP public key (certificate) file to use]:file:_files' + '--x509keyfile=[specify X.509 key file to use]:file:_files' + '--x509certfile=[specify X.509 certificate file to use]:file:_files' + '--pgpsubkey=[specify PGP subkey to use]:sub key' + '(-l --list -p --port)'{-l,--list}'[print list of the supported algorithms/modes]' + '--provider=[specify PKCS #11 provider library]:provider:_files' + ) + ;| - ;; - (gnutls-cli-debug) - -_arguments \ - "$_gnutls_cli_common_args[@]" \ - '(-v --verbose)'{-v,--verbose}'[more verbose output]' \ - ':hostname:_hosts' + gnutls-cli) + args+=( + '--tofu[enable trust on first use authentication]' '!--no-tofu' + '--strict-tofu[fail to connect if a known certificate has changed]' '!--no-strict-tofu' + '--dane[enable DANE certificate verification (DNSSEC)]' '!--no-dane' + '--local-dns[use the local DNS server for DNSSEC resolving]' '!--no-local-dna' + '--no-ca-verification[disable CA certificate verification]' '!--ca-verification' + '--ocsp[enable OCSP certificate verification]' '!--no-oscp' + '(-r --resume)'{-r,--resume}'[establish a session and resume]' + '(-e --rehandshake)'{-e,--rehandshake}'[connect, establish a session and rehandshake immediately]' + '(-s --starttls)'{-s,--starttls}'[start TLS on EOF or SIGALRM]' + '--crlf[send CR LF instead of LF]' + '--fastopen[enable TCP Fast Open]' + '(-f --fingerprint)'{-f,--fingerprint}'[send the openpgp fingerprint instead of the key]' + "--print-cert[print peer's certificate in PEM format]" + "--save-cert=[save peer's certificate chain in the specified file in PEM format]:file:_files" + "--save-ocsp=[save peer's OCSP status response in the provided file]:file:_files" + '--dh-bits=[specify minimum number of bits allowed for DH]:bits' + '--srpusername[specify SRP username to use]:username' + '--srppasswd[specify SRP password to use]:password' + '--pskusername[specify PSK username to use]:username' + '--pskkey[specify PSK key to use]:key' + "--insecure[don't require server cert validation]" + '--ranges[use length-hiding padding to prevent traffic analysis]' + '--benchmark-ciphers[benchmark individual ciphers]' + '--benchmark-soft-ciphers[benchmark individual software ciphers]' + '--benchmark-tls-kx[benchmark TLS key exchange methods]' + '--benchmark-tls-ciphers[benchmark TLS ciphers]' + '--priority-list[print list of the supported priority strings]' + '*--alpn=[enable application layer protocol]:string' + '--recordsize=[specify maximum record size to advertize]:record size' + "--disable-sni[don't send a Server Name]" + '--disable-extensions[disable all the TLS extensions]' + '--inline-commands[inline commands of the form ^^]' + '--inline-commands-prefix=[change delimiter used for inline commands]:delimiter [^]' + '--fips140-mode[report status of FIPS140-2 mode in gnutls library]' + ) + ;; - ;; + gnutls-serv) + args+=( + '--sni-hostname-fatal[send fatal alert on sni-hostname mismatch]' + '(-g --generate)'{-g,--generate}'[generate Diffie-Hellman parameters]' + '(-q --quiet)'{-q,--quiet}'[suppress some messages]' + "--nodb[don't use a resumption database]" + '--http[act as an HTTP server]' + '--echo[act as an Echo server]' + '(-a --disable-client-cert)'{-a,--disable-client-cert}"[don't request a client certificate]" + '(-r --require-client-cert)'{-r,--require-client-cert}'[require a client certificate]' + '--verify-client-cert[if a client certificate is sent then verify it]' + '--dhparams=[specify DH params file to use]:file:_files' + '--x509dsakeyfile=[specify alternative X.509 key file to use]:file:_files' + '--x509dsacertfile=[specify alternative X.509 certificate file to use]:file:_files' + '--x509ecckeyfile=[specify alternative X.509 key file to use]:file:_files' + '--x509ecccertfile=[specify alternative X.509 certificate file to use]:file:_files' + '--srppasswd=[specify SRP password file to use]:file:_files' + '--srppasswdconf=[specify SRP password configuration file to use]:file:_files' + '--pskpasswd=[specify PSK password file to use]:file:_files' + '--pskhint=[specify PSK identity hint to use]:string' + '--ocsp-response=[specify OCSP response to send to client]:file:_files' + ) + ;; - (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]' + certtool) + args+=( + '--infile:input file:_files ' + '--outfile:output file:_files ' + '(-s --generate-self-signed)'{-s,--generate-self-signed}'[generate a self-signed certificate]' + '(-c --generate-certificate)'{-c,--generate-certificate}'[generate a signed certificate]' + '--generate-proxy[generate a proxy 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[verify a PEM encoded certificate chain using a trusted list]' + '--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]' + '--dh-info[print information PKCS #3 encoded Diffie-Hellman parameters]' + '--load-privkey:private key file:_files' + '--load-pubkey:public 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' + '--hex-numbers[big number in an easier format to parse]' + '--cprint[prints certain information is C-friendly format]' + '--null-password[enforce a NULL password]' + '--empty-password[enforce an empty password]' + '(-i --certificate-info)'{-i,--certificate-info}'[print information on a certificate]' + '--certificate-pubkey[print certificate public key]' + '(-l --crl-info)'{-l,--crl-info}'[print information on a CRL]' + '--crq-info[print information on a certificate request]' + "--no-crq-extensions[don't use extensions in certificate requests]" + '--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]' + '--pgp-key-info[print information on a OpenPGP private key]' + '--pubkey-info[print information on a public 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' + '--sec-param[specify the security level]:security level:(low normal high ultra)' + '--disable-quick-random[use /dev/random for key generation, thus increasing the quality of randomness used]' + '--template:template file to use for non-interactive operation:_files' + '--pkcs-cipher[specify cipher to use for pkcs operations]:cipher:(3des 3des-pkcs12 aes-128 aes-192 aes-256 rc2-40 arcfour)' + ) + ;; - ;; - (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]' - - ;; + srptool) + args+=( + '(-i --index)'{-i+,--index=}':index of params in tpasswd.conf' + '(-u --username)'{-u+,--username=}':username:_users' + '(-p --passwd)'{-p+,--passwd=}':password file:_files' + '(-s --salt)'{-s+,--salt=}'[specify salt size]:salt size for crypt algorithm' + '--verify[just verify password]' + '(-v --passwd-conf)'{-v+,--passwd-conf=}'[generate a password configuration file]:password conf file:_files' + '--create-conf=[generate a tpasswd.conf file]:file:_files' + ) + ;; esac + +_arguments -s -S $args -- cgit v1.2.3 From 101fb8dbf84c3062b948ed3954a34323c49891f9 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Fri, 22 Sep 2017 01:16:53 +0200 Subject: 41732: bring tmux completion in line with tmux 2.5 - removing completion of mode tables --- ChangeLog | 5 +++++ Completion/Unix/Command/_tmux | 48 +++++++++++++++++++++---------------------- 2 files changed, 28 insertions(+), 25 deletions(-) (limited to 'Completion/Unix') diff --git a/ChangeLog b/ChangeLog index 000d5ccb3..0d4187b7c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2017-09-22 Oliver Kiddle + + * 41732: Completion/Unix/Command/_tmux: bring completion in + line with tmux 2.5 - removing completion of mode tables + 2017-09-21 Daniel Shahaf * unposted (cf. 41672): Src/utils.c: checkrmall: Record the diff --git a/Completion/Unix/Command/_tmux b/Completion/Unix/Command/_tmux index f71f7c33e..b0aa75ba1 100644 --- a/Completion/Unix/Command/_tmux +++ b/Completion/Unix/Command/_tmux @@ -178,8 +178,6 @@ _tmux-bind-key() { '-c[bind to command mode instead of normal mode]' \ '-n[make the binding work without the need for the prefix key]' \ '-r[the key may repeat]' \ - '-t+[specify mode table for the binding]:mode table:__tmux-mode-tables' \ - '-R+[specify repeat count]:repeat count' \ '-T+[specify key table for the binding]:key table' \ '1:key' \ '*:::template:_tmux' @@ -189,8 +187,9 @@ _tmux-break-pane() { [[ -n ${tmux_describe} ]] && print "break a pane from an existing into a new window" && return _arguments -s \ "-d[don't make the new window become the active one]" \ - '-F+[specify output format]:format:__tmux-format__tmux-format' \ + '-F+[specify output format]:format:__tmux-format' \ '-P[print information of new window after it has been created]' \ + '-n+[specify window name]:name' \ '-s+[specify source pane]:pane:__tmux-panes' \ '-t+[specify destination window]:pane:__tmux-panes' } @@ -252,7 +251,7 @@ _tmux-choose-tree() { _tmux-choose-window() { [[ -n ${tmux_describe} ]] && print "put a window into window choice mode" && return _arguments -s \ - '-F=[specify output format]:format:__tmux-format' \ + '-F+[specify output format]:format:__tmux-formats' \ '-t+[specify target window]:session:__tmux-windows' \ '*:::template:_tmux' } @@ -270,6 +269,9 @@ _tmux-clock-mode() { _tmux-command-prompt() { [[ -n ${tmux_describe} ]] && print "open the tmux command prompt in a client" && return _arguments -s \ + '-1[only accept one key press]' \ + '-N' \ + '-i[execute the command every time the prompt input changes]' \ '-I+[specify list of initial inputs]:initial-text (comma-separated list)' \ '-p+[specify list of prompts]:prompts (comma-separated list)' \ '-t+[specify target client]:client:__tmux-clients' \ @@ -302,6 +304,7 @@ _tmux-detach-client() { _arguments -s \ '-a[kill all clients except for the named by -t]' \ '-P[send SIGHUP to parent process]' \ + '-E+[run specified shell command to replace the client]:shell command:_cmdstring' \ '-s+[specify target session and kill its clients]:session:__tmux-sessions-attached' \ '-t+[specify target client]:client:__tmux-clients' } @@ -312,7 +315,7 @@ _tmux-display-message() { '-c+[specify target client]:client:__tmux-clients' \ '-p[print message to stdout]' \ '-t+[specify target client]:client:__tmux-clients' \ - '-F+[specify output format]:format:__tmux-format' \ + '-F+[specify output format]:format:__tmux-formats' \ ':message' } @@ -325,7 +328,7 @@ _tmux-find-window() { [[ -n ${tmux_describe} ]] && print "search for a pattern in windows" && return _arguments -s \ '-C[match visible contents]' \ - '-F+[specify output format]:format:__tmux-format' \ + '-F+[specify output format]:format:__tmux-formats' \ '-N[match window name]' \ '-T[match window title]' \ '-t+[specify target window]:window:__tmux-windows' \ @@ -417,13 +420,13 @@ _tmux-link-window() { _tmux-list-buffers() { [[ -n ${tmux_describe} ]] && print "list paste buffers of a session" && return - _arguments '-F+[specify output format]:format:__tmux-format' + _arguments '-F+[specify output format]:format:__tmux-formats' } _tmux-list-clients() { [[ -n ${tmux_describe} ]] && print "list clients attached to server" && return _arguments -s \ - '-F+[specify output format]:format:__tmux-format' \ + '-F+[specify output format]:format:__tmux-formats' \ '-t+[specify session]:session:__tmux-sessions' } @@ -435,7 +438,6 @@ _tmux-list-commands() { _tmux-list-keys() { [[ -n ${tmux_describe} ]] && print "list all key-bindings" && return _arguments -s \ - '-t+[specify mode table]:mode table:__tmux-mode-tables' \ '-T+[specify key table]:key table' } @@ -449,20 +451,20 @@ _tmux-list-panes() { fi _arguments -s $args \ '-a[list all panes the server possesses]' \ - '-F+[specify output format]:format:__tmux-format' \ + '-F+[specify output format]:format:__tmux-formats' \ '-s[if specified, -t chooses a session]' } _tmux-list-sessions() { [[ -n ${tmux_describe} ]] && print "list sessions managed by server" && return - _arguments '-F+[specify output format]:format:__tmux-format' + _arguments '-F+[specify output format]:format:__tmux-formats' } _tmux-list-windows() { [[ -n ${tmux_describe} ]] && print "list windows of a session" && return _arguments -s \ '-a[list all windows the tmux server possesses]' \ - '-F[specify output format]:format:__tmux-format' \ + '-F[specify output format]:format:__tmux-formats' \ '-t+[specify session]:session:__tmux-sessions' } @@ -519,7 +521,7 @@ _tmux-new-session() { "-d[don't attach new session to current terminal]" \ "-D[in case of -A behave like attach-session's -d]" \ "-E[don't apply update-environment option]" \ - '-F+[specify output format]:format:__tmux-format' \ + '-F+[specify output format]:format:__tmux-formats' \ '-n+[specify initial window name]:window name' \ '-P[print information about new session after it is created]' \ '-s+[name the session]:session name:__tmux-sessions' \ @@ -535,7 +537,7 @@ _tmux-new-window() { '-a[insert new window at next free index from -t]' \ '-c+[specify working directory for the session]:directory:_directories' \ "-d[don't make the new window become the active one]" \ - '-F+[specify output format]:format:__tmux-format' \ + '-F+[specify output format]:format:__tmux-formats' \ '-k[destroy it if the specified window exists]' \ '-n+[specify a window name]:window name' \ '-P[print information about new window after it is created]' \ @@ -705,6 +707,8 @@ _tmux-send-keys() { '-l[disable key name lookup and send data literally]' \ '-R[reset terminal state]' \ '-M[pass through a mouse event]' \ + '-X[send a command into copy mode]' \ + '-N+[specify repeat count]:repeat count' \ '-t+[specify target pane]:pane:__tmux-panes' \ '*:key' } @@ -806,6 +810,7 @@ _tmux-set-hook() { [[ -n ${tmux_describe} ]] && print "set a hook to a command" && return _arguments -s \ '-g[add hook to global list]' \ + '-u[unset a hook]' \ '-t+[specify target session]:session:__tmux-sessions' ':command' } @@ -898,7 +903,8 @@ _tmux-split-window() { _arguments -s \ '-b[create new pane left of or above target pane]' \ "-d[don't make the new window become the active one]" \ - '-F+[specify output format]:format:__tmux-format' \ + '-F+[specify output format]:format:__tmux-formats' \ + '-f[create new pane spanning full window width or height]' \ '-h[split horizontally]' \ '-v[split vertically]' \ "-l[define new pane's size]:size" \ @@ -959,9 +965,7 @@ _tmux-unbind-key() { ow=( "${words[@]}" ) _arguments -C -s \ '-a[remove all key bindings]' \ - '-c[kill the window if it is only in one session]' \ '-n[remove a non-prefix binding]' \ - '-t+[specify mode table]:mode table:__tmux-mode-tables' \ '-T[specify key table]:key table' \ '*:: :->boundkeys' @@ -1086,8 +1090,8 @@ function __tmux-environment-variables() { esac } -function __tmux-format() { - _message 'not implemented yet' +__tmux-formats() { + _message 'not implemented yet' } function __tmux-colours() { @@ -1116,12 +1120,6 @@ function __tmux-get-optarg() { done } -__tmux-mode-tables() { - local expl - _description mode-tables expl 'mode table' - compadd "$@" "$expl[@]" vi-edit emacs-edit vi-choice emacs-choice vi-copy emacs-copy -} - __tmux-nothing-else() { _message "no further arguments" } -- cgit v1.2.3 From 8ddadb8afe819951891f30cfbf5061af56a231e9 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Fri, 22 Sep 2017 18:45:32 +0200 Subject: update mtr completion through mtr 0.92 --- ChangeLog | 2 ++ Completion/Unix/Command/_mtr | 78 ++++++++++++++++++++++++++++++++------------ 2 files changed, 60 insertions(+), 20 deletions(-) (limited to 'Completion/Unix') diff --git a/ChangeLog b/ChangeLog index ad0627bc4..464837cd6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2017-09-22 Oliver Kiddle + * 41742: Completion/Unix/Command/_mtr: update for mtr 0.92 + * 41743: Completion/Linux/Command/_tune2fs: update options in completion through e2fsprogs 1.43.6 diff --git a/Completion/Unix/Command/_mtr b/Completion/Unix/Command/_mtr index 5eda9bc1a..806e344d1 100644 --- a/Completion/Unix/Command/_mtr +++ b/Completion/Unix/Command/_mtr @@ -1,22 +1,60 @@ #compdef mtr -_arguments -C \ - '(-h --help)'{-h,--help}'[help]' \ - '(-v --version)'{-v,--version}'[version]' \ - '(-r --report)'{-r,--report}'[report mode]' \ - '(-w --report-wide)'{-w,--report-wide}'[wide report mode\: do not truncate hostnames]' \ - '(-c --report-cycles)'{-c,--report-cycles}'[report cycles]:number of pings' \ - '(-s --psize)'{-s,--psize}'[packet size]:number of bytes' \ - '(-t --curses)'{-t,--curses}'[curses UI]' \ - '(-e --mpls)'{-e,--mpls}'[display ICMP MPLS information]' \ - '(-o --order)'{-o,--order}'[order output fields]:fields order' \ - '(-n --no-dns)'{-n,--no-dns}'[no DNS lookups]' \ - '(-g --gtk)'{-g,--gtk}'[GTK+ UI]' \ - '(-p --split)'{-p,--split}'[output for a split-user interface]' \ - '(-l --raw)'{-l,--raw}'[raw output format]' \ - '(-a --address)'{-a,--address}'[source address]:source IP:_hosts' \ - '(-i --interval)'{-i,--interval}'[ping interval]:number of seconds' \ - '-u[use UDP instead of ICMP echo]' \ - '-4[use IPv4 only]' \ - '-6[use IPv6 only]' \ - ':destination host:_hosts' +_arguments -s -S \ + '(H -F --filename)'{-F,--filename}'[read hostnames from a file]' \ + '(H -6)-4[use IPv4 only]' \ + '(H -4)-6[use IPv6 only]' \ + '(H -a --address)'{-a+,--address=}'[bind outgoing packets to specific interface]:source IP:_hosts' \ + '(H -f --first-ttl)'{-f+,--first-ttl=}'[specify TTL to start]:TTL [1]' \ + '(H -m --max-ttl)'{-m+,--max-ttl=}'[specify maximum number of hops to probe]:hops [30]' \ + '(H -U --max-unknown)'{-U+,--max-unknown=}'[specify maximum unknown hosts]:maximum [5]' \ + '(H -P --port)'{-P+,--port=}'[specify target port for TCP, SCTP or UDP]:port' \ + '(H -L --localport -T --tcp -S --sctp)'{-L+,--localport=}'[specify source port number for UDP]' \ + '(H -s --psize 2)'{-s+,--psize=}'[packet size]:packet size (bytes)' \ + '(H -B --bitpattern)'{-B+,--bitpattern=}'[specify bit pattern to use in payload]:number (0-255)' \ + '(H -i --interval)'{-i+,--interval=}'[specify ping interval]:interval (seconds)' \ + '(H -G --gracetime)'{-G+,--gracetime=}'[specify time to wait for responses]:wait time (seconds)' \ + '(H -Q --tos)'{-Q+,--tos=}'[specify type of service for IP header]:tos (0-255)' \ + '(H -e --mpls)'{-e,--mpls}'[display ICMP MPLS information]' \ + '(H -Z --timeout)'{-Z+,--timeout=}'[specify how long to keep probe sockets open before giving up on the connection]:timeout (seconds)' \ + '(H -M --mark)'{-M+,--mark=}'[mark each sent packet]:mark' \ + '(H -r --report)'{-r,--report}'[report mode]' \ + '(H -w --report-wide)'{-w,--report-wide}"[wide report mode\: don't truncate hostnames]" \ + '(H -c --report-cycles)'{-c+,--report-cycles=}'[report cycles]:number of pings' \ + '(H)--displaymode=[select initial display mode]:display mode:((0\:statistics 1\:stripchart\ with\ latency 2\:stripchart\ without\ latency))' \ + '(H -n --no-dns)'{-n,--no-dns}'[no DNS lookups]' \ + '(H -b --show-ips)'{-b,--show-ips}'[show both IP numbers and host names]' \ + '(H -o --order)'{-o+,--order=}'[specify order of output fields]: :_values -S "" "field order" + "L[loss ratio]" + "D[dropped packets]" + "R[received packets]" + "S[sent packets]" + "N[newest RTT]" + "B[min/best RTT]" + "A[average RTT]" + "W[max/worst RTT]" + "V[standard deviation]" + "G[geometric mean]" + "J[current jitter]" + "M[jitter mean/average]" + "X[worst jitter]" + "I[interarrival jitter]"' \ + '(H -z --aslookup -y --ipinfo)'{-y+,--ipinfo=}'[select IP information in output]:information:((0\:display\ AS\ number 1\:display\ IP\ prefix 2\:display\ country\ code 3\:display\ RIR 4\:display\ allocation\ date))' \ + '(H -y --ipinfo -z --aslookup)'{-z,--aslookup}'[display AS number]' \ + '(H)1:destination host:_hosts' \ + '(H)2:packet size (bytes)' \ + + '(H)' \ + '(- 1 2)'{-h,--help}'[display help information]' \ + '(- 1 2)'{-v,--version}'[display version information]' \ + + '(proto)' \ + '(H)'{-u,--udp}'[use UDP instead of ICMP echo]' \ + '(H -s --psize)'{-T,--tcp}'[use TCP instead of ICMP echo]' \ + '(H)'{-S,--sctp}'[use SCTP instead of ICMP echo]' \ + + '(output)' \ + '(H)'{-t,--curses}'[curses UI]' \ + '(H)'{-g,--gtk}'[GTK+ UI]' \ + '(H)'{-p,--split}'[output for a split-user interface]' \ + '(H)'{-l,--raw}'[output raw format]' \ + '(H)'{-C,--csv}'[output comma separated values]' \ + '(H)'{-j,--json}'[output JSON]' \ + '(H)'{-x,--xml}'[output XML]' -- cgit v1.2.3 From 63271a4b9308a3965a0f0a97175cbcfdf1a3b813 Mon Sep 17 00:00:00 2001 From: Noah Pendleton Date: Wed, 4 Oct 2017 22:07:18 +0000 Subject: 41808: _git-cherry-pick: Typo fixes --- ChangeLog | 5 +++++ Completion/Unix/Command/_git | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'Completion/Unix') diff --git a/ChangeLog b/ChangeLog index 08ccc3470..b273fe9ce 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2017-10-04 Noah Pendleton + + * 41808: Completion/Unix/Command/_git: _git-cherry-pick: + Typo fixes + 2017-10-04 Peter Stephenson * 41802 (minor tweaks): Src/exec.c, Src/parse.c: use heap diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 26554de05..030d23ae2 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -519,11 +519,11 @@ _git-cherry-pick () { '--allow-empty[preserve initially empty commits]' \ '--allow-empty-message[allow replaying a commit with an empty message]' \ '--keep-redundant-commits[keep cherry-picked commits that will become empty]' \ - '(-e --edit --ff)'{-e,--edit}'[edit commit before committing the revert]' \ + '(-e --edit --ff)'{-e,--edit}'[edit commit before committing the cherry-pick]' \ '(--ff)-x[append information about what commit was cherry-picked]' \ '(-m --mainline)'{-m+,--mainline=}'[specify mainline when cherry-picking a merge commit]:parent number' \ '--rerere-autoupdate[update index with reused conflict resolution if possible]' \ - '(-n --no-commit --ff)'{-n,--no-commit}'[do not make the actually commit]' \ + '(-n --no-commit --ff)'{-n,--no-commit}'[do not make the actual commit]' \ '(-s --signoff --ff)'{-s,--signoff}'[add Signed-off-by line at the end of the commit message]' \ '(-S --gpg-sign --no-gpg-sign)'{-S-,--gpg-sign=-}'[GPG-sign the commit]::key id' \ "(-S --gpg-sign --no-gpg-sign)--no-gpg-sign[don't GPG-sign the commit]" \ -- cgit v1.2.3 From 69fcc22dc84e8411870ba8f2a4c876e223ad2a08 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Sat, 7 Oct 2017 22:26:51 +0200 Subject: 41823: new completions for some GNU coreutils utilities --- ChangeLog | 10 ++++++ Completion/Unix/Command/_cp | 2 +- Completion/Unix/Command/_expand | 16 ++++++++++ Completion/Unix/Command/_mv | 42 +++++++++++++++++++++++++ Completion/Unix/Command/_numfmt | 24 +++++++++++++++ Completion/Unix/Command/_seq | 28 +++++++++++++++++ Completion/Unix/Command/_split | 64 +++++++++++++++++++++++++++++++++++++++ Completion/Unix/Command/_stdbuf | 30 ++++++++++++++++++ Completion/Unix/Command/_timeout | 19 ++++++++++++ Completion/Unix/Command/_unexpand | 24 +++++++-------- 10 files changed, 246 insertions(+), 13 deletions(-) create mode 100644 Completion/Unix/Command/_expand create mode 100644 Completion/Unix/Command/_mv create mode 100644 Completion/Unix/Command/_numfmt create mode 100644 Completion/Unix/Command/_seq create mode 100644 Completion/Unix/Command/_split create mode 100644 Completion/Unix/Command/_stdbuf create mode 100644 Completion/Unix/Command/_timeout (limited to 'Completion/Unix') diff --git a/ChangeLog b/ChangeLog index 9b0b4ddba..168886d5d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2017-10-07 Oliver Kiddle + + * 41823: Completion/Unix/Command/_expand, + Completion/Unix/Command/_mv, Completion/Unix/Command/_numfmt, + Completion/Unix/Command/_seq, Completion/Unix/Command/_split, + Completion/Unix/Command/_stdbuf, Completion/Unix/Command/_cp, + Completion/Unix/Command/_timeout, + Completion/Unix/Command/_unexpand: new completions for some + GNU coreutils utilities + 2017-10-07 Daniel Shahaf * unposted: Doc/Zsh/mod_stat.yo: zsh/stat docs: Rephrase to diff --git a/Completion/Unix/Command/_cp b/Completion/Unix/Command/_cp index 5c3f37983..88750b330 100644 --- a/Completion/Unix/Command/_cp +++ b/Completion/Unix/Command/_cp @@ -55,7 +55,7 @@ else 'netbsd*' "-N[don't copy file flags]" \ '(darwin|dragonfly|freebsd|netbsd)*' '-a[archive mode, same as -RpP]' \ '(dragonfly|freebsd)*' '-l[link files instead of copying]' \ - '(darwin|dragonfly|freebsd|netbsd)*' '-v[show file names as they are copied]' \ + '(darwin|dragonfly|*bsd)*' '-v[show file names as they are copied]' \ 'darwin*' "-X[don't copy extended attributes or resource forks]" \ '(dragonfly|freebsd)*' "-x[don't traverse file systems]" \ 'freebsd<10->.*' '-s[make symbolic links instead of copies of non-directories]' diff --git a/Completion/Unix/Command/_expand b/Completion/Unix/Command/_expand new file mode 100644 index 000000000..3f297dce2 --- /dev/null +++ b/Completion/Unix/Command/_expand @@ -0,0 +1,16 @@ +#compdef expand gexpand + +local -a args + +if _pick_variant gnu=GNU unix --version; then + args=( + '(-i --initial --help)'{-i,--initial}"[don't convert tabs after non blanks]" + '(-t --tabs --version)'{-t+,--tabs=}'[specify tab width]:list of tab positions' + '(* -)--help[display usage information]' + '(* -)--version[output version information]' + ) +else + args=( -A "-*" '(-t --tabs)'{-t+,--tabs=}'[specify tab width]:list of tab positions' ) +fi + +_arguments -s -S "$args[@]" '*:file:_files' diff --git a/Completion/Unix/Command/_mv b/Completion/Unix/Command/_mv new file mode 100644 index 000000000..3592efee6 --- /dev/null +++ b/Completion/Unix/Command/_mv @@ -0,0 +1,42 @@ +#compdef mv gmv + +local args +if _pick_variant gnu=GNU unix --version; then + args=( + '(-b --backup -n --no-clobber)--backup=[make a backup of each existing destination file]: : _values "backup type" + {none,off}"[never make backups]" + {numbered,t}"[make numbered backups]" + {existing,nil}"[numbered backups, if they already exist]" + {simple,never}"[always make simple backups]"' + '(-b --backup -n --no-clobber)-b[make a backup of each existing destination file]' + '(-f --force -i --interactive -n --no-clobber)'{-f,--force}"[don't prompt before overwriting]" + '(-f --force -i --interactive -n --no-clobber)'{-i,--interactive}'[prompt before overwriting existing file]' + '--strip-trailing-slashes[remove any trailing slashes from each source argument]' + '(-S --suffix)'{-S+,--suffix=}'[specify the backup suffix]:backup suffix [~]' + '(-t --target-directory)'{-t+,--target-directory=}'[move all source arguments into specified directory]:directory:_directories' + '(-T --no-target-directory)'{-T,--no-target-directory}'[treat final argument as a normal file]' + '(-u --update)'{-u,--update}'[move only when destination file is older or missing]' + '(-v --verbose)'{-v,--verbose}'[show file names after they are moved]' + '(- *)--help[display usage information]' + '(- *)--version[display version information]' + ) + [[ $OSTYPE = linux* ]] && args+=( + '(-Z --context)'{-Z,--context}'[set SELinux security context of destination file to default type]' + ) +else + local pattern arg + args=( + "(-i -n)-f[don't prompt before overwriting]" + '(-f -n)-i[prompt before overwriting existing file]' + ) + for pattern arg in \ + '(darwin|dragonfly|freebsd)*' "(-f -i)-n[don't overwrite existing file]" \ + '(darwin|dragonfly|*bsd)*' '-v[show file names after they are moved]' \ + '(dragonfly|freebsd)*' "-h[if target is a symlink to a directory, don't follow it]" + do + [[ $OSTYPE = $~pattern ]] && args+=( $arg ) + done +fi + +_arguments -s -S $args \ + '*:file:_files' diff --git a/Completion/Unix/Command/_numfmt b/Completion/Unix/Command/_numfmt new file mode 100644 index 000000000..999c412a1 --- /dev/null +++ b/Completion/Unix/Command/_numfmt @@ -0,0 +1,24 @@ +#compdef numfmt gnumfmt + +local units="((auto\:1K\ =\ 1000,\ 1Ki\ =\ 1024 si\:1K\ =\ 1000 iec\:1K\ =\ 1024 iec-i\:1Ki\ =\ 1024))" + +_arguments -S \ + '(H)--debug[print warnings about invalid input]' \ + '(H -z --zero-terminated -d --delimiter)'{-d+,--delimiter=}'[use specified field delimiter instead of whitespace]:delimiter' \ + '(H)--field=[replace numbers in specified input fields]:fields [1]' \ + '(H)--format=[use printf style floating-point format]:format' \ + "(H)--from=[auto-scale input numbers to specified units]:unit [none]:$units" \ + '(H)--from-unit=[specify the input unit size]:unit size [1]' \ + '(H)--grouping[use locale-defined digit grouping e.g. 1,000,000]' \ + '(H)--header=-[print (without converting) initial header lines]::header lines [1]' \ + '(H)--invalid=[specify failure mode for invalid numbers]:mode [abort]:(abort fail warn ignore)' \ + '(H)--padding=[pad the output to specified width]:width; positive - right-align; negative - left-align' \ + '(H)--round=[use specified method for rounding when scaling]:method [from-zero]:(up down from-zero towards-zero nearest)' \ + '(H)--suffix=[add suffix to output numbers and accept optional suffix in input numbers]:suffix' \ + "(H)--to=[auto-scale output numbers to specified unit]:unit:$units" \ + '(H)--to-unit=[specify output unit size]:unit size [1]' \ + '(H -z --zero-terminated -d --delimiter)'{-z,--zero-terminated}'[line delimiter is NUL, not newline]' \ + '(H)*: :_guard "^-*" number' \ + + 'H' \ + '(- *)--help[display usage information]' \ + '(- *)--version[display version information]' diff --git a/Completion/Unix/Command/_seq b/Completion/Unix/Command/_seq new file mode 100644 index 000000000..5b825675f --- /dev/null +++ b/Completion/Unix/Command/_seq @@ -0,0 +1,28 @@ +#compdef seq gseq + +local variant args + +_pick_variant -r variant gnu=GNU $OSTYPE --version + +args=( ':: :_guard "^-[^0-9]*" '{first,step,last} ) +case $variant in + gnu) + args+=( + '(--help --version)'{-f+,--format=}'[use printf style floating-point format]:format' + '(--help --version -s --separator)'{-s+,--separator=}'[use specified separator for numbers]:separator [\n]' + '(--help --version -w --equal-width)'{-w,--equal-width}'[equalize width by padding with leading zeroes]' + '(- 1 2 3)--help[display usage information]' + '(- 1 2 3)--version[display version information]' + ) + ;; + *) + args+=( + '-f+[use printf style floating-point format]:format' + '-s+[use specified separator for numbers]:separator [\n]' + '-t+[use specified string to terminate numbers]:string [\n]' + '-w[equalize width by padding with leading zeroes]' + ) + ;; +esac + +_arguments -s -A '-[^1-9]*' $args diff --git a/Completion/Unix/Command/_split b/Completion/Unix/Command/_split new file mode 100644 index 000000000..25b5aec2d --- /dev/null +++ b/Completion/Unix/Command/_split @@ -0,0 +1,64 @@ +#compdef split gsplit + +local curcontext="$curcontext" variant ret=1 +local -A opt_args +local -a state line args + +_pick_variant -r variant gnu=GNU $OSTYPE --version + +args=( + '-a+[generate suffixes of specified length]:length [2]' \ + '(-l -p -n)-b+[put specified size in bytes in each output file]:size (bytes)' \ + '(-b -p -n)-l+[put specified number of lines/records in each output file]:lines' \ + '1:file:_files' \ + '2: :_guard "^-*" "prefix [x]"' +) + +case $variant in + gnu) + args=( -C + '(H -a --suffix-length)'{-a+,--suffix-length=}'[generate suffixes of specified length]:length [2]' + '(H)--additional-suffix=[append an additional suffix to file names]:suffix' + '(H -b --bytes -C --line-bytes -l --lines -n --number)'{-b+,--bytes=}'[put specified size in bytes in each output file]:size (bytes)' + '(H -b --bytes -C --line-bytes -l --lines -n --number)'{-C+,--line-bytes=}'[put whole lines/records up to size limit in each output file]:size (bytes)' + '(H --numeric-suffixes -x --hex-suffixes)-d[use numeric suffixes starting at 0]' + '(H -d -x --hex-suffixes)--numeric-suffixes=-[use numeric suffixes]::start value [0]' + '(H -d --numeric-suffixes --hex-suffixes)-x[use hex suffixes starting at 0]' + '(H -d --numeric-suffixes -x)--hex-suffixes=-[use hex suffixes]::start value [0]' + '(H -e --elide-empty-files)'{-e,--elide-empty-files}"[don't generate empty output files with '-n']" + '(H)--filter=[write to shell command; filename is in $FILE]:command:_cmdstring' + '(H -b --bytes -C --line-bytes -l --lines -n --number)'{-l+,--lines=}'[put specified number of lines/records in each output file]:lines' + '(H -b --bytes -C --line-bytes -l --lines -n --number)'{-n+,--number=}'[generate specified number of output files]:chunks:->chunks' + '(H -t --separator)'{-t+,--separator=}'[use specified record separator instead of newline]:separator' + '(H -u --unbuffered)'{-u,--unbuffered}"[immediately copy input to output with '-n r/...']" + '(H)--verbose[print a diagnostic just before each output file is opened]' + '(H)1:file:_files' + '(H)2: :_guard "^-*" "prefix [x]"' + + 'H' + '(- 1 2)--help[display usage information]' + '(- 1 2)--version[display version information]' + ) + ;; + (free|net)bsd*) + args+=( '(-b -l -p)-n+[generate specified number of output files]:output files' ) + ;| + freebsd*) + args+=( + '-d[use numeric suffixes]' + '(-b -l -n)-p+[split the file whenever a line matches specified pattern]:pattern' + ) + ;; +esac + +_arguments -s -S $args && ret=0 + +if [[ $state = chunks ]]; then + if [[ ! -prefix *[0-9/]* ]]; then + _alternative 'modifiers: :_values -s/ "modifier" "l[don'\''t split lines/records]" "r[round robin distribution]"' \ + 'lines: :_guard "[0-9/]#" lines' && ret=0 + else + _message -e lines lines + fi +fi + +return ret diff --git a/Completion/Unix/Command/_stdbuf b/Completion/Unix/Command/_stdbuf new file mode 100644 index 000000000..3bce3d0a7 --- /dev/null +++ b/Completion/Unix/Command/_stdbuf @@ -0,0 +1,30 @@ +#compdef stdbuf + +local -a short long buf args +local i opt gnu=0 + +short=( -e -i -o ) +long=( --error --output --input ) +buf=( err in out ) + +opt='[set initial buffering for std${buf[i]}]:mode or size:((0\:unbuffered L\:line\ buffered' +if _pick_variant gnu=GNU freebsd --version; then + gnu=1 + args=( + '(- *)--help[display usage information]' + '(- *)--version[display version information]' + ) +else + opt+=' B\:fully\ buffered' +fi +opt+='))' + +for ((i=1;i<=3;i++)); do + args+=( "(${long[i]})${short[i]}+${(e)opt}" ) + (( gnu )) && args+=( + "(${short[i]})${long[i]}=${(e)opt}" + ) +done +(( CURRENT > 2 )) && args+=( '*::command:_normal' ) + +_arguments -s -S $args diff --git a/Completion/Unix/Command/_timeout b/Completion/Unix/Command/_timeout new file mode 100644 index 000000000..0e6d057b3 --- /dev/null +++ b/Completion/Unix/Command/_timeout @@ -0,0 +1,19 @@ +#compdef timeout gtimeout + +local args + +if [[ $service = g* || $OSTYPE != *bsd* ]]; then + # GNU coreutils as opposed to Free/NetBSD implementation + args=( + '(- *)--help[display usage information]' + '(- *)--version[display version information]' + ) +fi + +_arguments -S -A "-" $args \ + '--preserve-status[always exit with the same status as command even if it times out]' \ + "--foreground[don't propagate timeout to the command children]" \ + '(-s --signal)'{-s,--signal}'[specify the signal to send on timeout]:signal:_signals' \ + '(-k --kill-after)'{-k,--kill-after}'[followup first signal with SIGKILL if command persists after specified time]:time:time' \ + '1: :_guard "[0-9.]#([smhd]|)" duration' \ + '*:::command:_normal' diff --git a/Completion/Unix/Command/_unexpand b/Completion/Unix/Command/_unexpand index c983c628f..d9793ea70 100644 --- a/Completion/Unix/Command/_unexpand +++ b/Completion/Unix/Command/_unexpand @@ -1,4 +1,4 @@ -#compdef unexpand +#compdef unexpand gunexpand local all tabs ret=1 local -a args @@ -6,21 +6,21 @@ local -a args all="convert all whitespace, instead of just initial whitespace" tabs="use comma separated list of tab positions" args=( - "(--all)-a[$all]" - "(--tabs)-t[$tabs]:tablist" - "*:file:_files" + "(--all)-a[$all]" + "(--tabs)-t+[$tabs]:tablist" + '*:file:_files' ) if _pick_variant gnu="Free Soft" unix --version; then - args+=( - "(-a)--all[$all]" - "--first-only[convert only leading sequences of whitespace]" - "(-t)--tabs=[$tabs]:tablist" - "(* -)--help[display help message and exit]" - "(* -)--version[output version information and exit]" - ) + args+=( + "(-a)--all[$all]" + '--first-only[convert only leading sequences of whitespace]' + "(-t)--tabs=[$tabs]:tablist" + '(* -)--help[display usage information]' + '(* -)--version[output version information]' + ) fi -_arguments "$args[@]" && ret=0 +_arguments -s -S "$args[@]" && ret=0 return ret -- cgit v1.2.3 From aeed51fdfcdc10b6f866c9ff794c5baa99d1b39e Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Tue, 10 Oct 2017 10:00:57 +0100 Subject: unposted: rename _expand command completion to avoid clash with completer --- ChangeLog | 3 +++ Completion/Unix/Command/_expand | 16 ---------------- Completion/Unix/Command/_expand_cmd | 16 ++++++++++++++++ 3 files changed, 19 insertions(+), 16 deletions(-) delete mode 100644 Completion/Unix/Command/_expand create mode 100644 Completion/Unix/Command/_expand_cmd (limited to 'Completion/Unix') diff --git a/ChangeLog b/ChangeLog index 2455626fc..e141f23b5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2017-10-10 Peter Stephenson + * uposted, c.f. 41846: Completion/Unix/Command/_expand -> + _expand_cmd: rename to avoid clash with completer. + * 41842: Doc/Zsh/grammar.yo: split alias documentation, adding more on problems. diff --git a/Completion/Unix/Command/_expand b/Completion/Unix/Command/_expand deleted file mode 100644 index 3f297dce2..000000000 --- a/Completion/Unix/Command/_expand +++ /dev/null @@ -1,16 +0,0 @@ -#compdef expand gexpand - -local -a args - -if _pick_variant gnu=GNU unix --version; then - args=( - '(-i --initial --help)'{-i,--initial}"[don't convert tabs after non blanks]" - '(-t --tabs --version)'{-t+,--tabs=}'[specify tab width]:list of tab positions' - '(* -)--help[display usage information]' - '(* -)--version[output version information]' - ) -else - args=( -A "-*" '(-t --tabs)'{-t+,--tabs=}'[specify tab width]:list of tab positions' ) -fi - -_arguments -s -S "$args[@]" '*:file:_files' diff --git a/Completion/Unix/Command/_expand_cmd b/Completion/Unix/Command/_expand_cmd new file mode 100644 index 000000000..3f297dce2 --- /dev/null +++ b/Completion/Unix/Command/_expand_cmd @@ -0,0 +1,16 @@ +#compdef expand gexpand + +local -a args + +if _pick_variant gnu=GNU unix --version; then + args=( + '(-i --initial --help)'{-i,--initial}"[don't convert tabs after non blanks]" + '(-t --tabs --version)'{-t+,--tabs=}'[specify tab width]:list of tab positions' + '(* -)--help[display usage information]' + '(* -)--version[output version information]' + ) +else + args=( -A "-*" '(-t --tabs)'{-t+,--tabs=}'[specify tab width]:list of tab positions' ) +fi + +_arguments -s -S "$args[@]" '*:file:_files' -- cgit v1.2.3 From 04a7dca3b0aa7659846e66415a2021b1562492f5 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Wed, 11 Oct 2017 01:23:53 +0200 Subject: 41831: fix compset usage in ogg123 completion and tweak where compset -p is a better choice than -P --- ChangeLog | 5 +++++ Completion/Unix/Command/_less | 2 +- Completion/Unix/Command/_vorbis | 2 +- Completion/Unix/Type/_tilde_files | 2 +- Completion/Zsh/Type/_globquals | 2 +- 5 files changed, 9 insertions(+), 4 deletions(-) (limited to 'Completion/Unix') diff --git a/ChangeLog b/ChangeLog index e7d6e988a..0c80025ec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2017-10-10 Oliver Kiddle + * 41831: Completion/Unix/Type/_tilde_files, + Completion/Unix/Command/_less, Completion/Unix/Command/_vorbis, + Completion/Zsh/Type/_globquals: fix compset usage in ogg123 + completion and tweak where compset -p is a better choice than -P + * 41835: Src/Zle/complete.c: handle multibyte characters with compset -p and -s diff --git a/Completion/Unix/Command/_less b/Completion/Unix/Command/_less index 9092010f2..7f01952d2 100644 --- a/Completion/Unix/Command/_less +++ b/Completion/Unix/Command/_less @@ -91,7 +91,7 @@ _arguments -S -s -A "[-+]*" \ if [[ -n "$state" ]]; then case $state in prompts) - if compset -P \?; then + if compset -p 1; then _message -e prompt else _describe 'prompt' '( diff --git a/Completion/Unix/Command/_vorbis b/Completion/Unix/Command/_vorbis index eee4f7a5e..cb3e3f9d8 100644 --- a/Completion/Unix/Command/_vorbis +++ b/Completion/Unix/Command/_vorbis @@ -79,7 +79,7 @@ case $service in esac if [[ $state = devopts ]]; then - if compset -p '*:'; then + if compset -P '*:'; then _message -e value value else _wanted devopts expl 'device option' \ diff --git a/Completion/Unix/Type/_tilde_files b/Completion/Unix/Type/_tilde_files index b1b3b37f0..0ee12332b 100644 --- a/Completion/Unix/Type/_tilde_files +++ b/Completion/Unix/Type/_tilde_files @@ -29,7 +29,7 @@ case "$PREFIX" in _files "$@" -W "$user" ;; \~*) - compset -P '?' + compset -p 1 local -a expl=( "$@" ) _alternative -O expl users:user:_users named-directories:'named directory':'compadd -k nameddirs' ;; diff --git a/Completion/Zsh/Type/_globquals b/Completion/Zsh/Type/_globquals index a904bdf0d..c855b540e 100644 --- a/Completion/Zsh/Type/_globquals +++ b/Completion/Zsh/Type/_globquals @@ -167,7 +167,7 @@ while [[ -n $PREFIX ]]; do ([oO]) # complete/skip sort spec - if ! compset -P "?"; then + if ! compset -p 1; then alts=( "n:lexical order of name" "L:size of file" -- cgit v1.2.3 From 1a3a07a35f0bea5774297ccf2ab4ddd9b525fc94 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Wed, 11 Oct 2017 01:23:56 +0200 Subject: 41849: handle both unexpand and expand in a single function They have some commonalities and using _unexpand dodges around the clash with the _expand completer. --- ChangeLog | 4 ++++ Completion/Unix/Command/_expand_cmd | 16 ---------------- Completion/Unix/Command/_unexpand | 37 ++++++++++++++++++++++--------------- 3 files changed, 26 insertions(+), 31 deletions(-) delete mode 100644 Completion/Unix/Command/_expand_cmd (limited to 'Completion/Unix') diff --git a/ChangeLog b/ChangeLog index 0c80025ec..f0b8f2e12 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2017-10-10 Oliver Kiddle + * 41849: Completion/Unix/Command/_unexpand: handle both unexpand + and expand in a single function: they have some commonalities + and it dodges around the clash with the _expand completer + * 41831: Completion/Unix/Type/_tilde_files, Completion/Unix/Command/_less, Completion/Unix/Command/_vorbis, Completion/Zsh/Type/_globquals: fix compset usage in ogg123 diff --git a/Completion/Unix/Command/_expand_cmd b/Completion/Unix/Command/_expand_cmd deleted file mode 100644 index 3f297dce2..000000000 --- a/Completion/Unix/Command/_expand_cmd +++ /dev/null @@ -1,16 +0,0 @@ -#compdef expand gexpand - -local -a args - -if _pick_variant gnu=GNU unix --version; then - args=( - '(-i --initial --help)'{-i,--initial}"[don't convert tabs after non blanks]" - '(-t --tabs --version)'{-t+,--tabs=}'[specify tab width]:list of tab positions' - '(* -)--help[display usage information]' - '(* -)--version[output version information]' - ) -else - args=( -A "-*" '(-t --tabs)'{-t+,--tabs=}'[specify tab width]:list of tab positions' ) -fi - -_arguments -s -S "$args[@]" '*:file:_files' diff --git a/Completion/Unix/Command/_unexpand b/Completion/Unix/Command/_unexpand index d9793ea70..13f6ce835 100644 --- a/Completion/Unix/Command/_unexpand +++ b/Completion/Unix/Command/_unexpand @@ -1,26 +1,33 @@ -#compdef unexpand gunexpand +#compdef unexpand gunexpand expand gexpand -local all tabs ret=1 +local all tabs local -a args all="convert all whitespace, instead of just initial whitespace" -tabs="use comma separated list of tab positions" -args=( - "(--all)-a[$all]" - "(--tabs)-t+[$tabs]:tablist" - '*:file:_files' -) +tabs="[use comma separated list of tab positions]:list of tab positions" if _pick_variant gnu="Free Soft" unix --version; then + if [[ $service = *un* ]]; then + args=( + "(-a --help --version)--all[$all]" + '(--help --version)--first-only[convert only leading sequences of whitespace]' + ) + else + args=( + '(-i --initial --help --version)'{-i,--initial}"[don't convert tabs after non blanks]" + ) + fi + args+=( - "(-a)--all[$all]" - '--first-only[convert only leading sequences of whitespace]' - "(-t)--tabs=[$tabs]:tablist" + "(-t --help --version)--tabs=${tabs}" '(* -)--help[display usage information]' - '(* -)--version[output version information]' + '(* -)--version[display version information]' ) +elif [[ $OSTYPE = (*bsd*|dragonfly*|darwin*) ]]; then + args=( -A "-*" ) fi +[[ $service = *un* ]] && args+=( "(--all --help --version)-a[$all]" ) -_arguments -s -S "$args[@]" && ret=0 - -return ret +_arguments -s -S "$args[@]" \ + "(--tabs --help)-t+${tabs}" \ + '*:file:_files' -- cgit v1.2.3 From ea7178a6242db104b69a4e6cc2d4d4020cb736f6 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Wed, 11 Oct 2017 01:23:57 +0200 Subject: 41853: update options for texinfo 6.5 and complete also for the pinfo info reader --- ChangeLog | 3 +++ Completion/Unix/Command/_texinfo | 35 ++++++++++++++++++++++++++++++----- 2 files changed, 33 insertions(+), 5 deletions(-) (limited to 'Completion/Unix') diff --git a/ChangeLog b/ChangeLog index f0b8f2e12..5d3bf4933 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2017-10-10 Oliver Kiddle + * 41853: Completion/Unix/Command/_texinfo: update options for + texinfo 6.5 and complete also for the pinfo info reader + * 41849: Completion/Unix/Command/_unexpand: handle both unexpand and expand in a single function: they have some commonalities and it dodges around the clash with the _expand completer diff --git a/Completion/Unix/Command/_texinfo b/Completion/Unix/Command/_texinfo index 57e13bdc2..b356ddbe7 100644 --- a/Completion/Unix/Command/_texinfo +++ b/Completion/Unix/Command/_texinfo @@ -1,4 +1,4 @@ -#compdef info tkinfo install-info makeinfo texi2any texi2dvi pdftexi2dvi texi2pdf texindex +#compdef info tkinfo pinfo install-info makeinfo texi2any texi2dvi pdftexi2dvi texi2pdf texindex _info_nodes_caching_policy() { local dir oldp @@ -45,6 +45,7 @@ case $service in '(: - -h --help)'{-h,--help}'[display usage]' \ '(-o --output -O)--index-search=[go directly to node if found]:search string: ' \ '(--index-search -o --output -O)'{-o+,--output=}'[dump selected nodes to filename]:filename:_files -g "*(-.)"' \ + '--init-file=[specify initialisation file]:file:_files' \ '(-n --node)'{-n+,--node=}'[specify nodes in first visited Info file]:node:->nodes' \ '--no-raw-escapes[output escapes as literal text]' \ '--restore=[read keystrokes from file]:filename:_files -g "*(-.)"' \ @@ -91,7 +92,7 @@ case $service in '--description=[specify description for menu entry]:description' \ '(2)--dir-file=[specify dir file]:dir file:_files -g "dir(-.)"' \ '(--test --dry-run)'{--dry-run,--test}"[don't update dir file]" \ - \*{--entry,--info}'[specify directory entry to add]:text' \ + \*{--entry,--item}'[specify directory entry to add]:text' \ '--defsection=[like --section, but only use text if no sections present in info file]:text' \ {--maxwidth,--max-width}'=[specify maximum width of dir file]:width' \ '(- 1 2)--help[display help information]' \ @@ -99,9 +100,10 @@ case $service in '(2)--info-dir=[specify directory containing dir file]:info directory:_files -/' \ '--keep-old=[inhibit replacement of existing entries/removal of empty sections]' \ '(--name --menuentry)'{--name,--menuentry}'=[specify the menu entry for dir file]:menu entry' \ - "--no-indent[don't format new entries in the DIR file]" + "--no-indent[don't format new entries in the DIR file]" \ '--quiet[suppress warnings]' \ '--regex=[specify sections for file entries using a regex]:regex' \ + '--remove-exactly[delete existing entries taking exact entry name]' \ '(--delete --remove)--section=[put new entries in specified section]:section' \ '--silent[no output except errors]' \ '(- 1 2)--version[display version information]' \ @@ -135,11 +137,13 @@ case $service in '(-E --macro-expand)'{-E,--macro-expand}'[output macro-expanded source to specified file]:file:_files' \ '(--docbook --xml)--no-split[suppress splitting of output]' \ '--no-number-sections[output chapter and section numbers]' \ + '!(--no-number-sections)--number-sections' \ '(-o --output=)'{-o,--output}'[specify output file]:output file:_files' \ '(--docbook --html --xml)--disable-encoding[output special characters]' \ - '(--docbook --html --xml)--fill-column=[specify width to break lines at]:width' \ + '!(--disable-encoding)--enable-encoding' \ + '(--docbook --html --xml)--fill-column=[specify width to break lines at]:width [72]' \ '(--docbook --html --xml)--footnote-style=[specify style for output of footnotes]:((separate\:in\ own\ node end\:at\ end\ of\ node))' \ - '(--docbook --html --xml)--paragraph-indent=[specify spaces to indent paragraphs by]' \ + '(--docbook --html --xml)--paragraph-indent=[specify spaces to indent paragraphs by]:indent [3]' \ '(--docbook --html --xml)--split-size=[split Info files at specified size]:size [300000]' \ '(--docbook --xml --plaintext)--css-include=[specify file in include in HTML