]>
Commit | Line | Data |
---|---|---|
de0988f9 NK |
1 | #compdef oomctl |
2 | # SPDX-License-Identifier: LGPL-2.1-or-later | |
3 | ||
4 | (( $+functions[_oomctl_commands] )) || _oomctl_commands() | |
5 | { | |
6 | local -a _oomctl_cmds | |
7 | _oomctl_cmds=( | |
0923b425 | 8 | "dump:Show the current state of cgroups and system contexts" |
de0988f9 NK |
9 | "help:Prints a short help text and exits." |
10 | ) | |
11 | if (( CURRENT == 1 )); then | |
12 | _describe -t commands 'oomctl command' _oomctl_cmds | |
13 | else | |
14 | local curcontext="$curcontext" | |
15 | cmd="${${_oomctl_cmds[(r)$words[1]:*]%%:*}}" | |
16 | if (( $+functions[_oomctl_$cmd] )); then | |
17 | _oomctl_$cmd | |
18 | else | |
19 | _message "no more options" | |
20 | fi | |
21 | fi | |
22 | } | |
23 | ||
24 | _arguments \ | |
20927c0e EK |
25 | '(- *)'{-h,--help}'[Prints a short help text and exits.]' \ |
26 | '(- *)--version[Prints a short version string and exits.]' \ | |
de0988f9 NK |
27 | '--no-pager[Do not pipe output into a pager]' \ |
28 | '*::oomctl command:_oomctl_commands' |