mirror of
https://github.com/systemd/systemd.git
synced 2025-03-09 12:58:26 +03:00
shell-completion: provide completion for journalctl --namespace=
Resolves: #30381
This commit is contained in:
parent
2fe03e25fb
commit
178c8c24ec
@ -49,7 +49,8 @@ _journalctl() {
|
||||
--list-namespaces'
|
||||
[ARG]='-b --boot -D --directory --file -F --field -t --identifier
|
||||
-T --exclude-identifier --facility -M --machine -o --output
|
||||
-u --unit --user-unit -p --priority --root --case-sensitive'
|
||||
-u --unit --user-unit -p --priority --root --case-sensitive
|
||||
--namespace'
|
||||
[ARGUNKNOWN]='-c --cursor --interval -n --lines -S --since -U --until
|
||||
--after-cursor --cursor-file --verify-key -g --grep
|
||||
--vacuum-size --vacuum-time --vacuum-files --output-fields'
|
||||
@ -114,6 +115,9 @@ _journalctl() {
|
||||
--case-sensitive)
|
||||
comps='yes no'
|
||||
;;
|
||||
--namespace)
|
||||
comps=$(journalctl --list-namespaces --output=cat 2>/dev/null)
|
||||
;;
|
||||
*)
|
||||
return 0
|
||||
;;
|
||||
|
@ -63,6 +63,13 @@ _journalctl_facilities() {
|
||||
_describe 'possible values' _journalctl_facilities
|
||||
}
|
||||
|
||||
(( $+functions[_journalctl_namespaces] )) ||
|
||||
_journalctl_namespaces() {
|
||||
local -a _journalctl_namespaces
|
||||
_journalctl_namespaces=( ${(f)"$(_call_program namespaces "$service --list-namespaces --output=cat" 2>/dev/null)"} )
|
||||
_describe 'possible values' _journalctl_namespaces
|
||||
}
|
||||
|
||||
# Build arguments for "journalctl" to be used in completion.
|
||||
# Use both --user and --system modes, they are not exclusive.
|
||||
local -a _modes; _modes=(--user --system)
|
||||
@ -132,6 +139,7 @@ _arguments -s \
|
||||
'--interval=[Time interval for changing the FSS sealing key]:time interval' \
|
||||
'--list-catalog[List messages in catalog]' \
|
||||
'--list-namespaces[List available journal namespaces]' \
|
||||
'--namespace[Show journal data from specified namespace]:namespace:_journalctl_namespaces' \
|
||||
'--new-id128[Generate a new 128 Bit ID]' \
|
||||
'--rotate[Request immediate rotation of the journal files]' \
|
||||
'--setup-keys[Generate a new FSS key pair]' \
|
||||
|
Loading…
x
Reference in New Issue
Block a user