_systemd-analyze revision 2c12a402cb1e8277c271ced8dc9c06d20b8f6017
7abfbe7903d8e792850ec39286a3d86e616a6477William Giokas#compdef systemd-analyze
fe05567c31cb88593a09ce5d8961d8b20627feb1Zbigniew Jędrzejewski-Szmek_systemd_analyze_set-log-level() {
fe05567c31cb88593a09ce5d8961d8b20627feb1Zbigniew Jędrzejewski-Szmek local -a _levels
fe05567c31cb88593a09ce5d8961d8b20627feb1Zbigniew Jędrzejewski-Szmek _levels=(debug info notice warning err crit alert emerg)
fe05567c31cb88593a09ce5d8961d8b20627feb1Zbigniew Jędrzejewski-Szmek _describe -t level 'logging level' _levels || compadd "$@"
2c12a402cb1e8277c271ced8dc9c06d20b8f6017Zbigniew Jędrzejewski-Szmek_systemd_analyze_verify() {
7abfbe7903d8e792850ec39286a3d86e616a6477William Giokas_systemd_analyze_command(){
7abfbe7903d8e792850ec39286a3d86e616a6477William Giokas local -a _systemd_analyze_cmds
7abfbe7903d8e792850ec39286a3d86e616a6477William Giokas # Descriptions taken from systemd-analyze --help.
7abfbe7903d8e792850ec39286a3d86e616a6477William Giokas _systemd_analyze_cmds=(
7abfbe7903d8e792850ec39286a3d86e616a6477William Giokas 'time:Print time spent in the kernel before reaching userspace'
7abfbe7903d8e792850ec39286a3d86e616a6477William Giokas 'blame:Print list of running units ordered by time to init'
7abfbe7903d8e792850ec39286a3d86e616a6477William Giokas 'critical-chain:Print a tree of the time critical chain of units'
7abfbe7903d8e792850ec39286a3d86e616a6477William Giokas 'plot:Output SVG graphic showing service initialization'
7abfbe7903d8e792850ec39286a3d86e616a6477William Giokas 'dot:Dump dependency graph (in dot(1) format)'
299c397c127cda34facbe7d089f944a708ec95e9Zbigniew Jędrzejewski-Szmek 'dump:Dump server status'
fe05567c31cb88593a09ce5d8961d8b20627feb1Zbigniew Jędrzejewski-Szmek 'set-log-level:Set systemd log threshold'
2c12a402cb1e8277c271ced8dc9c06d20b8f6017Zbigniew Jędrzejewski-Szmek 'verify:Check unit files for correctness'
7abfbe7903d8e792850ec39286a3d86e616a6477William Giokas if (( CURRENT == 1 )); then
7abfbe7903d8e792850ec39286a3d86e616a6477William Giokas _describe "options" _systemd_analyze_cmds
fe05567c31cb88593a09ce5d8961d8b20627feb1Zbigniew Jędrzejewski-Szmek local curcontext="$curcontext"
fe05567c31cb88593a09ce5d8961d8b20627feb1Zbigniew Jędrzejewski-Szmek cmd="${${_systemd_analyze_cmds[(r)$words[1]:*]%%:*}}"
fe05567c31cb88593a09ce5d8961d8b20627feb1Zbigniew Jędrzejewski-Szmek if (( $#cmd )); then
fe05567c31cb88593a09ce5d8961d8b20627feb1Zbigniew Jędrzejewski-Szmek if (( $+functions[_systemd_analyze_$cmd] )) && (( CURRENT == 2 )); then
fe05567c31cb88593a09ce5d8961d8b20627feb1Zbigniew Jędrzejewski-Szmek _systemd_analyze_$cmd
fe05567c31cb88593a09ce5d8961d8b20627feb1Zbigniew Jędrzejewski-Szmek _message "no more options"
fe05567c31cb88593a09ce5d8961d8b20627feb1Zbigniew Jędrzejewski-Szmek _message "unknown systemd-analyze command: $words[1]"
7abfbe7903d8e792850ec39286a3d86e616a6477William Giokas {-h,--help}'[Show help text.]' \
2c12a402cb1e8277c271ced8dc9c06d20b8f6017Zbigniew Jędrzejewski-Szmek '--system[Operate on system systemd instance.]' \
2c12a402cb1e8277c271ced8dc9c06d20b8f6017Zbigniew Jędrzejewski-Szmek '--user[Operate on user systemd instance.]' \
2c12a402cb1e8277c271ced8dc9c06d20b8f6017Zbigniew Jędrzejewski-Szmek '--no-pager[Do not user pager.]' \
2c12a402cb1e8277c271ced8dc9c06d20b8f6017Zbigniew Jędrzejewski-Szmek '--no-man[Do not check man pages.]' \
7abfbe7903d8e792850ec39286a3d86e616a6477William Giokas '--order[When generating graph for dot, show only order]' \
7abfbe7903d8e792850ec39286a3d86e616a6477William Giokas '--require[When generating graph for dot, show only requirement]' \
2c12a402cb1e8277c271ced8dc9c06d20b8f6017Zbigniew Jędrzejewski-Szmek {-H+,--host=}'[Operate on remote host]:userathost:_sd_hosts_or_user_at_host' \
2c12a402cb1e8277c271ced8dc9c06d20b8f6017Zbigniew Jędrzejewski-Szmek {-M+,--machine=}'[Operate on local container]:machine' \
7abfbe7903d8e792850ec39286a3d86e616a6477William Giokas '*::systemd-analyze commands:_systemd_analyze_command'