shell-completion: add systemd-analyze set-log-target

The `systemd-analyze set-log-target` command was added in v227 (commit
2ca2a91cf1), but was missing from the shell completion specifications.
This commit is contained in:
Lucas Werkmeister 2017-09-07 23:23:33 +02:00
parent 9ecf63a457
commit 4146ac2a4c
2 changed files with 15 additions and 0 deletions

View File

@ -44,6 +44,7 @@ _systemd_analyze() {
[CRITICAL_CHAIN]='critical-chain'
[DOT]='dot'
[LOG_LEVEL]='set-log-level'
[LOG_TARGET]='set-log-target'
[VERIFY]='verify'
[SECCOMP_FILTER]='syscall-filter'
)
@ -101,6 +102,13 @@ _systemd_analyze() {
comps='debug info notice warning err crit alert emerg'
fi
elif __contains_word "$verb" ${VERBS[LOG_TARGET]}; then
if [[ $cur = -* ]]; then
comps='--help --version --system --user'
else
comps='console journal kmsg journal-or-kmsg null'
fi
elif __contains_word "$verb" ${VERBS[SECCOMP_FILTER]}; then
if [[ $cur = -* ]]; then
comps='--help --version'

View File

@ -6,6 +6,12 @@ _systemd_analyze_set-log-level() {
_describe -t level 'logging level' _levels || compadd "$@"
}
_systemd_analyze_set-log-target() {
local -a _targets
_targets=(console journal kmsg journal-or-kmsg null)
_describe -t target 'logging target' _targets || compadd "$@"
}
_systemd_analyze_verify() {
_sd_unit_files
}
@ -21,6 +27,7 @@ _systemd_analyze_command(){
'dot:Dump dependency graph (in dot(1) format)'
'dump:Dump server status'
'set-log-level:Set systemd log threshold'
'set-log-target:Set systemd log target'
'syscall-filter:List syscalls in seccomp filter'
'verify:Check unit files for correctness'
)