X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=shell-completion%2Fzsh%2F_journalctl;h=61983d5b6d2b374be89bbb1621be0ddb861b7e2e;hb=4af6e458e5a683b89032d560eb353c2272d3d564;hp=440e35d05bc72735aa682dd34a2c4de73ca96269;hpb=7e83c0e03fbf397167822e170d97c3a210658768;p=elogind.git diff --git a/shell-completion/zsh/_journalctl b/shell-completion/zsh/_journalctl index 440e35d05..61983d5b6 100644 --- a/shell-completion/zsh/_journalctl +++ b/shell-completion/zsh/_journalctl @@ -24,7 +24,8 @@ _list_fields() { _journal_none() { local -a _commands _files - _commands=( ${(f)"$(_call_program commands "$service" -F _EXE 2>/dev/null)"} ) + # Setting use-cache will slow this down considerably + _commands=( ${"$(_call_program commands "$service" -F _EXE 2>/dev/null)"} ) _alternative : \ 'files:/dev files:_files -W /dev -P /dev/' \ "commands:commands:($_commands[@])" \ @@ -39,6 +40,15 @@ _journal_fields() { _describe 'possible values' _fields } +_journal_boots() { + local -a _bootid _previousboots + _bootid=( ${(fao)"$(_call_program bootid "$service -F _BOOT_ID")"} ) + _previousboots=( -{1..${#_bootid}} ) + _alternative : \ + "offsets:boot offsets:(${_previousboots[1,-2]})" \ + "bootid:boot ids:(${_bootid[@]})" +} + _arguments -s \ {-h,--help}'[Show this help]' \ '--version[Show package version]' \ @@ -54,7 +64,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 entries from the specified boot only]' \ + {-b,--boot=}'[Show data only from the specified boot or offset]:boot id or offset:_journal_boots' \ {-k,--dmesg}'[Show only kernel messages, Implies -b]' \ {-u,--unit=}'[Show data only from the specified unit]:units:_journal_fields _SYSTEMD_UNIT' \ '--user-unit[Show data only from the specified user session unit]:units:_journal_fields _SYSTEMD_USER_UNIT' \