# systemctl(1) completion -*- shell-script -*-
-# SPDX-License-Identifier: LGPL-2.1+
+# SPDX-License-Identifier: LGPL-2.1-or-later
#
# This file is part of systemd.
#
__systemctl() {
local mode=$1; shift 1
- systemctl $mode --full --no-legend --no-pager "$@" 2>/dev/null
+ systemctl $mode --full --no-legend --no-pager --plain "$@" 2>/dev/null
}
__systemd_properties() {
__get_machines() {
local a b
- { machinectl list-images --no-legend --no-pager; machinectl list --no-legend --no-pager; } | \
+ { machinectl list-images --full --no-legend --no-pager; machinectl list --full --no-legend --no-pager; } | \
{ while read a b; do echo " $a"; done; }
}
--quiet -q --system --user --version --runtime --recursive -r --firmware-setup
--show-types -i --ignore-inhibitors --plain --failed --value --fail --dry-run --wait'
[ARG]='--host -H --kill-who --property -p --signal -s --type -t --state --job-mode --root
- --preset-mode -n --lines -o --output -M --machine --message'
+ --preset-mode -n --lines -o --output -M --machine --message --timestamp'
)
if __contains_word "--user" ${COMP_WORDS[*]}; then
--machine|-M)
comps=$( __get_machines )
;;
+ --timestamp)
+ comps='pretty us µs utc us+utc µs+utc'
+ ;;
esac
COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
return 0
[FILE]='link switch-root'
[TARGETS]='set-default'
[MACHINES]='list-machines'
+ [LOG_LEVEL]='log-level'
+ [LOG_TARGET]='log-target'
+ [SERVICE_WATCHDOGS]='service-watchdogs'
)
for ((i=0; i < COMP_CWORD; i++)); do
elif __contains_word "$verb" ${VERBS[TARGETS]}; then
comps=$( __systemctl $mode list-unit-files --type target --full --all "$cur*" \
| { while read -r a b; do echo " $a"; done; } )
+ elif __contains_word "$verb" ${VERBS[LOG_LEVEL]}; then
+ comps='debug info notice warning err crit alert emerg'
+ elif __contains_word "$verb" ${VERBS[LOG_TARGET]}; then
+ comps='console journal kmsg journal-or-kmsg null'
+ elif __contains_word "$verb" ${VERBS[SERVICE_WATCHDOGS]}; then
+ comps='on off'
fi
COMPREPLY=( $(compgen -o filenames -W '$comps' -- "$cur_orig") )