]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - shell-completion/bash/systemctl.in
Merge pull request #17549 from yuwata/tiny-fixes
[thirdparty/systemd.git] / shell-completion / bash / systemctl.in
index 1bda6f2b7c1739047346804459a09e572cba6c67..f6be3827cff6b142c47881599cf6aa039488f235 100644 (file)
@@ -1,5 +1,5 @@
 # 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.
 #
@@ -7,7 +7,7 @@
 
 __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() {
@@ -113,7 +113,7 @@ __get_all_unit_files () { { __systemctl $1 list-unit-files "$2*"; } | { while re
 
 __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; }
 }
 
@@ -127,7 +127,7 @@ _systemctl () {
                              --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
@@ -176,6 +176,9 @@ _systemctl () {
             --machine|-M)
                 comps=$( __get_machines )
                 ;;
+            --timestamp)
+                comps='pretty us µs utc us+utc µs+utc'
+                ;;
         esac
         COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
         return 0
@@ -211,6 +214,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 +332,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") )