1 #compdef systemd-analyze systemd-cat systemd-ask-password systemd-cgls systemd-cgtop systemd-delta systemd-detect-virt systemd-inhibit systemd-machine-id-setup systemd-notify systemd-tmpfiles systemd-tty-ask-password-agent machinectl
5 local curcontext="$curcontext" state lstate line
9 {-h,--help}'[Show help text.]' \
10 '--user[Shows performance data of user sessions instead of the system manager.]' \
11 '--order[When generating graph for dot, show only order]' \
12 '--require[When generating graph for dot, show only requirement]' \
13 '*::systemd-analyze commands:_systemd_analyze_command'
17 {-h,--help}'[Show this help]' \
18 '--icon=[Icon name]' \
19 '--timeout=[Timeout in sec]' \
20 '--no-tty[Ask question via agent even on TTY]' \
21 '--accept-cached[Accept cached passwords]' \
22 '--multiple[List multiple passwords if available]'
26 {-h,--help}'[Show this help]' \
27 '--version[Show package version.]' \
28 {-t,--identifier=}'[Set syslog identifier.]' \
29 {-p,--priority=}'[Set priority value.]:value:({0..7})' \
30 '--level-prefix=[Control whether level prefix shall be parsed.]:boolean:(1 0)' \
35 {-h,--help}'[Show this help]' \
36 '--version[Show package version]' \
37 '--no-pager[Do not pipe output into a pager]' \
38 {-a,--all}'[Show all groups, including empty]' \
39 '-k[Include kernel threads in output]' \
40 ':cgroups:(cpuset cpu cpuacct memory devices freezer net_cls blkio)'
44 {-h,--help}'[Show this help]' \
45 '--version[Print version and exit]' \
46 '(-c -m -i -t)-p[Order by path]' \
47 '(-c -p -m -i)-t[Order by number of tasks]' \
48 '(-m -p -i -t)-c[Order by CPU load]' \
49 '(-c -p -i -t)-m[Order by memory load]' \
50 '(-c -m -p -t)-i[Order by IO load]' \
51 {-d,--delay=}'[Specify delay]' \
52 {-n,--iterations=}'[Run for N iterations before exiting]' \
53 {-b,--batch}'[Run in batch mode, accepting no input]' \
54 '--depth=[Maximum traversal depth]'
58 {-h,--help}'[Show this help]' \
59 '--version[Show package version]' \
60 '--no-pager[Do not pipe output into a pager]' \
61 '--diff=[Show a diff when overridden files differ]:boolean:(1 0)' \
62 {-t,--type=}'[Only display a selected set of override types]:types:(masked equivalent redirected overridden unchanged)' \
63 ':SUFFIX:(tmpfiles.d sysctl.d systemd/system)'
67 {-h,--help}'[Show this help]' \
68 '--version[Show package version]' \
69 {-c,--container}'[Only detect whether we are run in a container]' \
70 {-v,--vm}'[Only detect whether we are run in a VM]' \
71 {-q,--quiet}"[Don't output anything, just set return value]"
75 {-h,--help}'[Show this help]' \
76 '--version[Show package version]' \
77 '--what=[Operations to inhibit]:options:(shutdown sleep idle handle-power-key handle-suspend-key handle-hibernate-key handle-lid-switch)' \
78 '--who=[A descriptive string who is inhibiting]' \
79 '--why=[A descriptive string why is being inhibited]' \
80 '--mode=[One of block or delay]' \
81 '--list[List active inhibitors]' \
82 '*:commands:_systemd_inhibit_command'
84 systemd-machine-id-setup)
86 {-h,--help}'[Show this help]' \
87 '--version[Show package version]'
91 {-h,--help}'[Show this help]' \
92 '--version[Show package version]' \
93 '--ready[Inform the init system about service start-up completion.]' \
94 '--pid=[Inform the init system about the main PID of the daemon]' \
95 '--status=[Send a free-form status string for the daemon to the init systemd]' \
96 '--booted[Returns 0 if the system was booted up with systemd]' \
97 '--readahead=[Controls disk read-ahead operations]:arguments:(cancel done noreply)'
101 '--create[Create, set ownership/permissions based on the config files.]' \
102 '--clean[Clean up all files and directories with an age parameter configured.]' \
103 '--remove[All files and directories marked with r, R in the configuration files are removed.]' \
104 '--prefix=[Only apply rules that apply to paths with the specified prefix.]' \
105 '--exclude-prefix=[Ignore rules that apply to paths with the specified prefix.]' \
106 '--help[Prints a short help text and exits.]' \
109 systemd-tty-ask-password-agent)
111 {-h,--help}'[Prints a short help text and exits.]' \
112 '--version[Prints a short version string and exits.]' \
113 '--list[Lists all currently pending system password requests.]' \
114 '--query[Process all currently pending system password requests by querying the user on the calling TTY.]' \
115 '--watch[Continuously process password requests.]' \
116 '--wall[Forward password requests to wall(1).]' \
117 '--plymouth[Ask question with plymouth(8).]' \
118 '--console[Ask question on /dev/console.]'
122 {-h,--help}'[Prints a short help text and exits.]' \
123 '--version[Prints a short version string and exits.]' \
124 {-p,--property=}'[Limit output to specified property.]:property:(Name Id Timestamp TimestampMonotonic Service Scope Leader Class State RootDirectory)' \
125 {-a,--all}'[Show all proerties]' \
126 (-l,--full)'[Do not ellipsize cgroup members]' \
127 '--no-pager[Do not pipe output into a pager]' \
128 '--no-ask-password[Do not ask for system passwords]' \
129 '--kill-who=[Who to send signal to]:killwho:(leader all)' \
130 {-s,--signal=}'[Which signal to send]:signal:_signals' \
131 {-H,--host=}'[Show information for remote host]:userathost:_hosts_or_user_at_host' \
132 {-P,--privileged}'[Acquire privileges before execution]' \
133 '*::machinectl command:_machinectl_command'
139 _systemd_inhibit_command(){
140 if (( CURRENT == 1 )); then
144 local n=${words[(b:2:i)[^-]*]}
145 if (( n <= CURRENT )); then
148 'files:file:_files' \
149 'commands:command:_normal' && return 0
156 _systemd_analyze_command(){
157 local -a _systemd_analyze_cmds
158 # Descriptions taken from systemd-analyze --help.
159 _systemd_analyze_cmds=(
160 'time:Print time spent in the kernel before reaching userspace'
161 'blame:Print list of running units ordered by time to init'
162 'critical-chain:Print a tree of the time critical chain of units'
163 'plot:Output SVG graphic showing service initialization'
164 'dot:Dump dependency graph (in dot(1) format)'
167 if (( CURRENT == 1 )); then
168 _describe "options" _systemd_analyze_cmds
170 _message "no more options"
174 _hosts_or_user_at_host()
177 'users-hosts:: _user_at_host' \
182 local -a _output_opts
183 _output_opts=(short short-monotonic verbose export json json-pretty json-see cat)
184 _describe -t output 'output mode' _output_opts || compadd "$@"
187 (( $+functions[_machinectl_command] )) || _machinectl_command()
189 local -a _machinectl_cmds
191 "list:List currently running VMs/containers"
192 "status:Show VM/container status"
193 "show:Show properties of one or more VMs/containers"
194 "terminate:Terminate one or more VMs/containers"
195 "kill:Send signal to process or a VM/container"
197 if (( CURRENT == 1 )); then
198 _describe -t commands 'machinectl command' _machinectl_cmds || compadd "$@"
200 local curcontext="$curcontext"
201 cmd="${${_machinectl_cmds[(r)$words[1]:*]%%:*}}"
204 list) msg="no options" ;;
206 _machines=( "${(foa)$(machinectl list | awk '{print $1}')}" )
207 if [[ -n "$_machines" ]]; then
208 _describe 'machines' _machines
210 _message 'no machines'
214 _message "no more options"
221 #vim: set ft=zsh sw=4 ts=4 et