??????????????????????????????? ??????????????????????????????? ??????????????????????????????? >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>. ??????????????????????????????? ??????????????????????????????? ??????????????????????????????? ??????????????????????????????? ??????????????????????????????? ??????????????????????????????? >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>. >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< site-functions/_systemd-run000064400000006100152626764570012113 0ustar00#compdef systemd-run # SPDX-License-Identifier: LGPL-2.1+ __systemctl() { local -a _modes _modes=("--user" "--system") systemctl ${words:*_modes} --full --no-legend --no-pager "$@" 2>/dev/null } __get_slices () { __systemctl list-units --all -t slice \ | { while read -r a b; do echo $a; done; }; } __slices () { local -a _slices _slices=(${(fo)"$(__get_slices)"}) typeset -U _slices _describe 'slices' _slices } _arguments \ {-h,--help}'[Show help message]' \ '--version[Show package version]' \ '--user[Run as user unit]' \ {-H+,--host=}'[Operate on remote host]:[user@]host:_sd_hosts_or_user_at_host' \ {-M+,--machine=}'[Operate on local container]:machines:_sd_machines' \ '--scope[Run this as scope rather than service]' \ '--unit=[Run under the specified unit name]:unit name' \ {-p+,--property=}'[Set unit property]:NAME=VALUE:(( \ CPUAccounting= MemoryAccounting= BlockIOAccounting= SendSIGHUP= \ SendSIGKILL= MemoryLimit= CPUShares= BlockIOWeight= User= Group= \ DevicePolicy= KillMode= DeviceAllow= BlockIOReadBandwidth= \ BlockIOWriteBandwidth= BlockIODeviceWeight= Nice= Environment= \ KillSignal= LimitCPU= LimitFSIZE= LimitDATA= LimitSTACK= \ LimitCORE= LimitRSS= LimitNOFILE= LimitAS= LimitNPROC= \ LimitMEMLOCK= LimitLOCKS= LimitSIGPENDING= LimitMSGQUEUE= \ LimitNICE= LimitRTPRIO= LimitRTTIME= PrivateTmp= PrivateDevices= \ PrivateNetwork= NoNewPrivileges= WorkingDirectory= RootDirectory= \ TTYPath= SyslogIdentifier= SyslogLevelPrefix= SyslogLevel= \ SyslogFacility= TimerSlackNSec= OOMScoreAdjust= ReadWritePaths= \ ReadOnlyPaths= InaccessiblePaths= EnvironmentFile= \ ProtectSystem= ProtectHome= RuntimeDirectory= PassEnvironment= \ ))' \ '--description=[Description for unit]:description' \ '--slice=[Run in the specified slice]:slices:__slices' \ {-r,--remain-after-exit}'[Leave service around until explicitly stopped]' \ '--send-sighup[Send SIGHUP when terminating]' \ '--service-type=[Service type]:type:(simple forking oneshot dbus notify idle)' \ '--uid=[Run as system user]:user:_users' \ '--gid=[Run as system group]:group:_groups' \ '--nice=[Nice level]:nice level' \ '--setenv=[Set environment]:NAME=VALUE' \ '--on-active=[Run after SEC seconds]:SEC' \ '--on-boot=[Run SEC seconds after machine was booted up]:SEC' \ '--on-startup=[Run SEC seconds after systemd was first started]:SEC' \ '--on-unit-active=[Run SEC seconds after the last activation]:SEC' \ '--on-unit-inactive=[Run SEC seconds after the last deactivation]:SEC' \ '--on-calendar=[Realtime timer]:SPEC' \ '--timer-property=[Set timer unit property]:NAME=VALUE' \ '--wait=[Wait until service stopped again]' \ '*::command:_command' site-functions/_journalctl000064400000013527152626764570012011 0ustar00#compdef journalctl # SPDX-License-Identifier: LGPL-2.1+ _list_fields() { local -a journal_fields journal_fields=(MESSAGE{,_ID} PRIORITY CODE_{FILE,LINE,FUNC} ERRNO SYSLOG_{FACILITY,IDENTIFIER,PID} _{P,U,G}ID _COMM _EXE _CMDLINE _AUDIT_{SESSION,LOGINUID} _SYSTEMD_{CGROUP,SESSION,UNIT,OWNER_UID} _SYSTEMD_USER_UNIT USER_UNIT _SELINUX_CONTEXT _SOURCE_REALTIME_TIMESTAMP _{BOOT,MACHINE}_ID _HOSTNAME _TRANSPORT _KERNEL_{DEVICE,SUBSYSTEM} _UDEV_{SYSNAME,DEVNODE,DEVLINK} __CURSOR __{REALTIME,MONOTONIC}_TIMESTAMP) case $_jrnl_none in yes) _values -s '=' 'possible fields' \ "${journal_fields[@]}:value:_journal_fields ${words[CURRENT]%%=*}" ;; *) _describe 'possible fields' journal_fields ;; esac } _journal_none() { local -a _commands _files _jrnl_none # Setting use-cache will slow this down considerably _commands=( ${"$(_call_program commands "$service $_sys_service_mgr -F _EXE" 2>/dev/null)"} ) _jrnl_none='yes' _alternative : \ 'files:/dev files:_files -W /dev -P /dev/' \ "commands:commands:($_commands[@])" \ 'fields:fields:_list_fields' } _journal_fields() { local -a _fields cmd cmd=("journalctl $_sys_service_mgr" "-F ${@[-1]}" "2>/dev/null" ) _fields=$(_call_program fields $cmd[@]) _fields=${_fields//'\'/'\\'} _fields=${_fields//':'/'\:'} _fields=( ${(f)_fields} ) typeset -U _fields _describe 'possible values' _fields } _journal_boots() { local -a _bootid _previousboots _bootid=( ${(f)"$(_call_program bootid "$service -F _BOOT_ID")"} ) _previousboots=( -{1..${#_bootid}} ) _alternative : \ "offsets:boot offsets:compadd -a '_previousboots[1,-2]'" \ "bootid:boot ids:compadd -a _bootid" } # Build arguments for "journalctl" to be used in completion. # Use both --user and --system modes, they are not exclusive. local -a _modes; _modes=(--user --system) local -a _modes_with_arg; _modes_with_arg=(--directory -D --file -M --machine --root) typeset -a _sys_service_mgr local w k v i=0 n=$#words while (( i++ < n )); do w=$words[$i] if (( $_modes[(I)$w] )); then _sys_service_mgr+=($w) else # Handle options with arguments. "--key=value" and "--key value". k=${w%%=*} if (( ${_modes_with_arg[(I)$k]} )); then v=${w#*=} if [[ "$k" != "$w" ]]; then # "--key=value" style. _sys_service_mgr+=($w) else # "--key value" style. _sys_service_mgr+=($w ${words[((++i))]}) fi fi fi done _arguments -s \ {-h,--help}'[Show this help]' \ '--version[Show package version]' \ '--no-pager[Do not pipe output into a pager]' \ {-l,--full}'[Show long fields in full]' \ {-a,--all}'[Show all fields, including long and unprintable]' \ {-f,--follow}'[Follow journal]' \ {-e,--pager-end}'[Jump to the end of the journal in the pager]' \ {-n+,--lines=}'[Number of journal entries to show]:integer' \ '--no-tail[Show all lines, even in follow mode]' \ {-r,--reverse}'[Reverse output]' \ {-o+,--output=}'[Change journal output mode]:output modes:_sd_outputmodes' \ {-x,--catalog}'[Show explanatory texts with each log line]' \ {-q,--quiet}"[Don't show privilege warning]" \ {-m,--merge}'[Show entries from all available journals]' \ {-b+,--boot=}'[Show data only from the specified boot or offset]::boot id or offset:_journal_boots' \ '--list-boots[List boots ordered by time]' \ {-k,--dmesg}'[Show only kernel messages from the current boot]' \ {-u+,--unit=}'[Show data only from the specified unit]:units:_journal_fields _SYSTEMD_UNIT' \ '--user-unit=[Show data only from the specified user session unit]:units:_journal_fields USER_UNIT' \ {-p+,--priority=}'[Show only messages within the specified priority range]:priority:_journal_fields PRIORITY' \ {-t+,--identifier=}'[Show only messages with the specified syslog identifier]:identifier:_journal_fields SYSLOG_IDENTIFIER' \ {-c+,--cursor=}'[Start showing entries from the specified cursor]:cursors:_journal_fields __CURSORS' \ '--after-cursor=[Start showing entries from after the specified cursor]:cursors:_journal_fields __CURSORS' \ '--since=[Start showing entries on or newer than the specified date]:YYYY-MM-DD HH\:MM\:SS' \ '--until=[Stop showing entries on or older than the specified date]:YYYY-MM-DD HH\:MM\:SS' \ {-F,--field=}'[List all values a certain field takes]:Fields:_list_fields' \ '--system[Show system and kernel messages]' \ '--user[Show messages from user services]' \ '(--directory -D -M --machine --root --file)'{-M+,--machine=}'[Operate on local container]:machines:_sd_machines' \ '(--directory -D -M --machine --root --file)'{-D+,--directory=}'[Show journal files from directory]:directories:_directories' \ '(--directory -D -M --machine --root --file)--root=[Operate on catalog hierarchy under specified directory]:directories:_directories' \ '(--directory -D -M --machine --root)*--file=[Operate on specified journal files]:file:_files' \ '--new-id128[Generate a new 128 Bit ID]' \ '--header[Show journal header information]' \ '--disk-usage[Show total disk usage]' \ '--list-catalog[List messages in catalog]' \ '--dump-catalog[Dump messages in catalog]' \ '--update-catalog[Update binary catalog database]' \ '--setup-keys[Generate a new FSS key pair]' \ '--force[Force recreation of the FSS keys]' \ '--interval=[Time interval for changing the FSS sealing key]:time interval' \ '--verify[Verify journal file consistency]' \ '--verify-key=[Specify FSS verification key]:FSS key' \ '*::default: _journal_none' site-functions/_systemd-delta000064400000001064152626764570012404 0ustar00#compdef systemd-delta # SPDX-License-Identifier: LGPL-2.1+ _delta_type() { local -a _delta_types _delta_types=(masked equivalent redirected overridden unchanged) _values -s , "${_delta_types[@]}" } _arguments \ {-h,--help}'[Show this help]' \ '--version[Show package version]' \ '--no-pager[Do not pipe output into a pager]' \ '--diff=[Show a diff when overridden files differ]:boolean:(1 0)' \ {-t+,--type=}'[Only display a selected set of override types]:types:_delta_type' \ ':SUFFIX:(tmpfiles.d sysctl.d systemd/system)' site-functions/_pcp000064400000173067152626764570010424 0ustar00#compdef pcp pcp2elasticsearch pcp2graphite pcp2influxdb pcp2json pcp2spark pcp2xlsx pcp2xml pcp2zabbix pmafm pmchart pmclient pmclient_fg=pmclient pmdbg pmdiff pmdumplog pmdumptext pmerr pmevent=pmval pmfind pmie pmie2col pmiectl=pmlogctl pminfo pmiostat pmjson pmlc pmlogcheck pmlogctl pmlogextract pmlogger pmloglabel pmlogpaste pmlogreduce pmlogsize pmlogsummary pmprobe pmrep pmseries pmstat pmstore pmval # # PCP completions for zsh . # # Started by Marko Myllynen 2016. # # Configuration: # # * PCP offers a *lot* of metrics, hence something like 'pminfo ' # returns a lot of possible completions. If you wish to complete # metrics piecewise instead of using their complete names (meaning # that 'pminfo me' will offer only 'mem.' not all the metrics # under 'mem'), this can be enabled with: # # % zstyle ':completion:*:*:pcp:metrics' full-names off # # In both modes partial word completion is enabled (meaning that when # completing 'pminfo m.u.f' it expands to 'pminfo mem.util.free'. # # * Container completion offers by default the names of running # containers while IDs are also recognized if being completed. To use # IDs instead of names (but still recognize names, too), set: # # % zstyle ':completion:*:*:pcp:containers' use-ids on # # _pcp () { local curcontext="$curcontext" state line expl ret=1 local common_help common_most common_pmda arch_req=0 declare -A opt_args local -a py_tools py_tools=(pcp2elasticsearch pcp2graphite pcp2influxdb pcp2json pcp2spark pcp2xlsx pcp2xml pcp2zabbix pmrep) local exargs="-? --help -V --version" common_help=( '(- *)'{-\?,--help}'[display help message]' '(- *)'{-V,--version}'[display version number]' ) common_most=( "(--container -h --host -L --local-PMDA -K --spec-local $exargs)"\*{-a+,--archive=}'[specify metrics source archive]:archive:->archives' "(-h --host -a --archive -L --local-PMDA -K --spec-local $exargs)"{-h+,--host=}'[specify metrics source host]:host:_hosts' "(-z --hostzone -Z --timezone $exargs)"{-z,--hostzone}'[use metrics source timezone]' "(-Z --timezone -z --hostzone $exargs)"{-Z+,--timezone=}'[set reporting timezone]:timezone:_time_zone' "(-s --samples $exargs)"{-s+,--samples=}'[specify number of samples]:samples:' "(-t --interval $exargs)"{-t+,--interval=}'[specify sampling interval]:interval:' "(-A --align $exargs)"{-A+,--align=}'[set initial sample time alignment]:timespec:' "(-S --start $exargs)"{-S+,--start=}'[set start of time window]:timespec:' "(-T --finish $exargs)"{-T+,--finish=}'[set end of time window]:timespec:' "(-O --origin $exargs)"{-O+,--origin=}'[set initial sample time origin]:timespec:' ) common_pmda=( "(-L --local-PMDA -a --archive -h --host $exargs)"{-L,--local-PMDA}'[use local DSO PMDAs as metrics source]' "(-a --archive -h --host $exargs)"\*{-K+,--spec-local=}'[define PMDA spec for local DSO PMDAs]:spec:(add del clear)' ) common_python=( "(--archive-folio --container -h --host -L --local-PMDA -K --spec-local $exargs)"\*{-a+,--archive=}'[specify metrics source archive]:archive:->archives' "(--archive-folio -a --archive --container -h --host -L --local-pmda -K --spec-local $exargs)"--archive-folio=+'[specify metrics source folio]:folio:_files' "(--container -a --archive --archive-folio -d --delay -u --no-interpol $exargs)"--container=+'[specify container to query]:container:->containers' "(-h --host -a --archive --archive-folio -L --local-PMDA -K --spec-local $exargs)"{-h+,--host=}'[specify metrics source host]:host:_hosts' "(--daemonize $exargs)"--daemonize'[daemonize on startup]' "(-s --samples $exargs)"{-s+,--samples=}'[specify number of samples]:samples:' "(-t --interval $exargs)"{-t+,--interval=}'[specify sampling interval]:interval:' "(-A --align $exargs)"{-A+,--align=}'[set initial sample time alignment]:timespec:' "(-S --start $exargs)"{-S+,--start=}'[set start of time window]:timespec:' "(-T --finish $exargs)"{-T+,--finish=}'[set end of time window]:timespec:' "(-O --origin $exargs)"{-O+,--origin=}'[set initial sample time origin]:timespec:' "(-c --config $exargs)"{-c+,--config=}'[specify config file]:file:_files' "(-C --check $exargs)"{-C,--check}'[check config only]' "($exargs)"\*{-e+,--derived=}'[derived metrics definitions]:file or formula:_files' "(-H --no-header $exargs)"{-H,--no-header}'[omit headers]' "(-G --no-globals $exargs)"{-G,--no-globals}'[omit global metrics]' "(-r --raw -R --raw-prefer $exargs)"{-r,--raw}'[force reporting raw values]' "(-R --raw-prefer -r --raw $exargs)"{-R,--raw-prefer}'[prefer reporting raw values]' "(-I --ignore-incompat $exargs)"{-I,--ignore-incompat}'[ignore incompatible metrics]' "(-5 --ignore-unknown $exargs)"{-5,--ignore-unknown}'[ignore unknown metrics]' "(-4 --names-change $exargs)"{-4+,--names-change=}'[update/ignore/abort on metric name changes]:action:(abort ignore update)' "($exargs)"\*{-i+,--instances=}'[specify instances to report]:instances:->instances' "(-v --omit-flat $exargs)"{-v,--omit-flat}'[omit single-valued metrics]' "(-P --precision $exargs)"{-P+,--precision=}'[set default floating point precision]:precision:' "(-0 --precision-force $exargs)"{-0+,--precision-force=}'[set forced floating point precision]:precision:' "(-q --count-scale -Q --count-scale-force $exargs)"{-q+,--count-scale=}'[set default count unit]:scale:->scales_count' "(-Q --count-scale-force -q --count-scale $exargs)"{-Q+,--count-scale-force=}'[set forced count unit]:scale:->scales_count' "(-b --space-scale -B --space-scale-force $exargs)"{-b+,--space-scale=}'[set default space unit]:scale:->scales_space' "(-B --space-scale-force -b --space-scale $exargs)"{-B+,--space-scale-force=}'[set forced space unit]:scale:->scales_space' "(-y --time-scale -Y --time-scale-force $exargs)"{-y+,--time-scale=}'[set default time unit]:scale:->scales_time' "(-Y --time-scale-force -y --time-scale $exargs)"{-Y+,--time-scale-force=}'[set forced time unit]:scale:->scales_time' ) case $service in pcp) if (( ! $+_cache_pcp_cmds )); then _cache_pcp_cmds=( ${="$(pcp --help 2>&1)"#*Available Commands:} ) fi if (( ! $+_cache_pcp_cmdopts )); then typeset -gA _cache_pcp_cmdopts fi _arguments -A "-*" -C -S -s \ "$common_help[@]" \ "$common_most[@]" \ "(-g --guimode $exargs)"{-g,--guimode}'[GUI mode with new time control]' \ "(-L --local-PMDA -a --archive -h --host -H --hostsfile $exargs)"{-L,--local-PMDA}'[use local DSO PMDAs as metrics source]' \ "(-p --guiport $exargs)"{-p+,--guiport=}'[specify existing time control port]:port:' \ "(-n --namespace $exargs)"{-n+,--namespace=}'[specify alternative PMNS]:pmnsfile:_files' \ - set1 \ '1:command:->pcp_commands' \ - set2 \ "(-P --pmie $exargs)"{-P,--pmie}'[display pmie evaluation statistics]' \ && return 0 # We accept only PCP command options after the first non-option argument # (i.e., the PCP command itself), this makes it so with the -A "-*" above [[ -z $state ]] && state=pcp_cmdopts ;; pcp2elasticsearch) _arguments -C -S -s \ "$common_help[@]" \ "$common_pmda[@]" \ "$common_python[@]" \ "(-j --live-filter $exargs)"{-j,--live-filter}'[perform instance live filtering]' \ "(-J --rank $exargs)"{-J+,--rank=}'[set limit for results of valued instances]:limit:' \ "(-8 --limit-filter -9 --limit-filter-force $exargs)"{-8+,--limit-filter=}'[set default limit filter]:limit:' \ "(-9 --limit-filter-force -8 --limit-filter $exargs)"{-9+,--limit-filter-force=}'[set forced limit filter]:limit:' \ "(-m --include-labels -m --include-labels $exargs)"{-m,--include-labels}'[include labels]' \ "(-n --invert-filter $exargs)"{-n,--invert-filter}'[perform ranking before live filtering]' \ "(-N --predicate $exargs)"{-N+,--predicate=}'[specify predicate metric]:metric:->metrics' \ "(-g --es-host $exargs)"{-g+,--es-host=}'[elasticsearch server]:host:_hosts' \ "(-x --es-index $exargs)"{-x+,--es-index=}'[elasticsearch index]:index:' \ "(-X --es-hostid $exargs)"{-X+,--es-hostid=}'[elasticsearch host-id]:host-id:' \ "(-p --es-search-type $exargs)"{-p+,--es-search-type=}'[elasticsearch search type]:type:' \ '*:metric:->metrics' \ && return 0 ;; pcp2graphite) _arguments -C -S -s \ "$common_help[@]" \ "$common_pmda[@]" \ "$common_python[@]" \ "(-j --live-filter $exargs)"{-j,--live-filter}'[perform instance live filtering]' \ "(-J --rank $exargs)"{-J+,--rank=}'[set limit for results of valued instances]:limit:' \ "(-8 --limit-filter -9 --limit-filter-force $exargs)"{-8+,--limit-filter=}'[set default limit filter]:limit:' \ "(-9 --limit-filter-force -8 --limit-filter $exargs)"{-9+,--limit-filter-force=}'[set forced limit filter]:limit:' \ "(-n --invert-filter $exargs)"{-n,--invert-filter}'[perform ranking before live filtering]' \ "(-N --predicate $exargs)"{-N+,--predicate=}'[specify predicate metric]:metric:->metrics' \ "(-E --text-port -p --pickle-port -X --pickle-protocol $exargs)"{-E+,--text-port=}'[graphite plaintext port]:port:' \ "(-g --graphite-host $exargs)"{-g+,--graphite-host=}'[graphite server]:host:_hosts' \ "(-p --pickle-port -E --text-port $exargs)"{-p+,--pickle-port=}'[graphite pickle port]:port:' \ "(-x --prefix $exargs)"{-x+,--prefix=}'[prefix for metric names]:port:' \ "(-X --pickle-protocol -E --text-port $exargs)"{-X+,--pickle-protocol=}'[pickle protocol version]:protocol:' \ '*:metric:->metrics' \ && return 0 ;; pcp2influxdb) _arguments -C -S -s \ "$common_help[@]" \ "$common_pmda[@]" \ "$common_python[@]" \ "(-j --live-filter $exargs)"{-j,--live-filter}'[perform instance live filtering]' \ "(-J --rank $exargs)"{-J+,--rank=}'[set limit for results of valued instances]:limit:' \ "(-8 --limit-filter -9 --limit-filter-force $exargs)"{-8+,--limit-filter=}'[set default limit filter]:limit:' \ "(-9 --limit-filter-force -8 --limit-filter $exargs)"{-9+,--limit-filter-force=}'[set forced limit filter]:limit:' \ "(-n --invert-filter $exargs)"{-n,--invert-filter}'[perform ranking before live filtering]' \ "(-N --predicate $exargs)"{-N+,--predicate=}'[specify predicate metric]:metric:->metrics' \ "(-E --db-pass $exargs)"{-E+,--db-pass=}'[password for database]:password:' \ "(-g --db-server $exargs)"{-g+,--db-server=}'[server URL]:url:_urls' \ "(-U --db-user $exargs)"{-U+,--db-user=}'[username for database]:username:_users' \ "(-x --db-name $exargs)"{-x+,--db-name=}'[metrics database name]:database:' \ "(-X --db-tags $exargs)"{-X+,--db-tags=}'[string of tags to add to the metrics]:tags:' \ '*:metric:->metrics' \ && return 0 ;; pcp2json) _arguments -C -S -s \ "$common_help[@]" \ "$common_pmda[@]" \ "$common_python[@]" \ "(-f --timestamp-format $exargs)"{-f+,--timestamp-format=}'[set time format string]:format:' \ "(-F --output-file $exargs)"{-F+,--output-file=}'[specify output file]:file:_files' \ "(-j --live-filter $exargs)"{-j,--live-filter}'[perform instance live filtering]' \ "(-J --rank $exargs)"{-J+,--rank=}'[set limit for results of valued instances]:limit:' \ "(-8 --limit-filter -9 --limit-filter-force $exargs)"{-8+,--limit-filter=}'[set default limit filter]:limit:' \ "(-9 --limit-filter-force -8 --limit-filter $exargs)"{-9+,--limit-filter-force=}'[set forced limit filter]:limit:' \ "(-m --include-labels -m --include-labels $exargs)"{-m,--include-labels}'[include labels]' \ "(-n --invert-filter $exargs)"{-n,--invert-filter}'[perform ranking before live filtering]' \ "(-N --predicate $exargs)"{-N+,--predicate=}'[specify predicate metric]:metric:->metrics' \ "(-x --extended -X --everything $exargs)"{-x,--extended}'[write extended information]' \ "(-X --everything -x --extended $exargs)"{-X,--everything}'[write everything, incl. internals]' \ "(-E --exact-types $exargs)"{-E,--exact-types}'[write numbers as number data types]' \ "(-z --hostzone -Z --timezone $exargs)"{-z,--hostzone}'[use metrics source timezone]' \ "(-Z --timezone -z --hostzone $exargs)"{-Z+,--timezone=}'[set reporting timezone]:timezone:_time_zone' \ '*:metric:->metrics' \ && return 0 ;; pcp2spark) _arguments -C -S -s \ "$common_help[@]" \ "$common_pmda[@]" \ "$common_python[@]" \ "(-j --live-filter $exargs)"{-j,--live-filter}'[perform instance live filtering]' \ "(-J --rank $exargs)"{-J+,--rank=}'[set limit for results of valued instances]:limit:' \ "(-8 --limit-filter -9 --limit-filter-force $exargs)"{-8+,--limit-filter=}'[set default limit filter]:limit:' \ "(-9 --limit-filter-force -8 --limit-filter $exargs)"{-9+,--limit-filter-force=}'[set forced limit filter]:limit:' \ "(-n --invert-filter $exargs)"{-n,--invert-filter}'[perform ranking before live filtering]' \ "(-N --predicate $exargs)"{-N+,--predicate=}'[specify predicate metric]:metric:->metrics' \ "(-g --spark-server $exargs)"{-g+,--spark-server=}'[spark server]:host:_hosts' \ "(-p --spark-port $exargs)"{-p+,--spark-port=}'[spark port]:port:' \ '*:metric:->metrics' \ && return 0 ;; pcp2xlsx) _arguments -C -S -s \ "$common_help[@]" \ "$common_pmda[@]" \ "$common_python[@]" \ "(-f --timestamp-format $exargs)"{-f+,--timestamp-format=}'[set time format string]:format:' \ "(-F --output-file $exargs)"{-F+,--output-file=}'[specify output file]:file:_files' \ "(-m --include-labels -m --include-labels $exargs)"{-m,--include-labels}'[include labels]' \ "(-z --hostzone -Z --timezone $exargs)"{-z,--hostzone}'[use metrics source timezone]' \ "(-Z --timezone -z --hostzone $exargs)"{-Z+,--timezone=}'[set reporting timezone]:timezone:_time_zone' \ '*:metric:->metrics' \ && return 0 ;; pcp2xml) _arguments -C -S -s \ "$common_help[@]" \ "$common_pmda[@]" \ "$common_python[@]" \ "(-f --timestamp-format $exargs)"{-f+,--timestamp-format=}'[set time format string]:format:' \ "(-F --output-file $exargs)"{-F+,--output-file=}'[specify output file]:file:_files' \ "(-j --live-filter $exargs)"{-j,--live-filter}'[perform instance live filtering]' \ "(-J --rank $exargs)"{-J+,--rank=}'[set limit for results of valued instances]:limit:' \ "(-8 --limit-filter -9 --limit-filter-force $exargs)"{-8+,--limit-filter=}'[set default limit filter]:limit:' \ "(-9 --limit-filter-force -8 --limit-filter $exargs)"{-9+,--limit-filter-force=}'[set forced limit filter]:limit:' \ "(-m --include-labels -m --include-labels $exargs)"{-m,--include-labels}'[include labels]' \ "(-n --invert-filter $exargs)"{-n,--invert-filter}'[perform ranking before live filtering]' \ "(-N --predicate $exargs)"{-N+,--predicate=}'[specify predicate metric]:metric:->metrics' \ "(-x --extended -X --everything $exargs)"{-x,--extended}'[write extended information]' \ "(-X --everything -x --extended $exargs)"{-X,--everything}'[write everything, incl. internals]' \ "(-z --hostzone -Z --timezone $exargs)"{-z,--hostzone}'[use metrics source timezone]' \ "(-Z --timezone -z --hostzone $exargs)"{-Z+,--timezone=}'[set reporting timezone]:timezone:_time_zone' \ '*:metric:->metrics' \ && return 0 ;; pcp2zabbix) _arguments -C -S -s \ "$common_help[@]" \ "$common_pmda[@]" \ "$common_python[@]" \ "(-j --live-filter $exargs)"{-j,--live-filter}'[perform instance live filtering]' \ "(-J --rank $exargs)"{-J+,--rank=}'[set limit for results of valued instances]:limit:' \ "(-8 --limit-filter -9 --limit-filter-force $exargs)"{-8+,--limit-filter=}'[set default limit filter]:limit:' \ "(-9 --limit-filter-force -8 --limit-filter $exargs)"{-9+,--limit-filter-force=}'[set forced limit filter]:limit:' \ "(-n --invert-filter $exargs)"{-n,--invert-filter}'[perform ranking before live filtering]' \ "(-N --predicate $exargs)"{-N+,--predicate=}'[specify predicate metric]:metric:->metrics' \ "(-E --zabbix-interval $exargs)"{-E+,--zabbix-interval=}'[send interval]:interval:' \ "(-g --zabbix-server $exargs)"{-g+,--zabbix-server=}'[zabbix server]:host:_hosts' \ "(-p --zabbix-port $exargs)"{-p+,--zabbix-port=}'[zabbix port]:port:' \ "(-x --zabbix-prefix $exargs)"{-x+,--zabbix-prefix=}'[prefix for metric names]:prefix:' \ "(-X --zabbix-host $exargs)"{-X+,--zabbix-host=}'[zabbix host-id]:host-id:' \ "(-l --zabbix-lld $exargs)"{-l,--zabbix-lld}'[enable low-level discovery]' \ '*:metric:->metrics' \ && return 0 ;; pmafm) _arguments -A "-*" \ '(- *)'{-\?,--help}'[display help message]' \ '1:folio:_files' \ '2:command:(archives check help hosts list quit remove repeat replay run selections)' \ && return 0 ;; pmchart) _arguments -C -S -s \ "$common_help[@]" \ "(-A --align $exargs)"{-A+,--align=}'[set initial sample time alignment]:timespec:' \ "(-h --host -H --hostsfile -L --local-PMDA -K --spec-local $exargs)"\*{-a+,--archive=}'[specify metrics source archive]:archive:->archives' \ "(-a --archive -L --local-PMDA -K --spec-local $exargs)"\*{-h+,--host=}'[specify metrics source host]:host:_hosts' \ "(-a --archive -L --local-PMDA -K --spec-local $exargs)"\*{-H+,--hostsfile=}'[specify metrics source hosts file]:file:_files' \ "(-n --namespace $exargs)"{-n+,--namespace=}'[specify alternative PMNS]:pmnsfile:_files' \ "(-a --archive -h --host -H --hostsfile $exargs)"\*{-K+,--spec-local=}'[define PMDA spec for local DSO PMDAs]:spec:(add del clear)' \ "(-L --local-PMDA -a --archive -h --host -H --hostsfile $exargs)"{-L,--local-PMDA}'[use local DSO PMDAs as metrics source]' \ "(-O --origin $exargs)"{-O+,--origin=}'[set initial sample time origin]:timespec:' \ "(-p --guiport $exargs)"{-p+,--guiport=}'[specify existing time control port]:port:' \ "(-S --start $exargs)"{-S+,--start=}'[set start of time window]:timespec:' \ "(-T --finish $exargs)"{-T+,--finish=}'[set end of time window]:timespec:' \ "(-t --interval $exargs)"{-t+,--interval=}'[specify sampling interval]:interval:' \ "(-Z --timezone -z --hostzone $exargs)"{-Z+,--timezone=}'[set reporting timezone]:timezone:_time_zone' \ "(-z --hostzone -Z --timezone $exargs)"{-z,--hostzone}'[use metrics source timezone]' \ "(-c --view $exargs)"\*{-c+,--view=}'[specify chart views to load]:file:_files' \ "(-C --check $exargs)"{-C,--check}'[check views only]' \ "(-F --font-size $exargs)"{-F+,--font-size=}'[specify font size]:size:' \ "(-f --font-family $exargs)"{-f+,--font-family=}'[specify font family]:family:_xft_fonts' \ "(-g --geometry $exargs)"{-g+,--geometry=}'[specify image geometry (WxH)]:geometry:' \ "(-o --output $exargs)"{-o+,--output=}'[specify output file]:file:_files' \ "(-s --samples $exargs)"{-s+,--samples=}'[buffer up N points of sample history]:samples:' \ "(-v --visible $exargs)"{-v+,--visible=}'[set points to display]:points:' \ "(-W --white $exargs)"{-W,--white}'[export using opaque (white) bg]' \ '*:source:_hosts' \ && return 0 ;; pmclient) _arguments -C -S -s \ "$common_help[@]" \ "$common_most[@]" \ "(-n --namespace $exargs)"{-n+,--namespace=}'[specify alternative PMNS]:pmnsfile:_files' \ "(-P --pause -h --host $exargs)"{-P,--pause}'[pause between updates in archive mode]' \ && return 0 ;; pmdbg) _arguments -A "-*" \ '(- *)'{-\?,--help}'[display help message]' \ '(- *)'{-g,--gdb}'[display expression for gdb]' \ '(- *)'{-o,--old}'[old and deprecated (bit-field) encodings]' \ '(- *)'{-l,--list}'[display values and text for all PCP debug options]' \ '(- *)'-D'[parse name]:name:( $(pmdbg -l -o | awk "/^DBG_/ {print \$1}" | sed -e "s,DBG_TRACE_,,g") )' \ '*:code:( $(pmdbg -l -o | awk "/^DBG_/ {print \$2}") )' \ && return 0 ;; pmdiff) _arguments -A "-*" -C -S -s \ "$common_help[@]" \ "(-d --keep $exargs)"{-d,--keep}'[debug, keep temp files]' \ "(-p --precision $exargs)"{-p+,--precision=}'[set floating point precision]:precision:' \ "(-q --threshold $exargs)"{-q+,--threshold=}'[specify reporting threshold]:threshold:' \ "(--skip-excluded $exargs)"--skip-excluded'[omit excluded metrics info]' \ "(--skip-missing $exargs)"--skip-missing'[omit missing metrics info]' \ "(-S --start $exargs)"{-S+,--start=}'[set start of time window]:timespec:' \ "(-T --finish $exargs)"{-T+,--finish=}'[set end of time window]:timespec:' \ "(-B --begin $exargs)"{-B+,--begin=}'[set start of second time window]:timespec:' \ "(-E --end $exargs)"{-E+,--end=}'[set end of time second window]:timespec:' \ "(-x $exargs)"-x+'[define exclude pattern]:regex:' \ "(-X $exargs)"-X+'[specify exclude pattern file]:file:_files' \ "(-Z --timezone -z --hostzone $exargs)"{-Z+,--timezone=}'[set reporting timezone]:timezone:_time_zone' \ "(-z --hostzone -Z --timezone $exargs)"{-z,--hostzone}'[use metrics source timezone]' \ '1:archive:->archives' \ '2:archive:->archives' \ && return 0 ;; pmdumplog) arch_req=1 _arguments -C -S -s \ "$common_help[@]" \ - set1 \ "(-a --all $exargs)"{-a,--all}'[dump everything]' \ "(-d --descs $exargs)"{-d,--descs}'[dump metric descriptions]' \ "(-e --labelsets $exargs)"{-e,--labelsets}'[dump all metric label metadata]' \ "(-h --helptext $exargs)"{-h,--helptext}'[dump all metric help text]' \ "(-I --on-disk-insts $exargs)"{-I,--on-disk-insts}'[dump on-disk instance domain descriptions]' \ "(-i --insts $exargs)"{-i,--insts}'[dump instance domain descriptions]' \ "(-L $exargs)"-L'[verbose label dump]' \ "(-l --label $exargs)"{-l,--label}'[dump archive log label]' \ "(-M --markrecs $exargs)"{-M,--markrecs}'[report records]' \ "(-m --metrics $exargs)"{-m,--metrics}'[dump values of metrics]' \ "(-n --namespace $exargs)"{-n+,--namespace=}'[specify alternative PMNS]:pmnsfile:_files' \ "(-r --reverse $exargs)"{-r,--reverse}'[reverse chronological order]' \ "(-S --start $exargs)"{-S+,--start=}'[set start of time window]:timespec:' \ "(-s --sizes $exargs)"{-s,--sizes}'[report data record sizes]' \ "(-T --finish $exargs)"{-T+,--finish=}'[set end of time window]:timespec:' \ "(-t $exargs)"-t'[dump temporal index]' \ "(-x $exargs)"-x'[include date in timestamps]' \ "(-Z --timezone -z --hostzone $exargs)"{-Z+,--timezone=}'[set reporting timezone]:timezone:_time_zone' \ "(-z --hostzone -Z --timezone $exargs)"{-z,--hostzone}'[use metrics source timezone]' \ '1:archive:->archives' \ '*:metric:->metrics' \ - set2 \ "(-v $exargs)"-v+'[specify log to dump as raw hex]:file:_files' \ && return 0 ;; pmdumptext) _arguments -C -S -s \ "$common_help[@]" \ "(-A --align $exargs)"{-A+,--align=}'[set initial sample time alignment]:timespec:' \ "(-h --host $exargs)"\*{-a+,--archive=}'[specify metrics source archive]:archive:->archives' \ "(-h --host -a --archive $exargs)"{-h+,--host=}'[specify metrics source host]:host:_hosts' \ "(-n --namespace $exargs)"{-n+,--namespace=}'[specify alternative PMNS]:pmnsfile:_files' \ "(-O --origin $exargs)"{-O+,--origin=}'[set initial sample time origin]:timespec:' \ "(-S --start $exargs)"{-S+,--start=}'[set start of time window]:timespec:' \ "(-s --samples $exargs)"{-s+,--samples=}'[specify number of samples]:samples:' \ "(-T --finish $exargs)"{-T+,--finish=}'[set end of time window]:timespec:' \ "(-t --interval $exargs)"{-t+,--interval=}'[specify sampling interval]:interval:' \ "(-Z --timezone -z --hostzone $exargs)"{-Z+,--timezone=}'[set reporting timezone]:timezone:_time_zone' \ "(-z --hostzone -Z --timezone $exargs)"{-z,--hostzone}'[use metrics source timezone]' \ "(-c --config $exargs)"{-c+,--config=}'[specify metrics list file]:file:_files' \ "(-C --check $exargs)"{-C,--check}'[check metrics only]' \ "(-d --delimiter $exargs)"{-d+,--delimiter=}'[set column delimiter]:delimiter:' \ "(-f --time-format $exargs)"{-f+,--time-format=}'[set time format string]:format:' \ "(-F --fixed $exargs)"{-F,--fixed}'[use fixed width values]' \ "(-G --scientific $exargs)"{-G,--scientific}'[use scientific format (if shorter)]' \ "(-H --headers $exargs)"{-H,--headers}'[show all headers]' \ "(-i --interactive $exargs)"{-i,--interactive}'[format output for interactive use]' \ "(-l --source $exargs)"{-l,--source}'[show metrics source]' \ "(-m --metrics $exargs)"{-m,--metrics}'[show metric names]' \ "(-M $exargs)"-M'[show complete metric names]' \ "(-N $exargs)"-N'[show normalizing factor]' \ "(-o --offset $exargs)"{-o,--offset}'[prefix timestamp with offset]' \ "(-P --precision $exargs)"{-P+,--precision=}'[set floating point precision]:precision:' \ "(-R --repeat $exargs)"{-R+,--repeat=}'[set header repeat frequency]:samples:' \ "(-r --raw $exargs)"{-r,--raw}'[report raw values]' \ "(-U --unavailable $exargs)"{-U+,--unavailable=}'[define string for unavailable values]:string:' \ "(-u --units $exargs)"{-u,--units}'[show metric units]' \ "(-w --width $exargs)"{-w+,--width=}'[set column width]:width:' \ "(-X --extended $exargs)"{-X,--extended}'[show extended metric names]' \ '*:metric:->metrics' \ && return 0 ;; pmerr) _arguments -A "-*" \ '(- *)'{-\?,--help}'[display help message]' \ '(- *)'{-l,--list}'[list known debug flags]' \ '*:code:( $(pmerr -l | awk "/ PM_ERR_/ {print \$1}") )' \ && return 0 ;; pmfind) _arguments -C -S -s \ "$common_help[@]" \ "(-m --mechanism $exargs)"{-m+,--mechanism=}'[specify service discovery mechanism]:mechanism:->pmfind_mechs' \ "(-r --resolve $exargs)"{-r,--resolve}'[resolve addresses]' \ "(-s --service $exargs)"{-s+,--service=}'[specify service to find]:service:(all pmcd pmproxy)' \ "(-t --timeout $exargs)"{-t+,--timeout=}'[set discovery timeout in seconds]:timeout:' \ "(-q --quiet $exargs)"{-q,--quiet}'[quiet mode]' \ "(-S --sources $exargs)"{-S,--sources}'[report source identifiers (pmcd service only)]' \ "(-C --containers $exargs)"{-C,--containers}'[report containers (pmcd service only)]' \ && return 0 ;; pmie) exargs="-? --help" _arguments -C -S -s \ '(- *)'{-\?,--help}'[display help message]' \ "(-A --align $exargs)"{-A+,--align=}'[set initial sample time alignment]:timespec:' \ "(-h --host $exargs)"\*{-a+,--archive=}'[specify metrics source archive]:archive:->archives' \ "(-a --archive $exargs)"{-h+,--host=}'[specify metrics source host]:host:_hosts' \ "(-n --namespace $exargs)"{-n+,--namespace=}'[specify alternative PMNS]:pmnsfile:_files' \ "(-O --origin $exargs)"{-O+,--origin=}'[set initial sample time origin]:timespec:' \ "(-S --start $exargs)"{-S+,--start=}'[set start of time window]:timespec:' \ "(-T --finish $exargs)"{-T+,--finish=}'[set end of time window]:timespec:' \ "(-t --interval $exargs)"{-t+,--interval=}'[specify sampling interval]:interval:' \ "(-Z --timezone -z --hostzone $exargs)"{-Z+,--timezone=}'[set reporting timezone]:timezone:_time_zone' \ "(-z --hostzone -Z --timezone $exargs)"{-z,--hostzone}'[use metrics source timezone]' \ "(-C --check $exargs)"{-C,--check}'[check config only]' \ "(-c --config $exargs)"{-c+,--config=}'[specify config file]:file:_files' \ "(-d --interact $exargs)"{-d,--interact}'[interactive debugging mode]' \ "(-f --foreground $exargs)"{-f,--foreground}'[run in foreground]' \ "(-F --systemd $exargs)"{-F,--systemd}'[notify service manager (if any) when started and ready]' \ "(-P --primary $exargs)"{-P,--primary}'[run as primary pmie instance]' \ "(-j $exargs)"-j+'[specify stomp protocol file]:file:_files' \ "(-l --logfile $exargs)"{-l+,--logfile=}'[specify log file]:file:_files' \ "(-U --username $exargs)"{-U+,--username=}'[specify username to run as]:user:_users' \ "(-b --buffer $exargs)"{-b,--buffer}'[use line buffered output]' \ "(-e --timestamp $exargs)"{-e,--timestamp}'[print timestamps in verbose mode]' \ "(-q --quiet $exargs)"{-q,--quiet}'[quiet mode]' \ "(-v $exargs)"-v'[verbose mode]' \ "(-V --verbose $exargs)"{-V,--verbose}'[more verbose mode]' \ "(-W $exargs)"-W'[most verbose mode]' \ "(-X --secret-applet -x --secret-agent $exargs)"{-X,--secret-applet}'[run in thin client mode]' \ "(-x --secret-agent -X --secret-applet $exargs)"{-x,--secret-agent}'[run in domain agent mode]' \ '*:config:_files' \ && return 0 ;; pmie2col) exargs="-? --help" _arguments -A "-*" -S -s \ '(- *)'{-\?,--help}'[display help message]' \ "(-d --delimiter $exargs)"{-d+,--delimiter=}'[specify output delimiter character]:delimiter:' \ "(-p --precision $exargs)"{-p+,--precision=}'[specify output floating point precision]:precision:' \ "(-w --width $exargs)"{-w+,--width=}'[specify output column width]:width:' \ && return 0 ;; pminfo) _arguments -C -S -s \ "$common_help[@]" \ "(--container -h --host -L --local-PMDA -K --spec-local $exargs)"\*{-a+,--archive=}'[specify metrics source archive]:archive:->archives' \ "(-h --host -a --archive -L --local-PMDA -K --spec-local $exargs)"{-h+,--host=}'[specify metrics source host]:host:_hosts' \ "(--container -a --archive $exargs)"--container=+'[specify container to query]:container:->containers' \ "(-L --local-PMDA -a --archive -h --host $exargs)"{-L,--local-PMDA}'[use local DSO PMDAs as metrics source]' \ "(-a --archive -h --host $exargs)"\*{-K+,--spec-local=}'[define PMDA spec for local DSO PMDAs]:spec:(add del clear)' \ "(-n --namespace -N --uniqnames $exargs)"{-n+,--namespace=}'[specify alternative PMNS]:pmnsfile:_files' \ "(-N --uniqnames -n --namespace $exargs)"{-N+,--uniqnames=}'[specify alt. PMNS with unique PMID names]:pmnsfile:_files' \ "(-O --origin $exargs)"{-O+,--origin=}'[set initial sample time origin]:timespec:' \ "(-Z --timezone -z --hostzone $exargs)"{-Z+,--timezone=}'[set reporting timezone]:timezone:_time_zone' \ "(-z --hostzone -Z --timezone $exargs)"{-z,--hostzone}'[use metrics source timezone]' \ "(-b --batch $exargs)"{-b+,--batch=}'[set fetch batch size]:size:' \ "(-d --desc $exargs)"{-d,--desc}'[print metric description]' \ "(-f --fetch $exargs)"{-f,--fetch}'[fetch and print metric values]' \ "(-F --fetchall $exargs)"{-F,--fetchall}'[fetch and print all metric values]' \ "(-I --fullindom $exargs)"{-I,--fullindom}'[print InDom in verbose format]' \ "(-l --labels $exargs)"{-l,--labels}'[print metric value labels]' \ "(-m --pmid $exargs)"{-m,--pmid}'[print PMID]' \ "(-M --fullpmid $exargs)"{-M,--fullpmid}'[print PMID verbosely]' \ "(-s --series $exargs)"{-s,--series}'[print source, metric and instance series identifiers]' \ "(-t --oneline $exargs)"{-t,--oneline}'[print terse help text]' \ "(-T --helptext $exargs)"{-T,--helptext}'[print verbose help text]' \ "(-c --derived $exargs)"{-c+,--derived=}'[specify derived metrics config]:file:_files' \ "(-x --events $exargs)"{-x,--events}'[unpack and report events]' \ "(-v --verify $exargs)"{-v,--verify}'[verify mode, report errors only]' \ '*:metric:->metrics' \ && return 0 ;; pmiostat) _arguments -C -S -s \ "$common_help[@]" \ "(-A --align $exargs)"{-A+,--align=}'[set initial sample time alignment]:timespec:' \ "(-h --host $exargs)"\*{-a+,--archive=}'[specify metrics source archive]:archive:->archives' \ "(-G --aggregate $exargs)"{-G+,--aggregate=}'[set method to aggregate device values]:method:(sum avg min max)' \ "(-h --host -a --archive -u --no-interpolation $exargs)"{-h+,--host=}'[specify metrics source host]:host:_hosts' \ "(-O --origin $exargs)"{-O+,--origin=}'[set initial sample time origin]:timespec:' \ "(-P --precision $exargs)"{-P+,--precision=}'[set floating point precision]:precision:' \ "(-R --regex $exargs)"{-R+,--regex=}'[define device matching regex]:regex:' \ "(-S --start $exargs)"{-S+,--start=}'[set start of time window]:timespec:' \ "(-s --samples $exargs)"{-s+,--samples=}'[specify number of samples]:samples:' \ "(-T --finish $exargs)"{-T+,--finish=}'[set end of time window]:timespec:' \ "(-t --interval $exargs)"{-t+,--interval=}'[specify sampling interval]:interval:' \ "(-u --no-interpolation -h --host $exargs)"{-u,--no-interpolation}'[disable interpolation]' \ "(-Z --timezone -z --hostzone $exargs)"{-Z+,--timezone=}'[set reporting timezone]:timezone:_time_zone' \ "(-z --hostzone -Z --timezone $exargs)"{-z,--hostzone}'[use metrics source timezone]' \ "(-x $exargs)"-x+'[set comma-separated extended options]:options:->pmiostat_extopts' \ && return 0 ;; pmjson) _arguments -S -s \ "$common_help[@]" \ "(-i --in $exargs)"{-i+,--in=}'[set input file]:file:_files' \ "(-m --minimal $exargs)"{-m,--minimal}'[minimal output format]' \ "(-o --out $exargs)"{-o+,--out=}'[set output file]:file:_files' \ "(-p --pretty $exargs)"{-p,--pretty}'[human-readable format]' \ "(-q --quiet $exargs)"{-q,--quiet}'[verify input, no output]' \ "(-y --yaml $exargs)"{-y,--yaml}'[write YAML-like output]' \ && return 0 ;; pmlc) exargs="-? --help" _arguments -A "-*" -S -s \ '(- *)'{-\?,--help}'[display help message]' \ "(-e --echo $exargs)"{-e,--echo}'[echo input]' \ "(-h --host $exargs)"{-h+,--host=}'[specify host to connect]:host:_hosts' \ "(-i --interactive $exargs)"{-i,--interactive}'[interactive mode]' \ "(-n --namespace $exargs)"{-n+,--namespace=}'[specify alternative PMNS]:pmnsfile:_files' \ "(-P --primary -p --port $exargs)"{-P,--primary}'[connect to primary pmlogger]' \ "(-p --port -P --primary $exargs)"{-p+,--port=}'[specify port to connect]' \ "(-Z --timezone -z --logzone $exargs)"{-Z+,--timezone=}'[set reporting timezone]:timezone:_time_zone' \ "(-z --logzone -Z --timezone $exargs)"{-z,--logzone}'[use pmlogger timezone]' \ '1:pid:_pids' \ && return 0 ;; pmlogcheck) exargs="-? --help" _arguments -C -S -s \ '(- *)'{-\?,--help}'[display help message]' \ "(-l --label $exargs)"{-l,--label}'[print archive label]' \ "(-m,--metadataonly $exargs)"{-m,--metadataonly}'[skip checking log data volumes]' \ "(-n --namespace $exargs)"{-n+,--namespace=}'[specify alternative PMNS]:pmnsfile:_files' \ "(-S --start $exargs)"{-S+,--start=}'[set start of time window]:timespec:' \ "(-T --finish $exargs)"{-T+,--finish=}'[set end of time window]:timespec:' \ "(-v --verbose $exargs)"{-v,--verbose}'[verbose output]' \ "(-w --nowrap $exargs)"{-w,--nowrap}'[suppress counter wrap warnings]' \ "(-Z --timezone -z --hostzone $exargs)"{-Z+,--timezone=}'[set reporting timezone]:timezone:_time_zone' \ "(-z --hostzone -Z --timezone $exargs)"{-z,--hostzone}'[use metrics source timezone]' \ '1:archive:->archives' \ && return 0 ;; pmlogctl) exargs="-? --help" _arguments -A "-*" -S -s \ '(- *)'{-\?,--help}'[display help message]' \ "(-a --all $exargs)"{-a,--all}'[apply action to all instances]' \ "(-c --class $exargs)"{-c+,--class=}'[specify class name]:class:' \ "(-f --force $exargs)"{-f,--force}'[force action]' \ "(-i --ident $exargs)"{-i+,--ident=}'[specify instance identifier]:ident:' \ "(-m --migrate $exargs)"{-m,--migrate}'[migrate matching processes to farm services]' \ "(-N --showme $exargs)"{-N,--showme}'[dry run mode, do no changes]' \ "(-p --policy $exargs)"{-p+,--policy=}'[specify policy file]:file:_files' \ "(-V --verbose $exargs)"{-V,--verbose}'[verbose mode]' \ '1:command:(create cond-create start stop restart status destroy)' \ && return 0 ;; pmlogextract) exargs="-? --help" _arguments -C -S -s \ '(- *)'{-\?,--help}'[display help message]' \ "(-c --config $exargs)"{-c+,--config=}'[specify config file]:file:_files' \ "(-d --desperate $exargs)"{-d,--desperate}'[save output after fatal error]' \ "(-f --first $exargs)"{-f,--first}'[use timezone from the first (not last) archive]' \ "(-m --mark $exargs)"{-m,--mark}'[ignore prologue/epilogue and records between archives]' \ "(-S --start $exargs)"{-S+,--start=}'[set start of time window]:timespec:' \ "(-s --samples $exargs)"{-s+,--samples=}'[specify number of log records to write]:samples:' \ "(-T --finish $exargs)"{-T+,--finish=}'[set end of time window]:timespec:' \ "(-v $exargs)"-v+'[switch log volumes after this many samples]:volsamples:' \ "(-w $exargs)"-w'[ignore day/month/year]' \ "(-x $exargs)"-x'[skip metrics with mismatched metadata]' \ "(-Z --timezone -z --hostzone $exargs)"{-Z+,--timezone=}'[set reporting timezone]:timezone:_time_zone' \ "(-z --hostzone -Z --timezone $exargs)"{-z,--hostzone}'[use metrics source timezone]' \ '*:archive:->archives' \ && return 0 ;; pmlogger) exargs="-? --help" _arguments -C -S -s \ '(- *)'{-\?,--help}'[display help message]' \ "(-c --config $exargs)"{-c+,--config=}'[specify config file]:file:_files' \ "(-C --check $exargs)"{-C,--check}'[check config only]' \ "(-h --host -o --local-PMDA -K --spec-local $exargs)"{-h+,--host=}'[specify metrics source host]:host:_hosts' \ "(-H --labelhost $exargs)"{-H+,--labelhost=}'[specify hostname label]:label:' \ "(-I --pmlc-ipc-version)"{-I+,--pmlc-ipc-version=}'[specify IPC version]:version:' \ "(-l --log $exargs)"{-l+,--log=}'[specify log file]:file:_files' \ "(-L --linger $exargs)"{-L,--linger}'[linger even if not logging]' \ "(-m --note $exargs)"{-m+,--note=}'[define map file note]:note:' \ "(-h --host $exargs)"\*{-K+,--spec-local=}'[define PMDA spec for local DSO PMDAs]:spec:(add del clear)' \ "(-o --local-PMDA -h --host $exargs)"{-o,--local-PMDA}'[use local DSO PMDAs as metrics source]' \ "(-N --notify $exargs)"{-N,--notify}'[notify service manager (if any) when started and ready]' \ "(-n --namespace $exargs)"{-n+,--namespace=}'[specify alternative PMNS]:pmnsfile:_files' \ "(-p --PID $exargs)"{-p+,--PID=}'[specify PID to exit after]:PID:_pids' \ "(-P --primary $exargs)"{-P,--primary}'[run as primary logger instance]' \ "(-r --report $exargs)"{-r,--report}'[report record sizes]' \ "(-s --size $exargs)"{-s+,--size=}'[set endsize of archive]:size:' \ "(-t --interval $exargs)"{-t+,--interval=}'[set logging interval]:interval:' \ "(-T --finish $exargs)"{-T+,--finish=}'[set end of time window]:timespec:' \ "(-U --username $exargs)"{-U+,--username=}'[specify username to run as]:user:_users' \ "(-v --volsize $exargs)"{-v+,--volsize=}'[set log volume size]:size:' \ "(-x $exargs)"-x+'[set control file descriptor]:fd:_file_descriptors' \ "(-y $exargs)"-y'[use local time not PMCD timezone]' \ '1:archive:_files' \ && return 0 ;; pmloglabel) exargs="-? --help" _arguments -C -S -s \ '(- *)'-\?'[display help message]' \ "(-h --host $exargs)"{-h+,--host=}'[set hostname for all files in archive]:hostname:_hosts' \ "(-l --label $exargs)"{-l,--label}'[print archive label]' \ "(-L $exargs)"-L'[print archive label verbosely]' \ "(-p --pid $exargs)"{-p+,--pid=}'[set logger PID for all files in archive]:pid:' \ "(-s $exargs)"-s'[write label sentinel values for all files in archive]' \ "(-v --verbose $exargs)"{-v,--verbose}'[verbose output]' \ "(-V --version $exargs)"{-V+,--version=}'[set version number for all files in archive]:version:' \ "(-Z --timezone $exargs)"{-Z+,--timezone=}'[set reporting timezone]:timezone:_time_zone' \ '1:archive:->archives' \ && return 0 ;; pmlogpaste) exargs="-? --help" _arguments -C -S -s \ '(- *)'{-\?,--help}'[display help message]' \ "(-f --file $exargs)"{-f+,--file}'[use infile]:metric:' \ "(-h --hostname $exargs)"{-h+,--hostname}'[set hostname]:hostname:' \ "(-l --label $exargs)"{-l+,--label}'[set context label]:metric:' \ "(-m --metric $exargs)"{-m+,--metric}'[set metric name]:metric:' \ "(-o --outfile $exargs)"{-o+,--outfile}'[use outfile]:metric:' \ "(-t --timezone $exargs)"{-t+,--timezone}'[set timezone]:timezone:_time_zone' \ && return 0 ;; pmlogreduce) arch_req=1 exargs="-? --help" _arguments -C -S -s \ '(- *)'{-\?,--help}'[display help message]' \ "(-A --align $exargs)"{-A+,--align=}'[set initial sample time alignment]:timespec:' \ "(-s --samples $exargs)"{-s+,--samples=}'[specify number of log records to write]:samples:' \ "(-S --start $exargs)"{-S+,--start=}'[set start of time window]:timespec:' \ "(-t --interval $exargs)"{-t+,--interval=}'[specify sampling interval]:interval:' \ "(-T --finish $exargs)"{-T+,--finish=}'[set end of time window]:timespec:' \ "(-v $exargs)"-v+'[switch log volumes after this many samples]:volsamples:' \ "(-z --hostzone -Z --timezone $exargs)"{-z,--hostzone}'[use metrics source timezone]' \ "(-Z --timezone -z --hostzone $exargs)"{-Z+,--timezone=}'[set reporting timezone]:timezone:_time_zone' \ '*:archive:->archives' \ && return 0 ;; pmlogsize) arch_req=1 exargs="-? --help" _arguments -C -S -s \ '(- *)'{-\?,--help}'[display help message]' \ "(-d --detail $exargs)"{-d,--detail}'[detailed reporting]' \ "(-r --replication $exargs)"{-r,--replication}'[show replicated values]' \ "(-v --verbose $exargs)"{-v,--verbose}'[verbose mode]' \ "(-x --threshold $exargs)"{-x+,--threshold=}'[set reporting threshold]:threshold:' \ '*:archive:->archives' \ && return 0 ;; pmlogsummary) arch_req=1 _arguments -C -S -s \ "$common_help[@]" \ "(-a --all $exargs)"{-a,--all}'[print all information]' \ "(-b -x $exargs)"-b'[print both type time averages]' \ "(-B --bins $exargs)"{-B+,--bins=}'[set number of bins]:bins:' \ "(-f -F $exargs)"-f'[spreadsheet format with tabs]' \ "(-F -f $exargs)"-F'[spreadsheet format with commas]' \ "(-H --header $exargs)"{-H,--header}'[print header]' \ "(-i --mintime $exargs)"{-i,--mintime}'[print time of min value]' \ "(-I --maxtime $exargs)"{-I,--maxtime}'[print time of max value]' \ "(-l --label $exargs)"{-l,--label}'[print archive label]' \ "(-m --minimum $exargs)"{-m,--minimum}'[print minimum value]' \ "(-M --maximum $exargs)"{-M,--maximum}'[print maximum value]' \ "(-n --namespace $exargs)"{-n+,--namespace=}'[specify alternative PMNS]:pmnsfile:_files' \ "(-N -v --verbose --$exargs)"-N'[suppress warnings]' \ "(-p --precision $exargs)"{-p+,--precision=}'[set floating point precision]:precision:' \ "(-s --sum $exargs)"{-s,--sum}'[only print value sums]' \ "(-S --start $exargs)"{-S+,--start=}'[set start of time window]:timespec:' \ "(-T --finish $exargs)"{-T+,--finish=}'[set end of time window]:timespec:' \ "(-v --verbose -N $exargs)"{-v,--verbose}'[verbose mode]' \ "(-x -b $exargs)"-x'[print stochastic averages only]' \ "(-y --samples $exargs)"-y'[print sample counts]' \ "(-Z --timezone -z --hostzone $exargs)"{-Z+,--timezone=}'[set reporting timezone]:timezone:_time_zone' \ "(-z --hostzone -Z --timezone $exargs)"{-z,--hostzone}'[use metrics source timezone]' \ '1:archive:->archives' \ '*:metric:->metrics' \ && return 0 ;; pmprobe) exargs="-? --help -d --version" _arguments -C -S -s \ '(- *)'{-\?,--help}'[display help message]' \ '(- *)'{-d,--version}'[display version number]' \ "(--container -h --host -L --local-PMDA -K --spec-local $exargs)"\*{-a+,--archive=}'[specify metrics source archive]:archive:->archives' \ "(-h --host -a --archive -L --local-PMDA -K --spec-local $exargs)"{-h+,--host=}'[specify metrics source host]:host:_hosts' \ "(--container -a --archive $exargs)"--container=+'[specify container to query]:container:->containers' \ "(--derived $exargs)"--derived=+'[specify derived metrics config]:file:_files' \ "(-L --local-PMDA -a --archice -h --host $exargs)"{-L,--local-PMDA}'[use local DSO PMDAs as metrics source]' \ "(-a --archive -h --host $exargs)"\*{-K+,--spec-local=}'[define PMDA spec for local DSO PMDAs]:spec:(add del clear)' \ "(-b --batch $exargs)"{-b+,--batch=}'[set fetch batch size]:size:' \ "(-n --namespace $exargs)"{-n+,--namespace=}'[specify alternative PMNS]:pmnsfile:_files' \ "(-O --origin $exargs)"{-O+,--origin=}'[set initial sample time origin]:timespec:' \ "(-f --force $exargs)"{-f,--force}'[report all instances]' \ "(-F --faster $exargs)"{-F,--faster}'[assume metrics are PMNS leaf nodes]' \ "(-I --external -v --values $exargs)"{-I,--external}'[list external instance names]' \ "(-i --internal -v --values $exargs)"{-i,--internal}'[list internal instance numbers]' \ "(-V --verbose $exargs)"{-V,--verbose}'[report PDU operations]' \ "(-v --values -I --external -i --internal $exargs)"{-v,--values}'[report metric values]' \ "(-z --hostzone -Z --timezone $exargs)"{-z,--hostzone}'[use metrics source timezone]' \ "(-Z --timezone -z --hostzone $exargs)"{-Z+,--timezone=}'[set reporting timezone]:timezone:_time_zone' \ '*:metric:->metrics' \ && return 0 ;; pmrep) _arguments -C -S -s \ "$common_help[@]" \ "$common_most[@]" \ "$common_pmda[@]" \ "$common_python[@]" \ "(-o --output $exargs)"{-o+,--output=}'[set output target]:target:(archive csv stdout)' \ "(-F --output-file $exargs)"{-F+,--output-file=}'[specify output file]:file:_files' \ "(--no-inst-info $exargs)"--no-inst-info'[omit instance info]' \ "(-U --no-unit-info $exargs)"{-U,--no-unit-info}'[omit unit info]' \ "(-p --timestamps $exargs)"{-p,--timestamps}'[print timestamps]' \ "(-d --delay --container -h --host -L --local-PMDA -K --spec-local -u --no-interpol $exargs)"{-d,--delay}'[delay between updates in archive mode]' \ "(--include-texts $exargs)"--include-texts'[include metric help texts in archive output]' \ "(-X --colxrow $exargs)"{-X+,--colxrow=}'[swap stdout columns and rows using header label]:label:' \ "(-w --width -W --width-force $exargs)"{-w+,--width=}'[set default column width]:width:' \ "(-W --width-force -w --width $exargs)"{-W+,--width-force=}'[forced column width]:width:' \ "(-l --delimiter $exargs)"{-l+,--delimiter=}'[set column delimiter]:delimiter:' \ "(-j --live-filter $exargs)"{-j,--live-filter}'[perform instance live filtering]' \ "(-J --rank $exargs)"{-J+,--rank=}'[set limit for results of valued instances]:limit:' \ "(-2 --overall-rank -3 --overall-rank-alt -N --predicate $exargs)"{-2,--overall-rank}'[perform overall ranking from archive]' \ "(-3 --overall-rank-alt -2 --overall-rank -N --predicate $exargs)"{-3,--overall-rank-alt}'[perform overall ranking using pmrep format]' \ "(-6 --sort-metric $exargs)"{-6+,--sort-metric}'[specify sort metric]:metric:' \ "(-8 --limit-filter -9 --limit-filter-force $exargs)"{-8+,--limit-filter=}'[set default limit filter]:limit:' \ "(-9 --limit-filter-force -8 --limit-filter $exargs)"{-9+,--limit-filter-force=}'[set forced limit filter]:limit:' \ "(-m --include-labels -m --include-labels $exargs)"{-m,--include-labels}'[include labels]' \ "(-n --invert-filter $exargs)"{-n,--invert-filter}'[perform ranking before live filtering]' \ "(-N --predicate -2 --overall-rank -3 --overall-rank-alt $exargs)"{-N+,--predicate=}'[specify predicate metric]:metric:->metrics' \ "(-k --extended-csv $exargs)"{-k,--extended-csv}'[write extended CSV]' \ "(-x --extended-header $exargs)"{-x,--extended-header}'[print extended header]' \ "(-7 --fixed-header -1 --dynamic-header -4 --names-change $exargs)"{-7,--fixed-header}'[use fixed header with colxrow]' \ "(-E --repeat-header $exargs)"{-E+,--repeat-header=}'[set header repeat frequency]:samples:(auto)' \ "(-1 --dynamic-header -7 --fixed-header $exargs)"{-1,--dynamic-header}'[update header dynamically]' \ "(-g --separate-header $exargs)"{-g,--separate-header}'[print separate header]' \ "(-f --timestamp-format $exargs)"{-f+,--timestamp-format=}'[set time format string]:format:' \ "(-u --no-interpol --container -d --delay -h --host -L --local-PMDA -K --spec-local -t --interval $exargs)"{-u,--no-interpol}'[disable interpolation]' \ '*:metric:->metrics' \ && return 0 ;; pmseries) _arguments -C -S -s \ "$common_help[@]" \ "(-c --config $exargs)"{-c+,--config=}'[specify config file]:file:_files' \ "(-h --host $exargs)"{-h+,--host=}'[specify Redis host]:host:_hosts' \ "(-p --port $exargs)"{-p+,--port=}'[specify Redis port]:port:' \ "(-L --load $exargs)"{-L,--load}'[load metadata and data into Redis]:path:_files' \ "(-q --query $exargs)"{-q,--query}'[perform timeseries query]' \ "(-a --all $exargs)"{-a,--all}'[report all metadata, same as -dilms]' \ "(-d --desc $exargs)"{-d,--desc}'[report metric descriptions]' \ "(-I --fullindom $exargs)"{-I,--fullindom}'[print verbose InDom]' \ "(-i --instances $exargs)"{-i,--instances}'[report instance names]' \ "(-F --fast $exargs)"{-F,--fast}'[request metadata only]' \ "(-g --glob $exargs)"{-g+,--glob}'[glob pattern to restrict matches]:pattern:' \ "(-l --labels $exargs)"{-l,--labels}'[report label values]' \ "(-M --fullpmid $exargs)"{-M,--fullpmid}'[print verbose PMID]' \ "(-m --metrics $exargs)"{-m,--metrics}'[report metric names]' \ "(-n --names $exargs)"{-n,--names}'[report label names]' \ "(-S --sources $exargs)"{-S,--sources}'[report context for timeseries sources]' \ "(-s --series $exargs)"{-s,--series}'[report timeseries identifiers]' \ "(-t --times $exargs)"{-t,--times}'[report numeric timestamps]' \ "(-v --values $exargs)"{-v,--values}'[report known values for labels]' \ "(-Z --timezone $exargs)"{-Z+,--timezone=}'[set reporting timezone]:timezone:_time_zone' \ '1:series:->ts_metrics' \ && return 0 ;; pmstat) _arguments -C -S -s \ "$common_help[@]" \ "(-A --align $exargs)"{-A+,--align=}'[set initial sample time alignment]:timespec:' \ "(-h --host -H --hostsfile -L --local-PMDA $exargs)"\*{-a+,--archive=}'[specify metrics source archive]:archive:->archives' \ "(-g --guimode $exargs)"{-g,--guimode}'[GUI mode with new time control]' \ "(-a --archive -L --local-PMDA $exargs)"\*{-h+,--host=}'[specify metrics source host]:host:_hosts' \ "(-n --namespace $exargs)"{-n+,--namespace=}'[specify alternative PMNS]:pmnsfile:_files' \ "(-O --origin $exargs)"{-O+,--origin=}'[set initial sample time origin]:timespec:' \ "(-p --guiport $exargs)"{-p+,--guiport=}'[specify existing time control port]:port:' \ "(-S --start $exargs)"{-S+,--start=}'[set start of time window]:timespec:' \ "(-s --samples $exargs)"{-s+,--samples=}'[specify number of samples]:samples:' \ "(-T --finish $exargs)"{-T+,--finish=}'[set end of time window]:timespec:' \ "(-t --interval $exargs)"{-t+,--interval=}'[specify sampling interval]:interval:' \ "(-Z --timezone -z --hostzone $exargs)"{-Z+,--timezone=}'[set reporting timezone]:timezone:_time_zone' \ "(-z --hostzone -Z --timezone $exargs)"{-z,--hostzone}'[use metrics source timezone]' \ "(-a --archive -L --local-PMDA $exargs)"\*{-H+,--hostsfile=}'[specify metrics source hosts file]:file:_files' \ "(-L --local-PMDA -a --archive -h --host -H --hostsfile $exargs)"{-L,--local-PMDA}'[use local DSO PMDAs as metrics source]' \ "(-l --suffix $exargs)"{-l,--suffix}'[print hostname suffix]' \ "(-P --pause -h --host -L --local-pmda $exargs)"{-P,--pause}'[pause between updates in archive mode]' \ "(-x --xcpu $exargs)"{-x,--xcpu}'[report extended CPU statistics]' \ && return 0 ;; pmstore) _arguments -A "-*" -C -S -s \ "$common_help[@]" \ "(-h --host -L --local-PMDA -K --spec-local $exargs)"{-h+,--host=}'[specify metrics source host]:host:_hosts' \ "(-F --fetch $exargs)"{-F,--fetch}'[perform pmFetch after pmStore to confirm value]' \ "(-L --local-PMDA -h --host $exargs)"{-L,--local-PMDA}'[use local DSO PMDAs as metrics source]' \ "(-h --host $exargs)"\*{-K+,--spec-local=}'[define PMDA spec for local DSO PMDAs]:spec:(add del clear)' \ "(-n --namespace $exargs)"{-n+,--namespace=}'[specify alternative PMNS]:pmnsfile:_files' \ "(-F --fetch $exargs)"{-F,--fetch}'[perform pmFetch after pmStore to confirm value]' \ "(-f --force $exargs)"{-f,--force}'[store value even if unset]' \ "($exargs)"\*{-i+,--insts=}'[specify instances to store to]:instances:->instances' \ '1:metric:->metrics' \ && return 0 ;; pmval) _arguments -C -S -s \ "$common_help[@]" \ "$common_most[@]" \ "$common_pmda[@]" \ "(-g --guimode $exargs)"{-g,--guimode}'[GUI mode with new time control]' \ "(-p --guiport $exargs)"{-p+,--guiport=}'[specify existing time control port]:port:' \ "(-n --namespace $exargs)"{-n+,--namespace=}'[specify alternative PMNS]:pmnsfile:_files' \ "(--container -a --archive -U --nointerp $exargs)"--container=+'[specify container to query]:container:->containers' \ "(--derived $exargs)"--derived=+'[specify derived metrics config]:file:_files' \ "(-d --delay --container -h --host -L --local-PMDA -K --spec-local $exargs)"{-d,--delay}'[delay between updates in archive mode]' \ "(-f --precision $exargs)"{-f+,--precision=}'[set fixed output format precision]:precision:' \ "($exargs)"\*{-i+,--instances=}'[specify instances to report]:instances:->instances' \ "(-r --raw $exargs)"{-r,--raw}'[report raw values]' \ "(-a --archive --container -h --host -L --local-PMDA -K --spec-local $exargs)"{-U+,--nointerp=}'[specify uninterpolated metrics source archive]:archive:->archives' \ "(-v --verbose $exargs)"{-v,--verbose}'[verbose mode]' \ "(-w --width $exargs)"{-w+,--width=}'[set column width]:width:' \ "(-X --timestamp $exargs)"{-X,--timestamp}'[timestamps with more precision]' \ "(-x --filter $exargs)"{-x+,--filter=}'[define event filter pattern]:filter:' \ '1:metric:->metrics' \ && return 0 ;; esac case $state in archives) local fpat t local -a archives [[ -n $words[CURRENT] ]] && t=${words[CURRENT]##*,} archives=( ${t}*(-FM) ${t}*.meta* ) if [[ $#archives -gt 0 && $archives == *.meta* ]]; then _values -s , -w archive ${archives/.meta*} && ret=0 else compset -P '*,' zstyle -s ":completion:${curcontext}:" file-patterns fpat if [[ -z "$fpat" ]]; then zstyle ":completion:${curcontext}:" file-patterns '%p:globbed-files' fi _wanted archives expl archive _files -g '*(-F)' && ret=0 fi ;; containers) local -a conts names found conts=( ${(f)"$(pminfo -f containers.state.running)"} ) names=( ${(f)"$(pminfo -f containers.name)"} ) for cont in $conts; do [[ $cont == *value?1* ]] || continue for c in $names; do if zstyle -t ":completion:*:${curcontext}:pcp:containers" use-ids; then [[ ${${=cont}[4]} == ${${=c}[4]} ]] && found+=( ${(Q)${${=cont}[4]}/\]} ) [[ ${${=cont}[4]} == ${${=c}[4]} && -n $words[CURRENT] ]] && found+=( ${(Q)${=c}[6]} ) else [[ ${${=cont}[4]} == ${${=c}[4]} ]] && found+=( ${(Q)${=c}[6]} ) [[ ${${=cont}[4]} == ${${=c}[4]} && -n $words[CURRENT] ]] && found+=( ${(Q)${${=cont}[4]}/\]} ) fi done done _wanted containers expl container compadd -a found && ret=0 ;; instances) local arch=${${~opt_args[-a]:-${~opt_args[--archive]}}/:/,} local a=${arch:+-a} local cont=${~opt_args[--container]} local c=${cont:+--container} local host=${~opt_args[-h]:-${~opt_args[--host]}} local h=${host:+-h} local -a metrics insts found local word if [[ $arch_req -eq 1 ]]; then a=-a arch=$words[2] for word in ${words:1}; do [[ $word != -* && (-f $word.meta || -f $word.meta.xz) ]] && arch=$word done fi for word in ${words:1}; do # Find metrics arguments, mishits will be filtered out w/ $2>0 [[ $word == [a-z]* ]] && metrics+=( $word ) done # TODO: Check if feasible to handle quotes ('") / multiple spaces in insts insts=( ${(f)"$(pmprobe $a ${(e)arch} $c ${(e)cont} $h ${(e)host} -I $metrics 2>/dev/null | awk '!/1 PM_IN_NULL$/ && $1~"^[a-z]" && $2>0 {for(i=3;i<=NF;i++)print $i}')"} ) insts=( ${(q-)${${(ps:" ":)insts}//\"}} ) # TODO: don't duplicate " when doing pmval -i " _wanted instances expl instance compadd -Q -P '"' -S '"' -a insts && ret=0 ;; metrics) local arch=${${~opt_args[-a]:-${~opt_args[--archive]}}/:/,} local a=${arch:+-a} local cont=${~opt_args[--container]} local c=${cont:+--container} local host=${~opt_args[-h]:-${~opt_args[--host]}} local h=${host:+-h} local word if [[ $arch_req -eq 1 ]]; then a=-a arch=$words[2] for word in ${words:1}; do [[ $word != -* && (-f $word.meta || -f $word.meta.xz) ]] && arch=$word done fi # Derived metrics from command line local drvc=${~opt_args[--derived]} local -a drvm [[ $service == pminfo ]] && drvc=${drvc:-${~opt_args[-c]}} (( ${(k)py_tools[(I)$service]} > 0 )) && drvc=${drvc:-${~opt_args[-e]}} if [[ -n $drvc && -f ${(e)drvc} ]]; then drvm=( ${=${${(f)"$(<${(e)drvc})"}:#\#*}%%=*} ) fi if [[ -n $drvc && (( ${(k)py_tools[(I)$service]} > 0 )) && ! -f $drvc ]]; then drvm=( ${=${(ps:,:)${(Qe)drvc}}%%=*} ) fi if [[ $words[CURRENT] != :* ]]; then if zstyle -T ":completion:*:${curcontext}:pcp:metrics" full-names; then _wanted metrics expl metric compadd -M 'r:|.=* r:|=*' $drvm \ $(pminfo -d $a ${(e)arch} $c ${(e)cont} $h ${(e)host} 2>/dev/null | grep -Ev '( |^$|^event)') && ret=0 else local -a res res=( $(pminfo -d $a ${(e)arch} $c ${(e)cont} $h ${(e)host} 2>/dev/null | grep -Ev '( |^$|^event)') ) res+=( $drvm ) _wanted metrics expl metric _multi_parts -i . res fi else # pmrep(1) style metricset (( ${(k)py_tools[(I)$service]} > 0 )) || return 1 local conf=${~opt_args[-c]:-${~opt_args[--config]}} [[ -n $conf && ! -e $conf ]] && return 1 if [[ -d $conf ]]; then conf=($conf/*.conf) elif [[ -z $conf ]]; then for f in ./$service.conf $HOME/.$service.conf $HOME/.pcp/$service.conf ${${(M)${(f)"$(/dev/null) && ret=0 ;; pcp_commands) _wanted commands expl 'pcp command' compadd -a _cache_pcp_cmds && ret=0 ;; pcp_cmdopts) local cmd word for word in ${words:1}; do [[ -n "${_cache_pcp_cmds[(r)$word]}" ]] && cmd=$word && break done [[ -z $cmd ]] && return 1 [[ $cmd == python ]] && _default && return 0 if [[ -z $_cache_pcp_cmdopts[$cmd] ]]; then _cache_pcp_cmdopts[$cmd]=${${${${(M)${=${(f)"$(pcp $cmd --help 2>&1)"}}:#-[-0-9A-Za-z?]*}/,}/=*}/-USR1} fi [[ -n $_cache_pcp_cmdopts[$cmd] ]] && _values -w option ${(u)=_cache_pcp_cmdopts[$cmd]} && ret=0 ;; pmfind_mechs) if compset -P '*,'; then case "$IPREFIX" in *avahi,) _wanted timeout expl timeout compadd -S = timeout && ret=0 ;; *probe=*) local -a opts [[ $IPREFIX != *timeout* ]] && opts+=( timeout ) [[ $IPREFIX != *maxThreads* ]] && opts+=( maxThreads ) [[ $#opts -eq 0 ]] && ret=0 [[ $#opts -gt 0 ]] && _wanted options expl option compadd -S = -a opts && ret=0 ;; esac else _wanted mechanisms expl mechanism compadd -S '' avahi probe= && ret=0 fi ;; pmiostat_extopts) _values -s , 'extended option' dm t h noidle && ret=0 ;; scales_count) _values count-scale \ "count x 10^-8" "count x 10^-7" "count x 10^-6" "count x 10^-5" \ "count x 10^-4" "count x 10^-3" "count x 10^-2" "count x 10^-2" \ "count x 10^-1" "count" "count x 10" "count x 10^2" "count x 10^3" \ "count x 10^4" "count x 10^5" "count x 10^6" "count x 10^7" && ret=0 ;; scales_space) _wanted space-scales expl 'space scale' compadd \ -M 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' \ byte Kbyte KB Mbyte MB Gbyte GB Tbyte TB Pbyte PB Ebyte EB Zbyte ZB Ybyte YB && ret=0 ;; scales_time) _values time-scale \ nanosec ns microsec us millisec ms sec s minute min hour hr && ret=0 ;; esac return ret } _pcp "$@" site-functions/_nvme000064400000076450152626764570010605 0ustar00#compdef _nvme nvme # zsh completions for the nvme command-line interface, # very loosely based on git and adb command completion # Kelly Kaoudis kelly.n.kaoudis at intel.com, June 2015 _nvme () { local -a _cmds _cmds=( 'id-ctrl:display information about the controller' 'id-ns:display information about the namespace' 'list-ns:identify all namespace(s) attached' 'cmdset-ind-id-ns':display I/O Command Set Independent information about the namespace' 'id-iocs:display information about I/O command sets' 'id-domain:display information about domain list' 'create-ns:create a new namespace before attachment' 'delete-ns:delete a detached namespace' 'attach-ns:attach namespace to controller' 'detach-ns:detach namespace from controller' 'list-ctrl:identify all controller(s) attached' 'nvm-id-ctrl:display information about the nvm command set' 'list-endgrp:display information about nvme endurance group list' 'get-ns-id:get namespace id of opened block device' 'get-log:retrieve any log in raw format' 'predictable-lat-log:retrieve predictable latency per nvmset log' 'pred-lat-event-agg-log:retrieve predictable latency event aggregate log' 'persistent-event-log:retrieve presistent event log' 'fw-log:retrieve fw log' 'smart-log:retrieve SMART log' 'smart-log-add:retrieve additional SMART log' 'error-log:retrieve error log' 'endurance-event-agg-log:retrieve endurance group event aggregate log' 'lba-status-log:retrieve lba status log' 'resv-notif-log: retrieve reservation notification log' 'get-feature:display a controller feature' 'set-feature:set a controller feature and show results' 'format:apply new block format to namespace' 'fw-activate:activate a firmware on the device' 'fw-download:download a firmware to the device' 'admin-passthru:submit a passthrough IOCTL' 'io-passthru:submit a passthrough IOCTL' 'security-send:send security/secure data to controller' 'security-recv:ask for security/secure data from controller' 'resv-acquire:acquire reservation on a namespace' 'resv-register:register reservation on a namespace' 'resv-release:release reservation on a namespace' 'resv-report:report reservation on a namespace' 'copy:submit a simple copy command' 'flush:submit a flush' 'compare:compare data on device to data elsewhere' 'read:submit a read command' 'write:submit a write command' 'capacity-mgmt: submit capacity management command' 'show-regs:shows the controller registers; requires admin character device' 'boot-part-log: retrieve boot partition log' 'fid-support-effects-log:retrieve fid support and effects log' 'supported-log-pages: retrieve support log pages details' 'lockdown:submit a lockdown command' 'help:print brief descriptions of all nvme commands' ) local expl _arguments '*:: :->subcmds' && return 0 if (( CURRENT == 1 )); then _describe -t commands "nvme subcommands" _cmds return else case ${words[CURRENT-1]} in (id-ctrl) local _idctrl _idctrl=( /dev/nvme':supply a device to use (required)' --raw-binary':dump infos in binary format' -b':alias of --raw-binary' --human-readable':show infos in readable format' -H':alias of --human-readable' --vendor-specific':also dump binary vendor infos' -v':alias of --vendor-specific' ) _arguments '*:: :->subcmds' _describe -t commands "nvme id-ctrl options" _idctrl ;; (id-ns) local _idns _idns=( /dev/nvme':supply a device to use (required)' --namespace-id=':show infos for namespace ' -n':alias of --namespace-id' --raw-binary':dump infos in binary format' -b':alias of --raw-binary' --human-readable':show infos in readable format' -H':alias of --human-readable' --vendor-specific':also dump binary vendor infos' -v':alias of --vendor-specific' ) _arguments '*:: :->subcmds' _describe -t commands "nvme id-ns options" _idns ;; (list-ns) local _listns _listns=( /dev/nvme':supply a device to use (required)' --namespace-id=':start namespace infos listing with this nsid' -n':alias of --namespace-id' --csi=':command set identifier' -y':alias of --csi' ) _arguments '*:: :->subcmds' _describe -t commands "nvme list-ns options" _listns ;; (cmdset-ind-id-ns) local _cmdset_ind_idns _cmdset_ind_idns=( /dev/nvme':supply a device to use (required)' --namespace-id=':show infos for namespace ' -n':alias of --namespace-id' --raw-binary':dump infos in binary format' -b':alias of --raw-binary' --human-readable':show infos in readable format' -H':alias of --human-readable' ) _arguments '*:: :->subcmds' _describe -t commands "nvme cmdset-ind-id-ns options" _cmdset_ind_idns ;; (id-iocs) local _idiocs _idiocs=( /dev/nvme':supply a device to use (required)' --controller-id=':show infos for controller ' -c':alias of --controller-id' ) _arguments '*:: :->subcmds' _describe -t commands "nvme id-iocs options" _idiocs ;; (id-domain) local _iddomain _iddomain=( /dev/nvme':supply a device to use (required)' --dom-id=':show infos for domain id ' -d':alias of --dom-id' ) _arguments '*:: :->subcmds' _describe -t commands "nvme id-domain options" _iddomain ;; nvm-id-ctrl) local _nvmidctrl _nvmidctrl=( /dev/nvme':supply a device to use (required)' ) _arguments '*:: :->subcmds' _describe -t commands "nvme nvm-id-ctrl options" _nvmidctrl ;; (list-endgrp) local _listendgrp _listendgrp=( /dev/nvme':supply a device to use (required)' --endgrp-id=':endurance group id' -i':alias of --endgrp-id' ) _arguments '*:: :->subcmds' _describe -t commands "nvme list-ns options" _listendgrp ;; (create-ns) local _createns _createns=( /dev/nvme':supply a device to use (required)' --nsze=':namespace size to create' -s':alias of --nsze' --ncap=':namespace capacity' -c':alias of --ncap' --flbas=':FLBA size' -f':alias of --flbas' --dps=':data protection?' -d':alias of --dps' --nmic=':multipath and sharing' -n':alias of --nmic' --csi=':command set identifier' -y':alias of --csi' ) _arguments '*:: :->subcmds' _describe -t commands "nvme create-ns options" _createns ;; (delete-ns) local _deletens _deletens=( /dev/nvme':supply a device to use (required)' --namespace-id=':namespace to delete' -n':alias of --namespace-id' ) _arguments '*:: :->subcmds' _describe -t commands "nvme delete-ns options" _deletens ;; (attach-ns) local _attachns _attachns=( /dev/nvme':supply a device to use (required)' --namespace-id=':namespace to attach to the controller' -n':alias of --namespace-id' --controllers=':if a device is not provided, supply a comma-sep list of controllers' -c':alias of --controllers' ) _arguments '*:: :->subcmds' _describe -t commands "nvme attach-ns options" _attachns ;; (detach-ns) local _detachns _detachns=( /dev/nvme':supply a device to use (required)' --namespace-id=':namespace to detach from controller' -n':alias of --namespace-id' --controllers=':if a device is not provided, supply a comma-sep list of controllers' -c':alias of --controllers' ) _arguments '*:: :->subcmds' _describe -t commands "nvme detach-ns options" _detachns ;; (list-ctrl) local _listctrl _listctrl=( /dev/nvme':supply a device to use (required)' --namespace-id=':show controllers attached to this namespace' -n':alias of --namespace-id' --cntid=':start the list with this controller' -c':alias of --cntid' ) _arguments '*:: :->subcmds' _describe -t commands "nvme list-ctrl options" _listctrl ;; (get-ns-id) local _getnsid _getnsid=( /dev/nvme':supply a device to use (required)' ) _arguments '*:: :->subcmds' _describe -t commands "nvme get-ns-id options" _getnsid ;; (get-log) local _getlog _getlog=( /dev/nvme':supply a device to use (required)' --log-id=':requested log number' -i':alias of --log-id' --log-len=':number of bytes to show for requested log' -l':alias of --log-len' --namespace-id=':get log specific to if namespace logs are supported' -n':alias of --namespace-id' --raw-binary':dump infos in binary format' -b':alias of --raw-binary' ) _arguments '*:: :->subcmds' _describe -t commands "nvme get-log options" _getlog ;; (persistent-event-log) local _persistenteventlog _persistenteventlog=( /dev/nvme':supply a device to use (required)' --action=': action the controller shall take for this log page' -a':alias to --action' --log-len=':number of bytes to show for requested log' -l':alias of --log-len' --raw-binary':dump infos in binary format' -b':alias of --raw-binary' ) _arguments '*:: :->subcmds' _describe -t commands "persistent-event-log options" _persistenteventlog ;; (pred-lat-event-agg-log) local _predlateventagglog _predlateventagglog=( /dev/nvme':supply a device to use (required)' --log-entries=': Number of pending NVM Set Entries log list' -e':alias to --log-entries' --rae': Retain an Asynchronous Event' -r':alias to --rae' --raw-binary':dump infos in binary format' -b':alias of --raw-binary' ) _arguments '*:: :->subcmds' _describe -t commands "nvme pred-lat-event-agg-log options" _predlateventagglog ;; (predictable-lat-log) local _predictablelatlog _predictablelatlog=( /dev/nvme':supply a device to use (required)' --nvmset-id=': NVM Set Identifier on which log page retrieve info' -i':alias to --nvmset-id' --raw-binary':dump infos in binary format' -b':alias of --raw-binary' ) _arguments '*:: :->subcmds' _describe -t commands "nvme predictable-lat-log options" _predictablelatlog ;; (fw-log) local _fwlog _fwlog=( /dev/nvme':supply a device to use (required)' --raw-binary':dump infos in binary format' -b':alias of --raw-binary' ) _arguments '*:: :->subcmds' _describe -t commands "nvme fw-log options" _fwlog ;; (smart-log) local _smartlog _smartlog=( /dev/nvme':supply a device to use (required)' --namespace-id=':get SMART log specific to if namespace logs are supported' -n':alias to --namespace-id' --raw-binary':dump infos in binary format' -b':alias to --raw-binary' ) _arguments '*:: :->subcmds' _describe -t commands "nvme smart-log options" _smartlog ;; (smart-log-add) local _add _add=( /dev/nvme':supply a device to use (required)' --namespace-id=':get additional SMART log specific to if namespace logs supported' -n':alias to --namespace-id' --raw-binary':dump infos in binary format' -b':alias to --raw-binary' ) _arguments '*:: :->subcmds' _describe -t commands "nvme smart-log-add options" _add ;; (error-log) local _errlog _errlog=( /dev/nvme':supply a device to use (required)' --namespace-id=':get log specific to if namespace logs are supported' -n':alias to --namespace-id' --raw-binary':dump infos in binary format' -b':alias to --raw-binary' --log-entries=':request n >= 1 log entries' -e':alias to --log-entries' ) _arguments '*:: :->subcmds' _describe -t commands "nvme error-log options" _errlog ;; (endurance-event-agg-log) local _enduranceeventagglog _enduranceeventagglog=( /dev/nvme':supply a device to use (required)' --log-entries=': Number of Endurance Group Event Agg Entries log list' -e':alias to --log-entries' --rae': Retain an Asynchronous Event' -r':alias to --rae' --raw-binary':dump infos in binary format' -b':alias of --raw-binary' ) _arguments '*:: :->subcmds' _describe -t commands "nvme endurance-event-agg-log options" _enduranceeventagglog ;; (lba-status-log) local _lbastatuslog _lbastatuslog=( /dev/nvme':supply a device to use (required)' --rae': Retain an Asynchronous Event' -r':alias to --rae' ) _arguments '*:: :->subcmds' _describe -t commands "nvme lba-status-log options" _lbastatuslog ;; (resv-notif-log) local _resvnotiflog _resvnotiflog=( /dev/nvme':supply a device to use (required)' ) _arguments '*:: :->subcmds' _describe -t commands "nvme resv-notif-log options" _resvnotiflog ;; (boot-part-log) local _bootpartlog _bootpartlog=( /dev/nvme':supply a device to use (required)' --lsp=': log specific field' -s':alias to --lsp' --output-file=': boot partition data output write' -f':alias for --output-file' ) _arguments '*:: :->subcmds' _describe -t commands "nvme boot-part-log options" _bootpartlog ;; (get-feature) local _getf _getf=( /dev/nvme':supply a device to use (required)' --namespace-id=':get feature specific to ' -n':alias to --namespace-id' --feature-id=':hexadecimal name of feature to examine (required)' -f':alias to --feature-id' --sel=':select from 0 - current, 1 - default, 2 - saved, 3 - supported' -s':alias to --sel' --data-len=':buffer len for returned LBA Type Range or host identifier data' -l':alias for --data-len' --uuid-index=':uuid index' -U':alias for --uuid-index' --cdw11=':dword 11 value, used for interrupt vector configuration only' --raw-binary':dump infos in binary format' -b':alias to --raw-binary' ) _arguments '*:: :->subcmds' _describe -t commands "nvme get-feature options" _getf ;; (lockdown) local _lockdown _lockdown=( /dev/nvme':supply a device to use (required)' --ofi=': Opcode or Feature Identifier(OFI) (required)' -o':alias of --ofi' --ifc=':Interface (INF) field Information (required)' -f':alias of --ifc' --prhbt=':Prohibit(PRHBT) bit field (required)' -p':alias of --prhbt' --scp=':Scope(SCP) field for identifying opcode or feature id (required)' -s':alias of --scp' --uuid=':UUID Index field required aligned with Scope' -U':alias of --uuid' ) _arguments '*:: :->subcmds' _describe -t commands "nvme lockdown options" _lockdown ;; (set-feature) local _setf _setf=( /dev/nvme':supply a device to use (required)' --namespace-id=':feature is specific to ' -n':alias to --namespace-id' --feature-id=':hexadecimal name of feature to set (required)' -f':alias to --feature-id' --data-len=':buffer length, only used for LBA Type Range or host identifier data' -l':alias for --data-len' --data=':data file for LBA Type Range or host identifier buffer (defaults to stdin)' -d':alias to --data' --value=':new value of feature (required)' -v'alias to --value' --uuid-index=':uuid index' -U':alias for --uuid-index' ) _arguments '*:: :->subcmds' _describe -t commands "nvme set-feature options" _setf ;; (format) local _format _format=( /dev/nvme':supply a device to use (required)' --namespace-id=': of namespace to format (required)' -n':alias of --namespace-id' --lbaf=':LBA format to apply to namespace (required)' -l':alias of --lbaf' --ses=':secure erase? 0 - no-op (default), 1 - user-data erase, 2 - cryptographic erase' -s':alias of --ses' --pil=':location of protection information? 0 - end, 1 - start' -p':alias of --pil' --pi=':protection information? 0 - off, 1 - Type 1 on, 2 - Type 2 on, 3 - Type 3 on' -i':alias of --pi' --ms=':extended format? 0 - off (metadata in separate buffer), 1 - on (extended LBA used)' -m':alias of --ms' ) _arguments '*:: :->subcmds' _describe -t commands "nvme format options" _format ;; (fw-activate) local _fwact _fwact=( /dev/nvme':supply a device to use (required)' --action=':activation action (required)? 0 - replace fw without activating, 1 - replace with activation, 2 - replace with activation at next reset' -a':alias of --action' --slot=':firmware slot to activate' -s':alias of --slot' ) _arguments '*:: :->subcmds' _describe -t commands "nvme fw-activate options" _fwact ;; (fw-download) local _fwd _fwd=( /dev/nvme':supply a device to use (required)' --fw=':firmware file to download (required)' -f':alias of --fw' --xfer=':limit on chunk-size of transfer (if device has download size limit)' -x':alias of --xfer' --offset=':starting offset, in dwords (defaults to 0, only useful if download is split across multiple files)' -o':alias of --offset' ) _arguments '*:: :->subcmds' _describe -t commands "nvme fw-download options" _fwd ;; (capacity-mgmt) local _fwd _fwd=( /dev/nvme':supply a device to use (required)' --operation=':Operation to be performed by the controller' -o':alias of --operation' --element-id=':specific to the value of the Operation field' -i':alias of --element-id' --cap-lower=':Least significant 32 bits of the capacity in bytes' -l':alias of --cap-lower' --cap-upper=':Most significant 32 bits of the capacity in bytes' -u':alias of --cap-upper' ) _arguments '*:: :->subcmds' _describe -t commands "nvme capacity-mgmt options" _fwd ;; (supported-log-pages) local _support _support=( /dev/nvme':supply a device to use (required)' --human-readable':show infos in readable format' -H':alias of --human-readable' ) _arguments '*:: :->subcmds' _describe -t commands "nvme supported-log-pages options" _support ;; (admin-passthru) local _admin _admin=( /dev/nvme':supply a device to use (required)' --opcode=':hexadecimal opcode to send (required)' -o':alias of --opcode' --flags=':command flags' -f':alias of --flags' --rsvd=':value for reserved field' -R':alias of --rsvd' --namespace-id=':value for nsid' -n':alias of --namespace-id' --data-len=':length for data buffer' -l':alias of --data-len' --metadata-len=':length for metadata buffer' -m':alias of --metadata-len' --timeout=':value for timeout' -t':alias of --timeout' --cdw2=':value for command dword 2' -2':alias for --cdw2' --cdw3=':value for command dword 3' -3':alias for --cdw3' --cdw10=':value for command dword 10' -4':alias for --cdw10' --cdw11=':value for command dword 11' -5':alias for --cdw11' --cdw12=':value for command dword 12' -6':alias for --cdw12' --cdw13=':value for command dword 13' -7':alias for --cdw13' --cdw14=':value for command dword 14' -8':alias for command dword 14' --cdw15=':value for command dword 15' -9':alias for command dword 15' --input-file=':defaults to stdin; input for write (send direction)' -i':alias for --input-file' --raw-binary':dump output in binary format' -b':alias for --raw-binary' --show-command':simply print command instead of sending it to ' -s':alias for --show-command' --dry-run':alias for --show-command' -d':alias for --show-command' --read':set dataflow direction to receive' -r':alias for --read' --write':set dataflow direction to send' -w':alias for --write' ) _arguments '*:: :->subcmds' _describe -t commands "nvme admin-passthru options" _admin ;; (io-passthru) local _io _io=( /dev/nvme':supply a device to use (required)' --opcode=':hexadecimal opcode to send (required)' -o':alias of --opcode' --flags=':command flags' -f':alias of --flags' --rsvd=':value for reserved field' -R':alias of --rsvd' --namespace-id=':value for nsid' -n':alias of --namespace-id' --data-len=':length for data buffer' -l':alias of --data-len' --metadata-len=':length for metadata buffer' -m':alias of --metadata-len' --timeout=':value for timeout' -t':alias of --timeout' --cdw2=':value for command dword 2' -2':alias for --cdw2' --cdw3=':value for command dword 3' -3':alias for --cdw3' --cdw10=':value for command dword 10' -4':alias for --cdw10' --cdw11=':value for command dword 11' -5':alias for --cdw11' --cdw12=':value for command dword 12' -6':alias for --cdw12' --cdw13=':value for command dword 13' -7':alias for --cdw13' --cdw14=':value for command dword 14' -8':alias for command dword 14' --cdw15=':value for command dword 15' -9':alias for command dword 15' --input-file=':defaults to stdin; input for write (send direction)' -i':alias for --input-file' --raw-binary':dump output in binary format' -b':alias for --raw-binary' --show-command':simply print command instead of sending it to ' -s':alias for --show-command' --dry-run':alias for --show-command' -d':alias for --show-command' --read':set dataflow direction to receive' -r':alias for --read' --write':set dataflow direction to send' -w':alias for --write' ) _arguments '*:: :->subcmds' _describe -t commands "nvme io-passthru options" _io ;; (security-send) local _ssend _ssend=( /dev/nvme':supply a device to use (required)' --file=':payload' -f':alias for --file' --secp=':security protocol as defined in SPC-4' -p':alias for --secp' --spsp=':send security-protocol-specific data as defined in SPC-4' -s':alias for --spsp' --tl=':transfer length as defined in SPC-4' -t':alias for --tl' ) _arguments '*:: :->subcmds' _describe -t commands "nvme security-send options" _ssend ;; (security-recv) local _srecv _srecv=( /dev/nvme':supply a device to use (required)' --secp=':security protocol as defined in SPC-4' -p':alias for --secp' --spsp=':send security-protocol-specific data as defined in SPC-4' -s':alias for --spsp' --size=':size of buffer (prints to stdout on successful recv)' -x':alias for --size' --al=':allocation length as defined in SPC-4' -a':alias for --al' --raw-binary':dump output in binary format' -b':alias for --raw-binary' ) _arguments '*:: :->subcmds' _describe -t commands "nvme security-recv options" _srecv ;; (resv-acquire) local _acq _acq=( /dev/nvme':supply a device to use (required)' --namespace-id=': of namespace to try to reserve (required)' -n':alias for --namespace-id' --prkey=':pre-empt reservation key' -p':alias for --prkey' --rtype=':hexadecimal reservation type' -t':alias for --rtype' --racqa=':reservation acquire action' -a':alias for --racqa' --iekey=':ignore existing reservation key' -i':alias for --iekey' --crkey':current reservation key' -c':alias for --crkey' ) _arguments '*:: :->subcmds' _describe -t commands "nvme resv-acquire options" _acq ;; (resv-release) local _rel _rel=( /dev/nvme':supply a device to use (required)' --namespace-id=':nsid' -n':alias of --namespace-id' --rtype=':hexadecimal reservation type' -t':alias of --rtype' --rrela=':reservation release action' -a':alias of --rrela' --iekey':ignore existing reservation key' -i':alias of --iekey' ) _arguments '*:: :->subcmds' _describe -t commands "nvme resv-release options" _rel ;; (resv-report) local _rep _rep=( /dev/nvme':supply a device to use (required)' --namespace-id=':nsid' -n':alias of --namespace-id' --numd=':number of dwords of reservation status to xfer' -d':alias of --numd' --raw-binary':dump output in binary format' -b':alias of --raw-binary' ) _arguments '*:: :->subcmds' _describe -t commands "nvme resv-report options" _rep ;; (resv-register) local _reg _reg=( /dev/nvme':supply a device to use (required)' --namespace-id=':nsid' -n':alias of --namespace-id' --crkey=':current reservation key' -c'alias of --crkey' --nrkey=':new reservation key' -k':alias of --nrkey' --cptpl=':change persistence through power loss setting' -p':alias for --cptpl' --rrega=':reservation registration action to perform' -r':alias for --rrega' --iekey':ignore existing reservation key' -i':alias for --iekey' ) _arguments '*:: :->subcmds' _describe -t commands "nvme resv-register options" _reg ;; (copy) local _copy _copy=( /dev/nvme':supply a device to use (required)' --sdlba=':64-bit addr of first destination logical block' -d':alias of --sdlba' --slbs=':64-bit addr of first block per range (comma-separated list)' -s':alias of --slbs' --blocks=':number of blocks per range (comma-separated list, zeroes-based values)' -b':alias of --blocks' --limited-retry':if included, controller should try less hard to retrieve data from media (if not included, all available data recovery means used)' -l':alias of --limited-retry' --force-unit-access':if included, the data shall be read from non-volatile media' -f':alias of --force-unit access' --prinfow=':protection information and check field (write part)' -p':alias of --prinfow' --prinfor=':protection information and check field (read part)' -P':alias of --prinfor' --ref-tag=':initial lba reference tag (write part)' -r':alias of --ref-tag' --expected-ref-tags=':expected lba reference tags (read part, comma-separated list)' -R':alias of --expected-ref-tags' --app-tag=':lba application tag (write part)' -a':alias of --app-tag' --expected-app-tags=':expected lba application tags (read part, comma-separated list)' -A':alias of --expected-app-tags' --app-tag-mask=':lba application tag mask (write part)' -m':alias of --app-tag-mask' --expected-app-tag-masks=':expected lba application tag masks (read part, comma-separated list)' -M':alias of --expected-app-tag-masks' --dir-type':directive type (write part)' -T':alias of --dir-type' --dir-spec':directive specific (write part)' -S':alias of --dir-spec' --format':source range entry format' -F':alias of --format' ) _arguments '*:: :->subcmds' _describe -t commands "nvme copy options" _copy ;; (flush) local _flush _flush=( /dev/nvme':supply a device to use (required)' --namespace-id=':nsid' -n':alias of --namespace-id' ) _arguments '*:: :->subcmds' _describe -t commands "nvme flush options" _flush ;; (compare) local _comp _comp=( /dev/nvme':supply a device to use (required)' --start-block=':begin compare at this 64-bit LBA on device' -s':alias of --start-block' --block-count=':number of logical blocks on device to compare to local data' -c':alias of --block-count' --metadata-size=':number of bytes of metadata to compare' -y':alias of --metadata-size' --data-size=':size of local data buffer in bytes' -z':alias of --data-size' --data=':local data file to compare to blocks on device' -d':alias of --data' --prinfo=':protection information action and check field' -p':alias of --prinfo' --app-tag-mask=':application tag mask (for end to end PI)' -m':alias of --app-tag-mask' --app-tag=':application tag (for end to end PI)' -a':alias of --app-tag' --limited-retry':if included, controller should try less hard to retrieve data from media (if not included, all available data recovery means used)' -l':alias of --limited-retry' --force-unit-access':if included, the data shall be read from non-volatile media' -f':alias of --force-unit access' --show-command':show command instead of sending to device' -v':alias of --show-command' --dry-run':show command instead of sending to device' -w':alias of --show-command' ) _arguments '*:: :->subcmds' _describe -t commands "nvme compare options" _comp ;; (read) local _read _read=( /dev/nvme':supply a device to use (required)' --start-block=':64-bit address of the first logical block to be read' -s':alias of --start-block' --block-count=':number of logical blocks on device to read' -c':alias of --block-count' --data-size=':size of data to be read' -z':alias of --data-size' --metadata-size=':size of metadata to be read' -y':alias of --metadata-size' --ref-tag=':reference tag (for end to end PI)' -r':alias of --ref-tag' --data=':file into which data should be read (defaults to stdout)' -d':alias of --data' --prinfo=':protection information and check field' -p':alias of --prinfo' --app-tag-mask=':application tag mask (for end to end PI)' -m':alias of --app-tag-mask' --app-tag=':application tag (for end to end PI)' -a':alias of --app-tag' --limited-retry=':if included, controller should try less hard to retrieve data from media (if not included, all available data-recovery means used)' -l':alias of --limited-retry' --latency':latency statistics will be output following read' -t':alias of --latency' --force-unit-access':data read shall be returned from nonvolatile media before command completion is indicated' -f':alias of --force-unit-access' --show-command':show command instead of sending to device' -v':alias of --show-command' --dry-run':show command instead of sending to device' -w':alias of --show-command' ) _arguments '*:: :->subcmds' _describe -t commands "nvme read options" _read ;; (write) local _wr _wr=( /dev/nvme':supply a device to use (required)' --start-block=':64-bit address of the first logical block to be written' -s':alias of --start-block' --block-count=':number of logical blocks on device to write' -c':alias of --block-count' --data-size=':size of data to be written' -z':alias of --data-size' --metadata-size=':size of metadata to be written' -y':alias of --metadata-size' --ref-tag=':reference tag (for end to end PI)' -r':alias of --ref-tag' --data=':file from which data should be written to device (defaults to stdin)' -d':alias of --data' --prinfo=':protection information and check field' -p':alias of --prinfo' --app-tag-mask=':application tag mask (for end to end PI)' -m':alias of --app-tag-mask' --app-tag=':application tag (for end to end PI)' -a':alias of --app-tag' --limited-retry=':if included, controller should try less hard to send data to media (if not included, all available data-recovery means used)' -l':alias of --limited-retry' --latency':latency statistics will be output following write' -t':alias of --latency' --force-unit-access':data shall be written to nonvolatile media before command completion is indicated' -f':alias of --force-unit-access' --show-command':show command instead of sending to device' -v':alias of --show-command' --dry-run':show command instead of sending to device' -w':alias of --show-command' ) _arguments '*:: :->subcmds' _describe -t commands "nvme write options" _wr ;; (show-regs) local _shor _shor=( /dev/nvme':supply a device to use (required)' ) _arguments '*:: :->subcmds' _describe -t commands "nvme show-regs options" _shor ;; (fid-support-effects-log) local _fidsupporteffectslog _fidsupporteffectslog=( /dev/nvme':supply a device to use (required)' ) _arguments '*:: :->subcmds' _describe -t commands "nvme fid-support-effects-log options" _fidsupporteffectslog ;; (help) local _h _h=( id-ctrl id-ns list-ns id-iocs create-ns delete-ns attach-ns detach-ns list-ctrl get-ns-id get-log fw-log smart-log error-log get-feature set-feature format fw-activate fw-download admin-passthru io-passthru security-send security-recv resv-acquire resv-register resv-release resv-report flush compare read write copy show-regs persistent-event-log pred-lat-event-agg-log nvm-id-ctrl endurance-event-agg-log lba-status-log resv-notif-log capacity-mgmt id-domain boot-part-log fid-support-effects-log supported-log-pages lockdown supported-log-pages list-endgrp ) _arguments '*:: :->subcmds' _describe -t commands "help: infos on a specific nvme command, or provide no option to see a synopsis of all nvme commands" _h ;; (*) _files ;; esac return fi _files } site-functions/_udevadm000064400000013555152626764570011262 0ustar00#compdef udevadm # SPDX-License-Identifier: LGPL-2.1+ _udevadm_info(){ _arguments \ '--query=[Query the database for specified type of device data. It needs the --path or --name to identify the specified device.]:type:(name symlink path property all)' \ '--path=[The devpath of the device to query.]:sys files:_files -P /sys/ -W /sys' \ '--name=[The name of the device node or a symlink to query]:device files:_files -P /dev/ -W /dev' \ '--root[Print absolute paths in name or symlink query.]' \ '--attribute-walk[Print all sysfs properties of the specified device that can be used in udev rules to match the specified device]' \ '--export[Print output as key/value pairs.]' \ '--export-prefix=[Add a prefix to the key name of exported values.]:prefix' \ '--device-id-of-file=[Print major/minor numbers of the underlying device, where the file lives on.]:files:_udevadm_mounts' \ '--export-db[Export the content of the udev database.]' \ '--cleanup-db[Cleanup the udev database.]' } _udevadm_trigger(){ _arguments \ '--verbose[Print the list of devices which will be triggered.]' \ '--dry-run[Do not actually trigger the event.]' \ '--type=[Trigger a specific type of devices.]:types:(devices subsystems failed)' \ '--action=[Type of event to be triggered.]:actions:(add change remove)' \ '--subsystem-match=[Trigger events for devices which belong to a matching subsystem.]' \ '--subsystem-nomatch=[Do not trigger events for devices which belong to a matching subsystem.]' \ '--attr-match=attribute=[Trigger events for devices with a matching sysfs attribute.]' \ '--attr-nomatch=attribute=[Do not trigger events for devices with a matching sysfs attribute.]' \ '--property-match=[Trigger events for devices with a matching property value.]' \ '--tag-match=property[Trigger events for devices with a matching tag.]' \ '--sysname-match=[Trigger events for devices with a matching sys device name.]' \ '--parent-match=[Trigger events for all children of a given device.]' } _udevadm_settle(){ _arguments \ '--timeout=[Maximum number of seconds to wait for the event queue to become empty.]' \ '--seq-start=[Wait only for events after the given sequence number.]' \ '--seq-end=[Wait only for events before the given sequence number.]' \ '--exit-if-exists=[Stop waiting if file exists.]:files:_files' \ '--quiet[Do not print any output, like the remaining queue entries when reaching the timeout.]' \ '--help[Print help text.]' } _udevadm_control(){ _arguments \ '--exit[Signal and wait for systemd-udevd to exit.]' \ '--log-priority=[Set the internal log level of systemd-udevd.]:priorities:(err info debug)' \ '--stop-exec-queue[Signal systemd-udevd to stop executing new events. Incoming events will be queued.]' \ '--start-exec-queue[Signal systemd-udevd to enable the execution of events.]' \ '--reload[Signal systemd-udevd to reload the rules files and other databases like the kernel module index.]' \ '--property=[Set a global property for all events.]' \ '--children-max=[Set the maximum number of events.]' \ '--timeout=[The maximum number of seconds to wait for a reply from systemd-udevd.]' \ '--help[Print help text.]' } _udevadm_monitor(){ _arguments \ '--kernel[Print the kernel uevents.]' \ '--udev[Print the udev event after the rule processing.]' \ '--property[Also print the properties of the event.]' \ '--subsystem-match=[Filter events by subsystem/\[devtype\].]' \ '--tag-match=[Filter events by property.]' \ '--help[Print help text.]' } _udevadm_test(){ _arguments \ '--action=[The action string.]:actions:(add change remove)' \ '--subsystem=[The subsystem string.]' \ '--help[Print help text.]' \ '*::devpath:_files -P /sys/ -W /sys' } _udevadm_test-builtin(){ if (( CURRENT == 2 )); then _arguments \ '--help[Print help text]' \ '*::builtins:(blkid btrfs hwdb input_id net_id net_setup_link kmod path_id usb_id uaccess)' elif (( CURRENT == 3 )); then _arguments \ '--help[Print help text]' \ '*::syspath:_files -P /sys -W /sys' else _arguments \ '--help[Print help text]' fi } _udevadm_mounts(){ local dev_tmp dpath_tmp mp_tmp mline tmp=( "${(@f)$(< /proc/self/mounts)}" ) dev_tmp=( "${(@)${(@)tmp%% *}:#none}" ) mp_tmp=( "${(@)${(@)tmp#* }%% *}" ) local MATCH mp_tmp=("${(@q)mp_tmp//(#m)\\[0-7](#c3)/${(#)$(( 8#${MATCH[2,-1]} ))}}") dpath_tmp=( "${(@Mq)dev_tmp:#/*}" ) dev_tmp=( "${(@q)dev_tmp:#/*}" ) _alternative \ 'device-paths: device path:compadd -a dpath_tmp' \ 'directories:mount point:compadd -a mp_tmp' } _udevadm_command(){ local -a _udevadm_cmds _udevadm_cmds=( 'info:query sysfs or the udev database' 'trigger:request events from the kernel' 'settle:wait for the event queue to finish' 'control:control the udev daemon' 'monitor:listen to kernel and udev events' 'test:test an event run' 'test-builtin:test a built-in command' ) if ((CURRENT == 1)); then _describe -t commands 'udevadm commands' _udevadm_cmds else local curcontext="$curcontext" cmd="${${_udevadm_cmds[(r)$words[1]:*]%%:*}}" if (($#cmd)); then if (( $+functions[_udevadm_$cmd] )); then _udevadm_$cmd else _message "no options for $cmd" fi else _message "no more options" fi fi } _arguments \ '--debug[Print debug messages to stderr]' \ '--version[Print version number]' \ '--help[Print help text]' \ '*::udevadm commands:_udevadm_command' site-functions/_machinectl000064400000007232152626764570011737 0ustar00#compdef machinectl # SPDX-License-Identifier: LGPL-2.1+ __get_available_machines () { machinectl --no-legend list-images | {while read -r a b; do echo $a; done;} } _available_machines() { local -a _machines _machines=("${(fo)$(__get_available_machines)}") typeset -U _machines if [[ -n "$_machines" ]]; then _describe 'machines' _machines else _message 'no machines' fi } (( $+functions[_machinectl_command] )) || _machinectl_command() { local -a _machinectl_cmds _machinectl_cmds=( "list:List currently running VMs/containers" "status:Show VM/container status" "show:Show properties of one or more VMs/containers" "start:Start container as a service" "stop:Stop container (equal to poweroff)" "login:Get a login prompt on a VM/container" "enable:Enable automatic container start at boot" "disable:Disable automatic container start at boot" "poweroff:Power off one or more VMs/containers" "reboot:Reboot one or more VMs/containers" "terminate:Terminate one or more VMs/containers" "kill:Send signal to process or a VM/container" "copy-to:Copy files from the host to a container" "copy-from:Copy files from a container to the host" "bind:Bind mount a path from the host into a container" "list-images:Show available container and VM images" "image-status:Show image details" "show-image:Show properties of image" "clone:Clone an image" "rename:Rename an image" "read-only:Mark or unmark image read-only" "remove:Remove an image" "pull-tar:Download a TAR container image" "pull-raw:Download a RAW container or VM image" "list-transfers:Show list of downloads in progress" "cancel-transfer:Cancel a download" ) if (( CURRENT == 1 )); then _describe -t commands 'machinectl command' _machinectl_cmds || compadd "$@" else local curcontext="$curcontext" cmd="${${_machinectl_cmds[(r)$words[1]:*]%%:*}}" if (( $#cmd )); then if (( CURRENT == 2 )); then case $cmd in list*|cancel-transfer|pull-tar|pull-raw) msg="no options" ;; start) _available_machines ;; *) _sd_machines esac else case $cmd in copy-to|copy-from|bind) _files ;; *) msg="no options" esac fi else _message "no more options" fi fi } _arguments \ {-h,--help}'[Prints a short help text and exits.]' \ '--version[Prints a short version string and exits.]' \ '--no-pager[Do not pipe output into a pager.]' \ '--no-legend[Do not show the headers and footers.]' \ '--no-ask-password[Do not ask for system passwords.]' \ {-H+,--host=}'[Operate on remote host.]:userathost:_sd_hosts_or_user_at_host' \ {-M+,--machine=}'[Operate on local container.]:machine:_sd_machines' \ {-p+,--property=}'[Limit output to specified property.]:property:(Name Id Timestamp TimestampMonotonic Service Scope Leader Class State RootDirectory)' \ {-a,--all}'[Show all proerties.]' \ {-q,--quiet}'[Suppress output.]' \ {-l,--full}'[Do not ellipsize cgroup members.]' \ '--kill-who=[Who to send signal to.]:killwho:(leader all)' \ {-s+,--signal=}'[Which signal to send.]:signal:_signals' \ '--read-only[Create read-only bind mount.]' \ '--mkdir[Create directory before bind mounting, if missing.]' \ {-n+,--lines=}'[Number of journal entries to show.]:integer' \ {-o+,--output=}'[Change journal output mode.]:output modes:_sd_outputmodes' \ '--verify=[Verification mode for downloaded images.]:verify:(no checksum signature)' \ '--force[Download image even if already exists.]' \ '*::machinectl command:_machinectl_command' site-functions/_timedatectl000064400000003772152626764570012134 0ustar00#compdef timedatectl # SPDX-License-Identifier: LGPL-2.1+ _timedatectl_set-timezone(){ local -a _timezones _timezones=( ${(f)"$(_call_program timezones "${service}" list-timezones)"} ) compadd "$_timezones[@]" } _timedatectl_set-time(){ _message "YYYY-MM-DD HH:MM:SS" } _timedatectl_set-local-rtc(){ local -a _options _options=( '0:Maintain RTC in universal time' '1:Maintain RTC in local time' ) _describe options _options } _timedatectl_set-ntp(){ local -a _options _options=( '0:Disable NTP based network time configuration' '1:Enable NTP based network time configuration' ) _describe options _options } _timedatectl_command(){ local -a _timedatectl_cmds _timedatectl_cmds=( 'status:Show current time settings' 'set-time:Set system time' 'set-timezone:Set system timezone' 'list-timezones:Show known timezones' 'set-local-rtc:Control whether RTC is in local time' 'set-ntp:Control whether NTP is enabled' ) if (( CURRENT == 1 )); then _describe -t commands 'timedatectl command' _timedatectl_cmds else local curcontext="$curcontext" cmd="${${_timedatectl_cmds[(r)$words[1]:*]%%:*}}" if (( $#cmd )); then if (( $+functions[_timedatectl_$cmd] )); then _timedatectl_$cmd else _message "no more options" fi else _message "unknown timedatectl command: $words[1]" fi fi } _arguments -s \ {-h,--help}'[Show this help]' \ '--version[Show package version]' \ '--adjust-system-clock[Adjust system clock when changing local RTC mode]' \ '--no-pager[Do not pipe output into a pager]' \ '--no-ask-password[Do not prompt for password]' \ {-H+,--host=}'[Operate on remote host]:userathost:_sd_hosts_or_user_at_host' \ {-M+,--machine=}'[Operate on local container]:machines:_sd_machines' \ '*::timedatectl commands:_timedatectl_command' site-functions/_bootctl000064400000002115152626764570011271 0ustar00#compdef bootctl # SPDX-License-Identifier: LGPL-2.1+ (( $+functions[_bootctl_command] )) || _bootctl_command() { local -a _bootctl_cmds _bootctl_cmds=( "status:Show status of installed systemd-boot and EFI variables" "install:Install systemd-boot to the ESP and EFI variables" "update:Update systemd-boot in the ESP and EFI variables" "remove:Remove systemd-boot from the ESP and EFI variables" ) if (( CURRENT == 1 )); then _describe -t commands 'bootctl command' _bootctl_cmds || compadd "$@" else local curcontext="$curcontext" cmd="${${_bootctl_cmds[(r)$words[1]:*]%%:*}}" if (( $+functions[_bootctl_$cmd] )); then _bootctl_$cmd else _message "no more options" fi fi } _arguments \ {-h,--help}'[Prints a short help text and exits.]' \ '--version[Prints a short version string and exits.]' \ '--path=[Path to the EFI System Partition (ESP)]:path:_directories' \ '--no-variables[Do not touch EFI variables]' \ '*::bootctl command:_bootctl_command' site-functions/_systemctl000064400000036366152626764570011671 0ustar00#compdef systemctl # SPDX-License-Identifier: LGPL-2.1+ (( $+functions[_systemctl_command] )) || _systemctl_command() { local -a _systemctl_cmds _systemctl_cmds=( "list-sockets:List sockets" "list-timers:List timers" "list-units:List units" "start:Start (activate) one or more units" "stop:Stop (deactivate) one or more units" "reload:Reload one or more units" "restart:Start or restart one or more units" "condrestart:Restart one or more units if active" "try-restart:Restart one or more units if active" "reload-or-restart:Reload one or more units if possible, otherwise start or restart" "force-reload:Reload one or more units if possible, otherwise restart if active" "hibernate:Hibernate the system" "hybrid-sleep:Hibernate and suspend the system" "suspend-then-hibernate:Suspend the system for a period of time, and then hibernate it" "try-reload-or-restart:Reload one or more units if possible, otherwise restart if active" "isolate:Start one unit and stop all others" "kill:Send signal to processes of a unit" "is-active:Check whether units are active" "is-failed:Check whether units are failed" "status:Show runtime status of one or more units" "show:Show properties of one or more units/jobs or the manager" "cat:Show the source unit files and drop-ins" "reset-failed:Reset failed state for all, one, or more units" "list-unit-files:List installed unit files" "enable:Enable one or more unit files" "disable:Disable one or more unit files" "add-wants:Add Wants= dependencies to a unit" "add-requires:Add Requires= dependencies to a unit" "reenable:Reenable one or more unit files" "preset:Enable/disable one or more unit files based on preset configuration" "set-default:Set the default target" "get-default:Query the default target" "edit:Edit one or more unit files" "is-system-running:Query overall status of the system" "help:Show documentation for specified units" "list-dependencies:Show unit dependency tree" "mask:Mask one or more units" "unmask:Unmask one or more units" "link:Link one or more units files into the search path" "is-enabled:Check whether unit files are enabled" "list-jobs:List jobs" "cancel:Cancel all, one, or more jobs" "show-environment:Dump environment" "set-environment:Set one or more environment variables" "unset-environment:Unset one or more environment variables" "daemon-reload:Reload systemd manager configuration" "daemon-reexec:Reexecute systemd manager" "default:Enter system default mode" "rescue:Enter system rescue mode" "emergency:Enter system emergency mode" "halt:Shut down and halt the system" "suspend:Suspend the system" "poweroff:Shut down and power-off the system" "reboot:Shut down and reboot the system" "kexec:Shut down and reboot the system with kexec" "exit:Ask for user instance termination" "switch-root:Change root directory" "revert:Revert unit files to their vendor versions" ) if (( CURRENT == 1 )); then _describe -t commands 'systemctl command' _systemctl_cmds || compadd "$@" else local curcontext="$curcontext" expl cmd="${${_systemctl_cmds[(r)$words[1]:*]%%:*}}" # Deal with any aliases case $cmd in condrestart) cmd="try-restart";; force-reload) cmd="try-reload-or-restart";; esac if (( $#cmd )); then curcontext="${curcontext%:*:*}:systemctl-${cmd}:" local update_policy zstyle -s ":completion:${curcontext}:" cache-policy update_policy if [[ -z "$update_policy" ]]; then zstyle ":completion:${curcontext}:" cache-policy _systemctl_caching_policy fi _call_function ret _systemctl_$cmd || _message 'no more arguments' else _message "unknown systemctl command: $words[1]" fi return ret fi } __systemctl() { systemctl $_sys_service_mgr --full --no-legend --no-pager "$@" 2>/dev/null } # Fills the unit list _systemctl_all_units() { if ( [[ ${+_sys_all_units} -eq 0 ]] || _cache_invalid SYS_ALL_UNITS$_sys_service_mgr ) || ! _retrieve_cache SYS_ALL_UNITS$_sys_service_mgr; then _sys_all_units=( ${${(f)"$(__systemctl list-units --all "$PREFIX*" )"}%% *} ) _store_cache SYS_ALL_UNITS$_sys_service_mgr _sys_all_units fi } # Fills the unit list including all file units _systemctl_really_all_units() { local -a all_unit_files; local -a really_all_units; if ( [[ ${+_sys_really_all_units} -eq 0 ]] || _cache_invalid SYS_REALLY_ALL_UNITS$_sys_service_mgr ) || ! _retrieve_cache SYS_REALLY_ALL_UNITS$_sys_service_mgr; then all_unit_files=( ${${(f)"$(__systemctl list-unit-files "$PREFIX*" )"}%% *} ) _systemctl_all_units really_all_units=($_sys_all_units $all_unit_files) _sys_really_all_units=(${(u)really_all_units}) _store_cache SYS_REALLY_ALL_UNITS$_sys_service_mgr _sys_really_all_units fi } _filter_units_by_property() { local property=$1 value=$2; shift 2 local -a units; units=("${(q-)@}") local -A props props=(${(f)"$(_call_program units "$service $_sys_service_mgr show --no-pager --property=\"Id,$property\" -- ${units} 2>/dev/null")"}) echo -E - "${(@g:o:)${(k@)props[(Re)$property=$value]}#Id=}" } _systemctl_get_non_template_names() { echo -E - ${^${(R)${(f)"$( __systemctl $mode list-unit-files "$PREFIX*" __systemctl $mode list-units --all "$PREFIX*" )"}:#*@.*}%%[[:space:]]*} } _systemctl_get_template_names() { echo -E - ${^${(M)${(f)"$(__systemctl list-unit-files "$PREFIX*" )"}##*@.[^[:space:]]##}%%@.*}@ } _systemctl_active_units() {_sys_active_units=( ${${(f)"$(__systemctl list-units "$PREFIX*" )"}%% *} )} _systemctl_startable_units(){ _sys_startable_units=( $( _filter_units_by_property ActiveState inactive $( _filter_units_by_property CanStart yes ${${${(f)"$( __systemctl $mode list-unit-files --state enabled,enabled-runtime,linked,linked-runtime,static,indirect,disabled,generated,transient "$PREFIX*" __systemctl $mode list-units --state inactive,failed "$PREFIX*" )"}:#*@.*}%%[[:space:]]*} )) ) } _systemctl_restartable_units(){ _sys_restartable_units=( $( _filter_units_by_property CanStart yes ${${${(f)"$( __systemctl $mode list-unit-files --state enabled,disabled,static "$PREFIX*" __systemctl $mode list-units "$PREFIX*" )"}:#*@.*}%%[[:space:]]*} ) ) } _systemctl_failed_units() {_sys_failed_units=( ${${(f)"$(__systemctl list-units --state=failed "$PREFIX*" )"}%% *} ) } _systemctl_unit_state() { typeset -gA _sys_unit_state; _sys_unit_state=( $(__systemctl list-unit-files "$PREFIX*" ) ) } local fun # Completion functions for ALL_UNITS for fun in cat mask ; do (( $+functions[_systemctl_$fun] )) || _systemctl_$fun() { _systemctl_really_all_units _wanted systemd-units expl unit \ compadd "$@" -a - _sys_really_all_units } done # Completion functions for NONTEMPLATE_UNITS for fun in is-active is-failed is-enabled status show preset help list-dependencies edit revert add-wants add-requires ; do (( $+functions[_systemctl_$fun] )) || _systemctl_$fun() { _wanted systemd-units expl unit \ compadd "$@" - $(_systemctl_get_non_template_names) } done # Completion functions for ENABLED_UNITS (( $+functions[_systemctl_disable] )) || _systemctl_disable() { local _sys_unit_state; _systemctl_unit_state _wanted systemd-units expl 'enabled unit' \ compadd "$@" - ${(k)_sys_unit_state[(R)enabled]} } (( $+functions[_systemctl_reenable] )) || _systemctl_reenable() { local _sys_unit_state; _systemctl_unit_state _wanted systemd-units expl 'enabled/disabled unit' \ compadd "$@" - ${(k)_sys_unit_state[(R)(enabled|disabled)]} $(_systemctl_get_template_names) } # Completion functions for DISABLED_UNITS (( $+functions[_systemctl_enable] )) || _systemctl_enable() { local _sys_unit_state; _systemctl_unit_state _wanted systemd-units expl 'disabled unit' \ compadd "$@" - ${(k)_sys_unit_state[(R)disabled]} $(_systemctl_get_template_names) } # Completion functions for FAILED_UNITS (( $+functions[_systemctl_reset-failed] )) || _systemctl_reset-failed() { local _sys_failed_units; _systemctl_failed_units _wanted systemd-units expl 'failed unit' \ compadd "$@" -a - _sys_failed_units || _message "no failed unit found" } # Completion functions for STARTABLE_UNITS (( $+functions[_systemctl_start] )) || _systemctl_start() { local _sys_startable_units; _systemctl_startable_units _wanted systemd-units expl 'startable unit' \ compadd "$@" - ${_sys_startable_units[*]} } # Completion functions for STOPPABLE_UNITS for fun in stop kill try-restart condrestart ; do (( $+functions[_systemctl_$fun] )) || _systemctl_$fun() { local _sys_active_units; _systemctl_active_units _wanted systemd-units expl 'stoppable unit' \ compadd "$@" - $( _filter_units_by_property CanStop yes \ ${_sys_active_units[*]} ) } done # Completion functions for ISOLATABLE_UNITS (( $+functions[_systemctl_isolate] )) || _systemctl_isolate() { _systemctl_all_units _wanted systemd-units expl 'isolatable unit' \ compadd "$@" - $( _filter_units_by_property AllowIsolate yes \ ${_sys_all_units[*]} ) } # Completion functions for RELOADABLE_UNITS for fun in reload try-reload-or-restart force-reload ; do (( $+functions[_systemctl_$fun] )) || _systemctl_$fun() { local _sys_active_units; _systemctl_active_units _wanted systemd-units expl 'reloadable unit' \ compadd "$@" - $( _filter_units_by_property CanReload yes \ ${_sys_active_units[*]} ) } done # Completion functions for RESTARTABLE_UNITS for fun in restart reload-or-restart ; do (( $+functions[_systemctl_$fun] )) || _systemctl_$fun() { local _sys_restartable_units; _systemctl_restartable_units _wanted systemd-units expl 'restartable unit' \ compadd "$@" - ${_sys_restartable_units[*]} } done # Completion functions for MASKED_UNITS (( $+functions[_systemctl_unmask] )) || _systemctl_unmask() { local _sys_unit_state; _systemctl_unit_state _wanted systemd-units expl 'masked unit' \ compadd "$@" - ${(k)_sys_unit_state[(R)masked]} || _message "no masked units found" } # Completion functions for JOBS (( $+functions[_systemctl_cancel] )) || _systemctl_cancel() { _wanted systemd-jobs expl job \ compadd "$@" - ${${(f)"$(__systemctl list-jobs)"}%% *} || _message "no jobs found" } # Completion functions for TARGETS (( $+functions[_systemctl_set-default] )) || _systemctl_set-default() { _wanted systemd-targets expl target \ compadd "$@" - ${${(f)"$(__systemctl list-unit-files --type target --all "$PREFIX*" )"}%% *} || _message "no targets found" } # Completion functions for ENVS for fun in set-environment unset-environment ; do (( $+functions[_systemctl_$fun] )) || _systemctl_$fun() { local fun=$0 ; fun=${fun##_systemctl_} local suf if [[ "${fun}" = "set-environment" ]]; then suf='-S=' fi _wanted systemd-environment expl 'environment variable' \ compadd "$@" ${suf} - ${${(f)"$(systemctl show-environment)"}%%=*} } done (( $+functions[_systemctl_link] )) || _systemctl_link() { _sd_unit_files } (( $+functions[_systemctl_switch-root] )) || _systemctl_switch-root() { _files } # no systemctl completion for: # [STANDALONE]='daemon-reexec daemon-reload default # emergency exit halt kexec list-jobs list-units # list-unit-files poweroff reboot rescue show-environment' _systemctl_caching_policy() { local _sysunits local -a oldcache # rebuild if cache is more than a day old oldcache=( "$1"(mh+1) ) (( $#oldcache )) && return 0 _sysunits=(${${(f)"$(__systemctl --all)"}%% *}) if (( $#_sysunits )); then for unit in $_sysunits; do [[ "$unit" -nt "$1" ]] && return 0 done fi return 1 } _unit_states() { local -a _states _states=("${(fo)$(__systemctl --state=help)}") _values -s , "${_states[@]}" } _unit_types() { local -a _types _types=("${(fo)$(__systemctl -t help)}") _values -s , "${_types[@]}" } _unit_properties() { if ( [[ ${+_sys_all_properties} -eq 0 ]] || _cache_invalid SYS_ALL_PROPERTIES$_sys_service_mgr ) || ! _retrieve_cache SYS_ALL_PROPERTIES$_sys_service_mgr; then _sys_all_properties=( ${${(M)${(f)"$(/usr/lib/systemd/systemd --dump-bus-properties)"}}} ) _store_cache SYS_ALL_PROPERTIES$_sys_service_mgr _sys_all_properties fi _values -s , "${_sys_all_properties[@]}" } _job_modes() { local -a _modes _modes=(fail replace replace-irreversibly isolate ignore-dependencies ignore-requirements flush) _values -s , "${_modes[@]}" } (( $+functions[_systemctl_check_inhibitors] )) || _systemctl_check_inhibitors() { local -a _modes _modes=(auto yes no) _values -s , "${_modes[@]}" } # Build arguments for "systemctl" to be used in completion. local -a _modes; _modes=("--user" "--system") # Use the last mode (they are exclusive and the last one is used). local _sys_service_mgr=${${words:*_modes}[(R)(${(j.|.)_modes})]} _arguments -s \ {-h,--help}'[Show help]' \ '--version[Show package version]' \ {-t+,--type=}'[List only units of a particular type]:unit type:_unit_types' \ '--state=[Display units in the specified state]:unit state:_unit_states' \ '--job-mode=[Specify how to deal with other jobs]:mode:_job_modes' \ {-p+,--property=}'[Show only properties by specific name]:unit property:_unit_properties' \ {-a,--all}'[Show all units/properties, including dead/empty ones]' \ '--reverse[Show reverse dependencies]' \ '--after[Show units ordered after]' \ '--before[Show units ordered before]' \ {-l,--full}"[Don't ellipsize unit names on output]" \ '--show-types[When showing sockets, show socket type]' \ '--check-inhibitors[Specify if inhibitors should be checked]:mode:_systemctl_check_inhibitors' \ {-q,--quiet}'[Suppress output]' \ '--no-block[Do not wait until operation finished]' \ '--no-legend[Do not print a legend, i.e. the column headers and the footer with hints]' \ '--no-pager[Do not pipe output into a pager]' \ '--system[Connect to system manager]' \ '--user[Connect to user service manager]' \ "--no-wall[Don't send wall message before halt/power-off/reboot]" \ '--global[Enable/disable/mask unit files globally]' \ "--no-reload[When enabling/disabling unit files, don't reload daemon configuration]" \ '--no-ask-password[Do not ask for system passwords]' \ '--kill-who=[Who to send signal to]:killwho:(main control all)' \ {-s+,--signal=}'[Which signal to send]:signal:_signals' \ {-f,--force}'[When enabling unit files, override existing symlinks. When shutting down, execute action immediately]' \ '--root=[Enable/disable/mask unit files in the specified root directory]:directory:_directories' \ '--runtime[Enable/disable/mask unit files only temporarily until next reboot]' \ {-H+,--host=}'[Operate on remote host]:userathost:_sd_hosts_or_user_at_host' \ {-P,--privileged}'[Acquire privileges before execution]' \ {-n+,--lines=}'[Journal entries to show]:number of entries' \ {-o+,--output=}'[Change journal output mode]:modes:_sd_outputmodes' \ '--firmware-setup[Tell the firmware to show the setup menu on next boot]' \ '--plain[When used with list-dependencies, print output as a list]' \ '--failed[Show failed units]' \ '*::systemctl command:_systemctl_command' site-functions/_busctl000064400000005761152626764570011131 0ustar00#compdef busctl # SPDX-License-Identifier: LGPL-2.1+ # busctl(1) completion -*- shell-script -*- # # This file is part of systemd. # # systemd is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or # (at your option) any later version. # # systemd is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with systemd; If not, see . (( $+functions[_busctl_command] )) || _busctl_command() { local -a _busctl_cmds _busctl_cmds=( "list:List bus names" "status:Show bus service, process or bus owner credentials" "monitor:Show bus traffic" "capture:Capture bus traffix as pcap" "tree:Show object tree of service" "introspect:Introspect object" "call:Call a method" "get-property:Get property value" "set-property:Set property value" ) if (( CURRENT == 1 )); then _describe -t commands 'busctl command' _busctl_cmds || compadd "$@" else local curcontext="$curcontext" cmd="${${_busctl_cmds[(r)$words[1]:*]%%:*}}" if (( $+functions[_busctl_$cmd] )); then _busctl_$cmd else _message "no more options" fi fi } _arguments \ {-h,--help}'[Prints a short help text and exits.]' \ '--version[Prints a short version string and exits.]' \ '--no-pager[Do not pipe output into a pager]' \ '--no-legend[Do not show the headers and footers]' \ '--system[Connect to system manager]' \ '--user[Connect to user service manager]' \ {-H+,--host=}'[Operate on remote host]:userathost:_sd_hosts_or_user_at_host' \ {-M+,--machine=}'[Operate on local container]:machines:_sd_machines' \ '--address=[Connect to the bus specified by address]:address' \ '--show-machine[Show machine ID column in list]' \ '--unique[Only show unique names]' \ '--acquired[Only show acquired names]' \ '--activatable[Only show activatable names]' \ '--match=[Only show matching messages]:match' \ '--list[Do not show tree, but simple object path list]' \ '--quiet[Do not show method call reply]'\ '--verbose[Show result values in long format]' \ '--expect-reply=[Expect a method call reply]:boolean:(1 0)' \ '--auto-start=[Auto-start destination service]:boolean:(1 0)' \ '--allow-interactive-authorization=[Allow interactive authorization for operation]:boolean:(1 0)' \ '--timeout=[Maximum time to wait for method call completion]:timeout (seconds)' \ '--augment-creds=[Extend credential data with data read from /proc/$PID]:boolean:(1 0)' \ '*::busctl command:_busctl_command' site-functions/_kernel-install000064400000001213152626764570012545 0ustar00#compdef kernel-install # SPDX-License-Identifier: LGPL-2.1+ _images(){ if [[ "$words[2]" == "remove" ]]; then _message 'No more options' else _path_files -W /boot/ -P /boot/ -g "vmlinuz-*" fi } _kernels(){ read _MACHINE_ID < /etc/machine-id _kernel=( /lib/modules/[0-9]* ) if [[ "$cmd" == "remove" && -n "$_MACHINE_ID" ]]; then _kernel=( "/boot/$_MACHINE_ID"/[0-9]* ) fi _kernel=( ${_kernel##*/} ) _describe "installed kernels" _kernel } _arguments \ '1::add or remove:(add remove)' \ '2::kernel versions:_kernels' \ '3::kernel images:_images' #vim: set ft=zsh sw=4 ts=4 et site-functions/_curl000064400000032164152626764570010577 0ustar00#compdef curl # curl zsh completion local curcontext="$curcontext" state state_descr line typeset -A opt_args local rc=1 _arguments -C -S \ --happy-eyeballs-timeout-ms'[How long to wait in milliseconds for IPv6 before trying IPv4]':'' \ --aws-sigv4'[Use AWS V4 signature authentication]':'' \ {-c,--cookie-jar}'[Write cookies to after operation]':'':_files \ {-D,--dump-header}'[Write the received headers to ]':'':_files \ {-y,--speed-time}'[Trigger '\''speed-limit'\'' abort after this time]':'' \ --proxy-cacert'[CA certificate to verify peer against for proxy]':'':_files \ --tls13-ciphers'[of TLS 1.3 ciphersuites> TLS 1.3 cipher suites to use]':'' \ --libcurl'[Dump libcurl equivalent code of this command line]':'':_files \ --proxy-capath'[CA directory to verify peer against for proxy]':'':_files \ --proxy-negotiate'[HTTP Negotiate (SPNEGO) authentication on the proxy]':'Use' \ --proxy-pinnedpubkey'[FILE/HASHES public key to verify proxy with]':'' \ --crlfile'[Get a CRL list in PEM format from the given file]':'':_files \ --proxy-insecure'[HTTPS proxy connections without verifying the proxy]':'Do' \ --proxy-ssl-allow-beast'[security flaw for interop for HTTPS proxy]':'Allow' \ --abstract-unix-socket'[Connect via abstract Unix domain socket]':'' \ --pinnedpubkey'[FILE/HASHES Public key to verify peer against]':'' \ --proxy-pass'[Pass phrase for the private key for HTTPS proxy]':'' \ {-p,--proxytunnel}'[Operate through an HTTP proxy tunnel (using CONNECT)]' \ --socks5-hostname'[SOCKS5 proxy, pass host name to proxy]':'' \ --proto-default'[Use PROTOCOL for any URL missing a scheme]':'' \ --proxy-tls13-ciphers'[list> TLS 1.3 proxy cipher suites]':'' \ --ftp-alternative-to-user'[String to replace USER \[name\]]':'' \ --ftp-ssl-control'[SSL/TLS for FTP login, clear for transfer]':'Require' \ {-T,--upload-file}'[Transfer local FILE to destination]':'':_files \ --local-port'[Force use of RANGE for local port numbers]':'' \ --proxy-tlsauthtype'[TLS authentication type for HTTPS proxy]':'' \ {-R,--remote-time}'[Set the remote file'\''s time on the local output]' \ --retry-connrefused'[on connection refused (use with --retry)]':'Retry' \ --suppress-connect-headers'[proxy CONNECT response headers]':'Suppress' \ {-j,--junk-session-cookies}'[session cookies read from file]':'Ignore' \ --location-trusted'[--location, and send auth to other hosts]':'Like' \ --proxy-cert-type'[Client certificate type for HTTPS proxy]':'' \ {-O,--remote-name}'[Write output to a file named as the remote file]' \ --trace-ascii'[Like --trace, but without hex output]':'':_files \ --connect-timeout'[Maximum time allowed for connection]':'' \ --expect100-timeout'[How long to wait for 100-continue]':'' \ {-g,--globoff}'[Disable URL sequences and ranges using {} and \[\]]' \ {-m,--max-time}'[Maximum time allowed for the transfer]':'' \ --dns-ipv4-addr'[IPv4 address to use for DNS requests]':'
' \ --dns-ipv6-addr'[IPv6 address to use for DNS requests]':'
' \ --ignore-content-length'[the size of the remote resource]':'Ignore' \ {-k,--insecure}'[Allow insecure server connections when using SSL]' \ --mail-auth'[Originator address of the original email]':'
' \ --noproxy'[List of hosts which do not use proxy]':'' \ --proto-redir'[Enable/disable PROTOCOLS on redirect]':'' \ --dns-interface'[Interface to use for DNS requests]':'' \ --hostpubmd5'[Acceptable MD5 hash of the host public key]':'' \ --keepalive-time'[Interval time for keepalive probes]':'' \ --proxy-cert'[Set client certificate for proxy]':'' \ --random-file'[File for reading random data from]':'':_files \ --socks5-basic'[Enable username/password auth for SOCKS5 proxies]' \ --cacert'[CA certificate to verify peer against]':'':_files \ {-H,--header}'[Pass custom header(s) to server]':'
' \ {-i,--include}'[Include protocol response headers in the output]' \ --proxy-header'[Pass custom header(s) to proxy]':'
' \ --unix-socket'[Connect through this Unix domain socket]':'' \ {-w,--write-out}'[Use output FORMAT after completion]':'' \ --http2-prior-knowledge'[HTTP 2 without HTTP/1.1 Upgrade]':'Use' \ {-o,--output}'[Write to file instead of stdout]':'':_files \ {-J,--remote-header-name}'[the header-provided filename]':'Use' \ --socks4a'[SOCKS4a proxy on given host + port]':'' \ {-Y,--speed-limit}'[Stop transfers slower than this]':'' \ {-z,--time-cond}'[Transfer based on a time condition]':'