summaryrefslogtreecommitdiff
path: root/shell-completion
diff options
context:
space:
mode:
authorEric Cook <llua@gmx.com>2014-09-27 08:48:09 -0400
committerDaniel Mack <daniel@zonque.org>2014-09-27 19:57:04 +0200
commitc2026f28bdc64c608e9b00e8f7916c82f44ec610 (patch)
tree2d383991394c807d7cbcca11a53c259f9a14c352 /shell-completion
parentb748c7596f79945be5263a0d1c88de64eb0c5146 (diff)
downloadsystemd-c2026f28bdc64c608e9b00e8f7916c82f44ec610.tar.gz
shell-completion(zsh): journalctl's -b changes
removed pointless index sort of bootids. use `compadd -a' to add each array, instead of expanding possibly hundreds of words needlessly. optional completion of -b
Diffstat (limited to 'shell-completion')
-rw-r--r--shell-completion/zsh/_journalctl8
1 files changed, 4 insertions, 4 deletions
diff --git a/shell-completion/zsh/_journalctl b/shell-completion/zsh/_journalctl
index 0d16a26a6f..a469bbc9a7 100644
--- a/shell-completion/zsh/_journalctl
+++ b/shell-completion/zsh/_journalctl
@@ -41,11 +41,11 @@ _journal_fields() {
_journal_boots() {
local -a _bootid _previousboots
- _bootid=( ${(fao)"$(_call_program bootid "$service -F _BOOT_ID")"} )
+ _bootid=( ${(f)"$(_call_program bootid "$service -F _BOOT_ID")"} )
_previousboots=( -{1..${#_bootid}} )
_alternative : \
- "offsets:boot offsets:(${_previousboots[1,-2]})" \
- "bootid:boot ids:(${_bootid[@]})"
+ "offsets:boot offsets:compadd -a '_previousboots[1,-2]'" \
+ "bootid:boot ids:compadd -a _bootid"
}
_arguments -s \
@@ -63,7 +63,7 @@ _arguments -s \
{-x,--catalog}'[Show explanatory texts with each log line]' \
{-q,--quiet}"[Don't show privilege warning]" \
{-m,--merge}'[Show entries from all available journals]' \
- {-b+,--boot=}'[Show data only from the specified boot or offset]:boot id or offset:_journal_boots' \
+ {-b+,--boot=}'[Show data only from the specified boot or offset]::boot id or offset:_journal_boots' \
'--list-boots[List boots ordered by time]' \
{-k,--dmesg}'[Show only kernel messages from the current boot]' \
{-u+,--unit=}'[Show data only from the specified unit]:units:_journal_fields _SYSTEMD_UNIT' \