zsh-workers
 help / color / mirror / code / Atom feed
6635181bc2427adb0cd32437c33d83ba6886d0ee blob 2395 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
 
#compdef htop pcp-htop

# Notes:
# - htop allows long options to be passed with a single dash; we don't account
#   for this
# - htop parses optional arguments to -H and -u 'cleverly' by allowing the next
#   word to be the optarg if it doesn't begin with a '-'; we don't fully account
#   for this
# - There is a special version of htop designed to be used with PCP (Performance
#   CoPilot); we don't fully account for this
# - Some of the ranges and defaults listed here had to be found in the source

local MATCH MBEGIN MEND ret=1
local -a context line state state_descr args tmp

args=(
  '(-d --delay)'{-d+,--delay=}'[specify update frequency]:delay (tenths of seconds) (1-100) [15]'
  '(-C --no-color --no-colour)'{-C,--no-colo{,u}r}'[use monochrome colour scheme]'
  '(-F --filter)'{-F+,--filter=}'[show only commands matching specified filter]:case-insensitive command-line sub-string:_process_names -a'
  '(-)'{-h,--help}'[display usage information]'
  '(-H --highlight-changes)'{-H+,--highlight-changes=}'[highlight new and old processes (optionally specify delay)]::delay (seconds) (1-86400) [5]'
  '(-M --no-mouse)'{-M,--no-mouse}'[disable mouse]'
  \*{-p+,--pid=}'[show only specified PIDs]: : _sequence _pids'
  '--readonly[disable all system and process changing features]'
  '(-s --sort-key)'{-s+,--sort-key=}'[sort by specified column]: :->sort-keys'
  '(-t --tree)'{-t,--tree}'[show tree view of processes]'
  '(-u --user)'{-u+,--user=}'[show only processes of current or specified user]:: : _users'
  '(-U --no-unicode)'{-U,--no-unicode}'[disable Unicode]'
  '(-)'{-V,--version}'[display version information]'
)

[[ $OSTYPE == linux* ]] &&
(( ! EUID || $+_comp_priv_prefix )) &&
_pick_variant libcap=drop-capabilities $OSTYPE --help &&
args+=(
  '--drop-capabilities=-[drop specified capabilties]::mode [basic]:((
    off\:"do not drop capabilities"
    basic\:"drop capabilities not needed for standard functionality (retains kill, renice, etc.)"
    strict\:"drop capabilities not needed for core functionality"
  ))'
)

_arguments -s -S : $args && ret=0

case $state in
  sort-keys)
    tmp=( ${(f)"$(_call_program sort-keys $words[1] --sort-key help)"} )
    tmp=( ${tmp/#[[:space:]]##} )
    tmp=( ${tmp//:/\\:} )
    tmp=( ${tmp/[[:space:]]##/:} )
    tmp=( ${tmp/(#m):[A-Z]/${(L)MATCH}} )
    _describe -t sort-keys 'column (key)' tmp && ret=0
    ;;
esac

return ret
debug log:

solving 6635181bc ...
found 6635181bc in https://inbox.vuxu.org/zsh-workers/77cc388c-7acc-40ad-bd59-40b3d2bc4f29@www.fastmail.com/
found 28c7512bf in https://git.vuxu.org/mirror/zsh/
preparing index
index prepared:
100644 28c7512bf687a1ea5ebe427c7e649468980b5505	Completion/Linux/Command/_htop

applying [1/1] https://inbox.vuxu.org/zsh-workers/77cc388c-7acc-40ad-bd59-40b3d2bc4f29@www.fastmail.com/
diff --git a/Completion/Linux/Command/_htop b/Completion/Linux/Command/_htop
index 28c7512bf..6635181bc 100644

warning: core.fsyncObjectFiles is deprecated; use core.fsync instead
Checking patch Completion/Linux/Command/_htop...
Applied patch Completion/Linux/Command/_htop cleanly.

index at:
100644 6635181bc2427adb0cd32437c33d83ba6886d0ee	Completion/Linux/Command/_htop

Code repositories for project(s) associated with this inbox:

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).