diff options
author | William Giokas <1007380@gmail.com> | 2013-07-29 14:07:21 -0500 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-08-02 10:43:35 -0400 |
commit | 7e83c0e03fbf397167822e170d97c3a210658768 (patch) | |
tree | 91cc30c979bebe160b519ec4e0b4cfd837538a67 /shell-completion/zsh/_systemd | |
parent | db456cd0c65d0e7375b09b72ae6fb60f09e2eb6e (diff) |
zsh_completion: Split out zsh _journalctl
Re-ordered some of the options and added a few that were missing
previously as well.
Diffstat (limited to 'shell-completion/zsh/_systemd')
-rw-r--r-- | shell-completion/zsh/_systemd | 70 |
1 files changed, 1 insertions, 69 deletions
diff --git a/shell-completion/zsh/_systemd b/shell-completion/zsh/_systemd index ce7ea1ad4d..488d460142 100644 --- a/shell-completion/zsh/_systemd +++ b/shell-completion/zsh/_systemd @@ -1,44 +1,9 @@ -#compdef journalctl localectl timedatectl systemd-coredumpctl udevadm systemd-analyze systemd-cat systemd-ask-password systemd-cgls systemd-cgtop systemd-delta systemd-detect-virt systemd-inhibit systemd-machine-id-setup systemd-notify systemd-nspawn systemd-tmpfiles systemd-tty-ask-password-agent machinectl +#compdef localectl timedatectl systemd-coredumpctl udevadm systemd-analyze systemd-cat systemd-ask-password systemd-cgls systemd-cgtop systemd-delta systemd-detect-virt systemd-inhibit systemd-machine-id-setup systemd-notify systemd-nspawn systemd-tmpfiles systemd-tty-ask-password-agent machinectl _ctls() { local curcontext="$curcontext" state lstate line case "$service" in - journalctl) - _arguments -s \ - '--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 specified cursor]:cursors:_journal_fields __CURSORS' \ - '--system[Show system and kernel messages]' \ - '--user[Show messages from user services]' \ - {-b,--this-boot}'[Show data only from current boot]' \ - {-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' \ - {-p,--priority=}'[Show only messages within the specified priority range]:priority:_journal_fields PRIORITY' \ - {-f,--follow}'[Follow journal]' \ - {-n,--lines=}'[Number of journal entries to show]:integer' \ - '--no-tail[Show all lines, even in follow mode]' \ - {-o,--output=}'[Change journal output mode]:output modes:_outputmodes' \ - {-l,--full}'[Show long fields in full]' \ - {-a,--all}'[Show all fields, including long and unprintable]' \ - {-q,--quiet}"[Don't show privilege warning]" \ - '--no-pager[Do not pipe output into a pager]' \ - {-m,--merge}'[Show entries from all available journals]' \ - {-D,--directory=}'[Show journal files from directory]:directories:_directories' \ - '--interval=[Time interval for changing the FSS sealing key]:time interval' \ - '--verify-key=[Specify FSS verification key]:FSS key' \ - {-h,--help}'[Show this help]' \ - '--version[Show package version]' \ - '--new-id128[Generate a new 128 Bit ID]' \ - '--header[Show journal header information]' \ - '--disk-usage[Show total disk usage]' \ - {-F,--field=}'[List all values a certain field takes]:Fields:_list_fields' \ - '--setup-keys[Generate new FSS key pair]' \ - '--verify[Verify journal file consistency]' \ - '--list-catalog[List messages in catalog]' \ - '--update-catalog[Update binary catalog database]' \ - '*::default: _journal_none' - ;; localectl) _arguments \ {-h,--help}'[Show this help]' \ @@ -279,39 +244,6 @@ _outputmodes() { _describe -t output 'output mode' _output_opts || compadd "$@" } -_list_fields() { - local -a journal_fields - journal_fields=(MESSAGE{,_ID} PRIORITY CODE_{FILE,LINE,FUNC} - ERRNO SYSLOG_{FACILITY,IDENTIFIER,PID} - _{P,U,G}ID _COMM _EXE _CMDLINE - _AUDIT_{SESSION,LOGINUID} - _SYSTEMD_{CGROUP,SESSION,UNIT,OWNER_UID} - _SYSTEMD_USER_UNIT - _SELINUX_CONTEXT _SOURCE_REALTIME_TIMESTAMP - _{BOOT,MACHINE}_ID _HOSTNAME _TRANSPORT - _KERNEL_{DEVICE,SUBSYSTEM} - _UDEV_{SYSNAME,DEVNODE,DEVLINK} - __CURSOR __{REALTIME,MONOTONIC}_TIMESTAMP) - _describe 'possible fields' journal_fields -} - -_journal_none() { - local -a _commands _files - _commands=( ${(f)"$(_call_program commands "$service" -F _EXE 2>/dev/null)"} ) - _alternative : \ - 'files:/dev files:_files -W /dev -P /dev/' \ - "commands:commands:($_commands[@])" \ - 'fields:fields:_list_fields' -} - -_journal_fields() { - local -a _fields cmd - cmd=("journalctl" "-F ${@[-1]}" "2>/dev/null" ) - _fields=( ${(f)"$(_call_program fields $cmd[@])"} ) - typeset -U _fields - _describe 'possible values' _fields -} - _localectl_set-locale() { local -a _confs _locales local expl suf |