_systemd-analyze revision fe05567c31cb88593a09ce5d8961d8b20627feb1
45e9809aff7304721fddb95654901b32195c9c7avboxsync#compdef systemd-analyze
45e9809aff7304721fddb95654901b32195c9c7avboxsync_systemd_analyze_set-log-level() {
45e9809aff7304721fddb95654901b32195c9c7avboxsync local -a _levels
45e9809aff7304721fddb95654901b32195c9c7avboxsync _levels=(debug info notice warning err crit alert emerg)
45e9809aff7304721fddb95654901b32195c9c7avboxsync _describe -t level 'logging level' _levels || compadd "$@"
45e9809aff7304721fddb95654901b32195c9c7avboxsync_systemd_analyze_command(){
45e9809aff7304721fddb95654901b32195c9c7avboxsync local -a _systemd_analyze_cmds
45e9809aff7304721fddb95654901b32195c9c7avboxsync # Descriptions taken from systemd-analyze --help.
45e9809aff7304721fddb95654901b32195c9c7avboxsync _systemd_analyze_cmds=(
45e9809aff7304721fddb95654901b32195c9c7avboxsync 'time:Print time spent in the kernel before reaching userspace'
45e9809aff7304721fddb95654901b32195c9c7avboxsync 'blame:Print list of running units ordered by time to init'
45e9809aff7304721fddb95654901b32195c9c7avboxsync 'critical-chain:Print a tree of the time critical chain of units'
45e9809aff7304721fddb95654901b32195c9c7avboxsync 'plot:Output SVG graphic showing service initialization'
45e9809aff7304721fddb95654901b32195c9c7avboxsync 'dot:Dump dependency graph (in dot(1) format)'
45e9809aff7304721fddb95654901b32195c9c7avboxsync 'set-log-level:Set systemd log threshold'
45e9809aff7304721fddb95654901b32195c9c7avboxsync if (( CURRENT == 1 )); then
45e9809aff7304721fddb95654901b32195c9c7avboxsync _describe "options" _systemd_analyze_cmds
45e9809aff7304721fddb95654901b32195c9c7avboxsync local curcontext="$curcontext"
45e9809aff7304721fddb95654901b32195c9c7avboxsync cmd="${${_systemd_analyze_cmds[(r)$words[1]:*]%%:*}}"
45e9809aff7304721fddb95654901b32195c9c7avboxsync if (( $#cmd )); then
45e9809aff7304721fddb95654901b32195c9c7avboxsync if (( $+functions[_systemd_analyze_$cmd] )) && (( CURRENT == 2 )); then
45e9809aff7304721fddb95654901b32195c9c7avboxsync _systemd_analyze_$cmd
45e9809aff7304721fddb95654901b32195c9c7avboxsync _message "no more options"
45e9809aff7304721fddb95654901b32195c9c7avboxsync _message "unknown systemd-analyze command: $words[1]"
45e9809aff7304721fddb95654901b32195c9c7avboxsync_arguments \
45e9809aff7304721fddb95654901b32195c9c7avboxsync {-h,--help}'[Show help text.]' \
45e9809aff7304721fddb95654901b32195c9c7avboxsync '--user[Shows performance data of user sessions instead of the system manager.]' \
45e9809aff7304721fddb95654901b32195c9c7avboxsync '--order[When generating graph for dot, show only order]' \
45e9809aff7304721fddb95654901b32195c9c7avboxsync '--require[When generating graph for dot, show only requirement]' \
45e9809aff7304721fddb95654901b32195c9c7avboxsync '*::systemd-analyze commands:_systemd_analyze_command'