1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-24 21:34:08 +03:00
systemd-stable/shell-completion/zsh/_oomctl
Nishal Kulkarni de0988f9d2 shell-completion: Add completion for oomctl
Added bash and zsh completions for oomctl arguments and commands.

Related To: #22118
2022-03-18 13:41:19 +00:00

29 lines
864 B
Plaintext

#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 the cgroup(s) and system context(s)"
"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'