mirror of
https://github.com/clearlinux/systemd-stable.git
synced 2026-09-06 13:41:31 +00:00
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
(cherry picked from commit c2026f28bd)
This commit is contained in:
committed by
Zbigniew Jędrzejewski-Szmek
parent
b66559b11f
commit
b97a348e31
@@ -47,11 +47,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 \
|
||||
@@ -69,7 +69,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' \
|
||||
|
||||
Reference in New Issue
Block a user