From: Mike Yuan Date: Thu, 14 Mar 2024 12:15:10 +0000 (+0800) Subject: shell-completion: add systemd-cat --namespace= X-Git-Tag: v256-rc1~528 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cd804013a68f111a97fcdab70ad393f0e6427b7d;p=thirdparty%2Fsystemd.git shell-completion: add systemd-cat --namespace= Follow-up for 45bcab66a9c23a74107118d310e09a46f28494fd Addresses https://github.com/systemd/systemd/pull/31754#discussion_r1524715062 --- diff --git a/shell-completion/bash/systemd-cat b/shell-completion/bash/systemd-cat index 6ccc7bf000f..0d7e3d7a893 100644 --- a/shell-completion/bash/systemd-cat +++ b/shell-completion/bash/systemd-cat @@ -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 diff --git a/shell-completion/zsh/_systemd b/shell-completion/zsh/_systemd index 863631571ef..44476144c11 100644 --- a/shell-completion/zsh/_systemd +++ b/shell-completion/zsh/_systemd @@ -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)