summaryrefslogtreecommitdiff
path: root/shell-completion/zsh/_journalctl
diff options
context:
space:
mode:
authorWilliam Giokas <1007380@gmail.com>2013-07-29 14:37:35 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-08-02 10:44:10 -0400
commit4a8fa990693edc47ac2192bf088a6e22e2390b41 (patch)
tree8a6df8b530bf42bd1fd884f86ac88dbcd99f8880 /shell-completion/zsh/_journalctl
parentc51fa9dd4e3dc5d8b1c38a43ef01e6ac19b99085 (diff)
downloadsystemd-4a8fa990693edc47ac2192bf088a6e22e2390b41.tar.gz
zsh_completion: Fix journalctl's --boot
Actually displays a list of boot ID's and offsets to the user
Diffstat (limited to 'shell-completion/zsh/_journalctl')
-rw-r--r--shell-completion/zsh/_journalctl11
1 files changed, 10 insertions, 1 deletions
diff --git a/shell-completion/zsh/_journalctl b/shell-completion/zsh/_journalctl
index 440e35d05b..4409fd7d68 100644
--- a/shell-completion/zsh/_journalctl
+++ b/shell-completion/zsh/_journalctl
@@ -39,6 +39,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 +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 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' \