shell-completion: add systemd-cat --namespace=
authorMike Yuan <me@yhndnzj.com>
Thu, 14 Mar 2024 12:15:10 +0000 (20:15 +0800)
committerLuca Boccassi <luca.boccassi@gmail.com>
Thu, 14 Mar 2024 13:07:19 +0000 (13:07 +0000)
Follow-up for 45bcab66a9c23a74107118d310e09a46f28494fd

Addresses https://github.com/systemd/systemd/pull/31754#discussion_r1524715062

shell-completion/bash/systemd-cat
shell-completion/zsh/_systemd

index 6ccc7bf000f19c45617861a9bb8b3f19535cd844..0d7e3d7a893c53cc66786dd19eedcd7281ef7fc8 100644 (file)
@@ -31,7 +31,7 @@ _systemd_cat() {
 
     local -A OPTS=(
         [STANDALONE]='-h --help --version'
-        [ARG]='-t --identifier -p --priority --stderr-priority --level-prefix'
+        [ARG]='-t --identifier -p --priority --stderr-priority --level-prefix --namespace'
     )
 
     _init_completion || return
@@ -47,6 +47,9 @@ _systemd_cat() {
             --level-prefix)
                 comps='yes no'
                 ;;
+            --namespace)
+                comps=$(journalctl --list-namespaces --output=cat 2>/dev/null)
+                ;;
         esac
         COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
         return 0
index 863631571efe168e775bdc2d064a66c5c2fd23c3..44476144c118493c677b96d7f98307324b5332ff 100644 (file)
@@ -19,6 +19,7 @@ case "$service" in
             {-t+,--identifier=}'[Set syslog identifier.]:syslog identifier:' \
             {-p+,--priority=}'[Set priority value.]:value:({0..7})' \
             '--level-prefix=[Control whether level prefix shall be parsed.]:boolean:(1 0)' \
+            '--namespace=[Connect to specified journal namespace.]:journal namespace:' \
             ':Message'
         ;;
     systemd-cgls)