diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2019-12-20 11:29:11 +0900 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-12-21 19:23:02 +0100 |
commit | 4171837be6b8c92886727a04616c4d2b6d123e22 (patch) | |
tree | d851bd2c9861a1e6df70f89991344e0d092006d5 /shell-completion | |
parent | 1234d0f63eb7d6119e774958e898e2fb7b1912bd (diff) | |
download | systemd-4171837be6b8c92886727a04616c4d2b6d123e22.tar.gz |
bash-completion: move shell-completion for log-level or friends to systemctl
Diffstat (limited to 'shell-completion')
-rw-r--r-- | shell-completion/bash/systemctl.in | 9 | ||||
-rw-r--r-- | shell-completion/bash/systemd-analyze | 24 |
2 files changed, 9 insertions, 24 deletions
diff --git a/shell-completion/bash/systemctl.in b/shell-completion/bash/systemctl.in index 1bda6f2b7c..7d2f0f88a2 100644 --- a/shell-completion/bash/systemctl.in +++ b/shell-completion/bash/systemctl.in @@ -211,6 +211,9 @@ _systemctl () { [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 @@ -326,6 +329,12 @@ _systemctl () { 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") ) diff --git a/shell-completion/bash/systemd-analyze b/shell-completion/bash/systemd-analyze index 88688f7272..986dad5d58 100644 --- a/shell-completion/bash/systemd-analyze +++ b/shell-completion/bash/systemd-analyze @@ -58,11 +58,8 @@ _systemd_analyze() { [STANDALONE]='time blame plot dump unit-paths exit-status condition calendar timestamp timespan' [CRITICAL_CHAIN]='critical-chain' [DOT]='dot' - [LOG_LEVEL]='log-level' - [LOG_TARGET]='log-target' [VERIFY]='verify' [SECCOMP_FILTER]='syscall-filter' - [SERVICE_WATCHDOGS]='service-watchdogs' [CAT_CONFIG]='cat-config' [SECURITY]='security' ) @@ -119,20 +116,6 @@ _systemd_analyze() { comps='--help --version --system --user --global --from-pattern --to-pattern --order --require' fi - elif __contains_word "$verb" ${VERBS[LOG_LEVEL]}; then - if [[ $cur = -* ]]; then - comps='--help --version --system --user' - else - 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 --no-pager' @@ -148,13 +131,6 @@ _systemd_analyze() { compopt -o filenames fi - elif __contains_word "$verb" ${VERBS[SERVICE_WATCHDOGS]}; then - if [[ $cur = -* ]]; then - comps='--help --version --system --user' - else - comps='on off' - fi - elif __contains_word "$verb" ${VERBS[CAT_CONFIG]}; then if [[ $cur = -* ]]; then comps='--help --version --root --no-pager' |