mirror of
https://github.com/systemd/systemd
synced 2024-10-07 08:40:44 +00: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'
|
--list-namespaces'
|
||||||
[ARG]='-b --boot -D --directory --file -F --field -t --identifier
|
[ARG]='-b --boot -D --directory --file -F --field -t --identifier
|
||||||
-T --exclude-identifier --facility -M --machine -o --output
|
-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
|
[ARGUNKNOWN]='-c --cursor --interval -n --lines -S --since -U --until
|
||||||
--after-cursor --cursor-file --verify-key -g --grep
|
--after-cursor --cursor-file --verify-key -g --grep
|
||||||
--vacuum-size --vacuum-time --vacuum-files --output-fields'
|
--vacuum-size --vacuum-time --vacuum-files --output-fields'
|
||||||
|
@ -114,6 +115,9 @@ _journalctl() {
|
||||||
--case-sensitive)
|
--case-sensitive)
|
||||||
comps='yes no'
|
comps='yes no'
|
||||||
;;
|
;;
|
||||||
|
--namespace)
|
||||||
|
comps=$(journalctl --list-namespaces --output=cat 2>/dev/null)
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
return 0
|
return 0
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -63,6 +63,13 @@ _journalctl_facilities() {
|
||||||
_describe 'possible values' _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.
|
# Build arguments for "journalctl" to be used in completion.
|
||||||
# Use both --user and --system modes, they are not exclusive.
|
# Use both --user and --system modes, they are not exclusive.
|
||||||
local -a _modes; _modes=(--user --system)
|
local -a _modes; _modes=(--user --system)
|
||||||
|
@ -132,6 +139,7 @@ _arguments -s \
|
||||||
'--interval=[Time interval for changing the FSS sealing key]:time interval' \
|
'--interval=[Time interval for changing the FSS sealing key]:time interval' \
|
||||||
'--list-catalog[List messages in catalog]' \
|
'--list-catalog[List messages in catalog]' \
|
||||||
'--list-namespaces[List available journal namespaces]' \
|
'--list-namespaces[List available journal namespaces]' \
|
||||||
|
'--namespace[Show journal data from specified namespace]:namespace:_journalctl_namespaces' \
|
||||||
'--new-id128[Generate a new 128 Bit ID]' \
|
'--new-id128[Generate a new 128 Bit ID]' \
|
||||||
'--rotate[Request immediate rotation of the journal files]' \
|
'--rotate[Request immediate rotation of the journal files]' \
|
||||||
'--setup-keys[Generate a new FSS key pair]' \
|
'--setup-keys[Generate a new FSS key pair]' \
|
||||||
|
|
Loading…
Reference in a new issue