mirror of
https://github.com/systemd/systemd.git
synced 2024-11-24 18:53:33 +08:00
zsh-completion: Escape results for journalctl --unit
Escape colons and backslashes in unit names. This gives correct completions for units with names like systemd-backlight@backlight:acpi_video0.service and systemd-fsck@dev-disk-by\x2duuid-...
This commit is contained in:
parent
f49ce89edf
commit
655fd9d71f
@ -34,7 +34,10 @@ _journal_none() {
|
||||
_journal_fields() {
|
||||
local -a _fields cmd
|
||||
cmd=("journalctl" "-F ${@[-1]}" "2>/dev/null" )
|
||||
_fields=( ${(f)"$(_call_program fields $cmd[@])"} )
|
||||
_fields=$(_call_program fields $cmd[@])
|
||||
_fields=${_fields//'\'/'\\'}
|
||||
_fields=${_fields//':'/'\:'}
|
||||
_fields=( ${(f)_fields} )
|
||||
typeset -U _fields
|
||||
_describe 'possible values' _fields
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user