chiark / gitweb /
journalctl,zsh-completion: fix several issues in --help message text
[elogind.git] / shell-completion / zsh / _journalctl
index 7c5cc13bf0c8692a4e5b37dcdaf2b408935d24af..0d16a26a6f47a0e2aca7a66e0feb2f735a06872d 100644 (file)
@@ -1,11 +1,5 @@
 #compdef journalctl
 
 #compdef journalctl
 
-_outputmodes() {
-    local -a _output_opts
-    _output_opts=(short short-monotonic verbose export json json-pretty json-see cat)
-    _describe -t output 'output mode' _output_opts || compadd "$@"
-}
-
 _list_fields() {
     local -a journal_fields
     journal_fields=(MESSAGE{,_ID} PRIORITY CODE_{FILE,LINE,FUNC}
 _list_fields() {
     local -a journal_fields
     journal_fields=(MESSAGE{,_ID} PRIORITY CODE_{FILE,LINE,FUNC}
@@ -13,7 +7,7 @@ _list_fields() {
                     _{P,U,G}ID _COMM _EXE _CMDLINE
                     _AUDIT_{SESSION,LOGINUID}
                     _SYSTEMD_{CGROUP,SESSION,UNIT,OWNER_UID}
                     _{P,U,G}ID _COMM _EXE _CMDLINE
                     _AUDIT_{SESSION,LOGINUID}
                     _SYSTEMD_{CGROUP,SESSION,UNIT,OWNER_UID}
-                    _SYSTEMD_USER_UNIT
+                    _SYSTEMD_USER_UNIT USER_UNIT
                     _SELINUX_CONTEXT _SOURCE_REALTIME_TIMESTAMP
                     _{BOOT,MACHINE}_ID _HOSTNAME _TRANSPORT
                     _KERNEL_{DEVICE,SUBSYSTEM}
                     _SELINUX_CONTEXT _SOURCE_REALTIME_TIMESTAMP
                     _{BOOT,MACHINE}_ID _HOSTNAME _TRANSPORT
                     _KERNEL_{DEVICE,SUBSYSTEM}
@@ -65,19 +59,20 @@ _arguments -s \
     {-n+,--lines=}'[Number of journal entries to show]:integer' \
     '--no-tail[Show all lines, even in follow mode]' \
     {-r,--reverse}'[Reverse output]' \
     {-n+,--lines=}'[Number of journal entries to show]:integer' \
     '--no-tail[Show all lines, even in follow mode]' \
     {-r,--reverse}'[Reverse output]' \
-    {-o+,--output=}'[Change journal output mode]:output modes:_outputmodes' \
+    {-o+,--output=}'[Change journal output mode]:output modes:_sd_outputmodes' \
     {-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' \
     {-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' \
-    {-k,--dmesg}'[Show only kernel messages, Implies -b]' \
+    '--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' \
     {-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' \
+    '--user-unit=[Show data only from the specified user session unit]:units:_journal_fields USER_UNIT' \
     {-p+,--priority=}'[Show only messages within the specified priority range]:priority:_journal_fields PRIORITY' \
     {-p+,--priority=}'[Show only messages within the specified priority range]:priority:_journal_fields PRIORITY' \
-    {-c+,--cursor=}'[Start showing entries from specified cursor]:cursors:_journal_fields __CURSORS' \
-    '--after-cursor=[Start showing entries from the location in the journal after the cursor]:cursors:_journal_fields __CURSORS' \
-    '--since=[Start showing entries newer or of the specified date]:YYYY-MM-DD HH\:MM\:SS' \
-    '--until=[Stop showing entries older or of the specified date]:YYYY-MM-DD HH\:MM\:SS' \
+    {-c+,--cursor=}'[Start showing entries from the specified cursor]:cursors:_journal_fields __CURSORS' \
+    '--after-cursor=[Start showing entries from after the specified cursor]:cursors:_journal_fields __CURSORS' \
+    '--since=[Start showing entries on or newer than the specified date]:YYYY-MM-DD HH\:MM\:SS' \
+    '--until=[Stop showing entries on or older than the specified date]:YYYY-MM-DD HH\:MM\:SS' \
     {-F,--field=}'[List all values a certain field takes]:Fields:_list_fields' \
     '--system[Show system and kernel messages]' \
     '--user[Show messages from user services]' \
     {-F,--field=}'[List all values a certain field takes]:Fields:_list_fields' \
     '--system[Show system and kernel messages]' \
     '--user[Show messages from user services]' \
@@ -90,8 +85,8 @@ _arguments -s \
     '--list-catalog[List messages in catalog]' \
     '--dump-catalog[Dump messages in catalog]' \
     '--update-catalog[Update binary catalog database]' \
     '--list-catalog[List messages in catalog]' \
     '--dump-catalog[Dump messages in catalog]' \
     '--update-catalog[Update binary catalog database]' \
-    '--setup-keys[Generate new FSS key pair]' \
-    '--force[Force recreation of FSS keys]' \
+    '--setup-keys[Generate new FSS key pair]' \
+    '--force[Force recreation of the FSS keys]' \
     '--interval=[Time interval for changing the FSS sealing key]:time interval' \
     '--verify[Verify journal file consistency]' \
     '--verify-key=[Specify FSS verification key]:FSS key' \
     '--interval=[Time interval for changing the FSS sealing key]:time interval' \
     '--verify[Verify journal file consistency]' \
     '--verify-key=[Specify FSS verification key]:FSS key' \