chiark / gitweb /
zsh_completion: Split out zsh _machinectl
[elogind.git] / shell-completion / zsh / _systemd
1 #compdef systemd-cat systemd-ask-password systemd-cgls systemd-cgtop systemd-delta systemd-detect-virt systemd-machine-id-setup systemd-notify systemd-tmpfiles systemd-tty-ask-password-agent
2
3 _ctls()
4 {
5     local curcontext="$curcontext" state lstate line
6     case "$service" in
7         systemd-ask-password)
8             _arguments \
9                 {-h,--help}'[Show this help]' \
10                 '--icon=[Icon name]' \
11                 '--timeout=[Timeout in sec]' \
12                 '--no-tty[Ask question via agent even on TTY]' \
13                 '--accept-cached[Accept cached passwords]' \
14                 '--multiple[List multiple passwords if available]'
15         ;;
16         systemd-cat)
17             _arguments \
18                 {-h,--help}'[Show this help]' \
19                 '--version[Show package version.]' \
20                 {-t,--identifier=}'[Set syslog identifier.]' \
21                 {-p,--priority=}'[Set priority value.]:value:({0..7})' \
22                 '--level-prefix=[Control whether level prefix shall be parsed.]:boolean:(1 0)' \
23                 ':Message'
24         ;;
25         systemd-cgls)
26             _arguments \
27                 {-h,--help}'[Show this help]' \
28                 '--version[Show package version]' \
29                 '--no-pager[Do not pipe output into a pager]' \
30                 {-a,--all}'[Show all groups, including empty]' \
31                 '-k[Include kernel threads in output]' \
32                 ':cgroups:(cpuset cpu cpuacct memory devices freezer net_cls blkio)'
33         ;;
34         systemd-cgtop)
35             _arguments \
36                 {-h,--help}'[Show this help]' \
37                 '--version[Print version and exit]' \
38                 '(-c -m -i -t)-p[Order by path]' \
39                 '(-c -p -m -i)-t[Order by number of tasks]' \
40                 '(-m -p -i -t)-c[Order by CPU load]' \
41                 '(-c -p -i -t)-m[Order by memory load]' \
42                 '(-c -m -p -t)-i[Order by IO load]' \
43                 {-d,--delay=}'[Specify delay]' \
44                 {-n,--iterations=}'[Run for N iterations before exiting]' \
45                 {-b,--batch}'[Run in batch mode, accepting no input]' \
46                 '--depth=[Maximum traversal depth]'
47         ;;
48         systemd-delta)
49             _arguments \
50                 {-h,--help}'[Show this help]' \
51                 '--version[Show package version]' \
52                 '--no-pager[Do not pipe output into a pager]' \
53                 '--diff=[Show a diff when overridden files differ]:boolean:(1 0)' \
54                 {-t,--type=}'[Only display a selected set of override types]:types:(masked equivalent redirected overridden unchanged)' \
55                 ':SUFFIX:(tmpfiles.d sysctl.d systemd/system)'
56         ;;
57         systemd-detect-virt)
58             _arguments \
59                 {-h,--help}'[Show this help]' \
60                 '--version[Show package version]' \
61                 {-c,--container}'[Only detect whether we are run in a container]' \
62                 {-v,--vm}'[Only detect whether we are run in a VM]' \
63                 {-q,--quiet}"[Don't output anything, just set return value]"
64         ;;
65         systemd-machine-id-setup)
66             _arguments \
67                 {-h,--help}'[Show this help]' \
68                 '--version[Show package version]'
69         ;;
70         systemd-notify)
71             _arguments \
72                 {-h,--help}'[Show this help]' \
73                 '--version[Show package version]' \
74                 '--ready[Inform the init system about service start-up completion.]' \
75                 '--pid=[Inform the init system about the main PID of the daemon]' \
76                 '--status=[Send a free-form status string for the daemon to the init systemd]' \
77                 '--booted[Returns 0 if the system was booted up with systemd]' \
78                 '--readahead=[Controls disk read-ahead operations]:arguments:(cancel done noreply)'
79         ;;
80         systemd-tmpfiles)
81             _arguments \
82                 '--create[Create, set ownership/permissions based on the config files.]' \
83                 '--clean[Clean up all files and directories with an age parameter configured.]' \
84                 '--remove[All files and directories marked with r, R in the configuration files are removed.]' \
85                 '--prefix=[Only apply rules that apply to paths with the specified prefix.]' \
86                 '--exclude-prefix=[Ignore rules that apply to paths with the specified prefix.]' \
87                 '--help[Prints a short help text and exits.]' \
88                 '*::files:_files'
89         ;;
90         systemd-tty-ask-password-agent)
91             _arguments \
92                 {-h,--help}'[Prints a short help text and exits.]' \
93                 '--version[Prints a short version string and exits.]' \
94                 '--list[Lists all currently pending system password requests.]' \
95                 '--query[Process all currently pending system password requests by querying the user on the calling TTY.]' \
96                 '--watch[Continuously process password requests.]' \
97                 '--wall[Forward password requests to wall(1).]' \
98                 '--plymouth[Ask question with plymouth(8).]' \
99                 '--console[Ask question on /dev/console.]'
100         ;;
101         *) _message 'eh?' ;;
102     esac
103 }
104
105 _hosts_or_user_at_host()
106 {
107   _alternative \
108     'users-hosts:: _user_at_host' \
109     'hosts:: _hosts'
110 }
111
112 _outputmodes() {
113     local -a _output_opts
114     _output_opts=(short short-monotonic verbose export json json-pretty json-see cat)
115     _describe -t output 'output mode' _output_opts || compadd "$@"
116 }
117
118 _ctls "$@"
119
120 #vim: set ft=zsh sw=4 ts=4 et