summaryrefslogtreecommitdiffstats
path: root/shell-completion/zsh/_oomctl
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 20:49:52 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 20:49:52 +0000
commit55944e5e40b1be2afc4855d8d2baf4b73d1876b5 (patch)
tree33f869f55a1b149e9b7c2b7e201867ca5dd52992 /shell-completion/zsh/_oomctl
parentInitial commit. (diff)
downloadsystemd-55944e5e40b1be2afc4855d8d2baf4b73d1876b5.tar.xz
systemd-55944e5e40b1be2afc4855d8d2baf4b73d1876b5.zip
Adding upstream version 255.4.upstream/255.4
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'shell-completion/zsh/_oomctl')
-rw-r--r--shell-completion/zsh/_oomctl28
1 files changed, 28 insertions, 0 deletions
diff --git a/shell-completion/zsh/_oomctl b/shell-completion/zsh/_oomctl
new file mode 100644
index 0000000..18e1938
--- /dev/null
+++ b/shell-completion/zsh/_oomctl
@@ -0,0 +1,28 @@
+#compdef oomctl
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+(( $+functions[_oomctl_commands] )) || _oomctl_commands()
+{
+ local -a _oomctl_cmds
+ _oomctl_cmds=(
+ "dump:Show the current state of cgroups and system contexts"
+ "help:Prints a short help text and exits."
+ )
+ if (( CURRENT == 1 )); then
+ _describe -t commands 'oomctl command' _oomctl_cmds
+ else
+ local curcontext="$curcontext"
+ cmd="${${_oomctl_cmds[(r)$words[1]:*]%%:*}}"
+ if (( $+functions[_oomctl_$cmd] )); then
+ _oomctl_$cmd
+ else
+ _message "no more options"
+ fi
+ fi
+}
+
+_arguments \
+ {-h,--help}'[Prints a short help text and exits.]' \
+ '--version[Prints a short version string and exits.]' \
+ '--no-pager[Do not pipe output into a pager]' \
+ '*::oomctl command:_oomctl_commands'