mirror of
https://github.com/systemd/systemd.git
synced 2024-10-28 11:55:44 +03:00
zsh_completion: Correctly display journal fields
Show equals and field values when used with _journal_none, don't show anything if we're not using _journal_none.
This commit is contained in:
parent
087a30417d
commit
ca08063781
@ -19,13 +19,18 @@ _list_fields() {
|
|||||||
_KERNEL_{DEVICE,SUBSYSTEM}
|
_KERNEL_{DEVICE,SUBSYSTEM}
|
||||||
_UDEV_{SYSNAME,DEVNODE,DEVLINK}
|
_UDEV_{SYSNAME,DEVNODE,DEVLINK}
|
||||||
__CURSOR __{REALTIME,MONOTONIC}_TIMESTAMP)
|
__CURSOR __{REALTIME,MONOTONIC}_TIMESTAMP)
|
||||||
_describe 'possible fields' journal_fields
|
case $_jrnl_none in
|
||||||
|
yes) _values -s '=' 'possible fields' \
|
||||||
|
"${journal_fields[@]}:value:_journal_fields ${words[CURRENT]%%=*}" ;;
|
||||||
|
*) _describe 'possible fields' journal_fields ;;
|
||||||
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
_journal_none() {
|
_journal_none() {
|
||||||
local -a _commands _files
|
local -a _commands _files _jrnl_none
|
||||||
# Setting use-cache will slow this down considerably
|
# Setting use-cache will slow this down considerably
|
||||||
_commands=( ${"$(_call_program commands "$service" -F _EXE 2>/dev/null)"} )
|
_commands=( ${"$(_call_program commands "$service" -F _EXE 2>/dev/null)"} )
|
||||||
|
_jrnl_none='yes'
|
||||||
_alternative : \
|
_alternative : \
|
||||||
'files:/dev files:_files -W /dev -P /dev/' \
|
'files:/dev files:_files -W /dev -P /dev/' \
|
||||||
"commands:commands:($_commands[@])" \
|
"commands:commands:($_commands[@])" \
|
||||||
|
Loading…
Reference in New Issue
Block a user