'--no-legend[Do not print a legend, i.e. the column headers and the footer with hints]' \
'--no-pager[Do not pipe output into a pager]' \
'--no-ask-password[Do not ask for system passwords]' \
- '--order[When generating graph for dot, show only order]' \
- '--require[When generating graph for dot, show only requirement]' \
'--system[Connect to system manager]' \
'--user[Connect to user service manager]' \
'--global[Enable/disable unit files globally]' \
{-c,--cursor=}'[Start showing entries from specified cursor]:cursors:_journal_fields __CURSORS' \
{-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' \
'--verify[Verify journal file consistency]' \
'--list-catalog[List messages in catalog]' \
'--update-catalog[Update binary catalog database]' \
+ '*::default: _journal_none'
;;
localectl)
_arguments \
_arguments \
{-h,--help}'[Show help text.]' \
'--user[Shows performance data of user sessions instead of the system manager.]' \
+ '--order[When generating graph for dot, show only order]' \
+ '--require[When generating graph for dot, show only requirement]' \
'*::systemd-analyze commands:_systemd_analyze_command'
;;
systemd-ask-password)
'time:Print the time taken to start'
'blame:prints a list of all running units, ordered by the time they took to initialize'
'plot:prints an SVG graphic detailing which system services have been started at what time'
+ 'dot:Dump dependency graph for dot(1)'
)
if (( CURRENT == 1 )); then
"list-jobs:List jobs"
"cancel:Cancel all, one, or more jobs"
"dump:Dump server status"
- "dot:Dump dependency graph for dot(1)"
"snapshot:Create a snapshot"
"delete:Remove one or more snapshots"
"show-environment:Dump environment"
(( $+functions[_systemctl_link] )) || _systemctl_link() { _files }
# no systemctl completion for:
-# [STANDALONE]='daemon-reexec daemon-reload default dot dump
+# [STANDALONE]='daemon-reexec daemon-reload default dump
# emergency exit halt kexec list-jobs list-units
# list-unit-files poweroff reboot rescue show-environment'
# [NAME]='snapshot load'
_{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}
_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" )