#compdef bootctl
# SPDX-License-Identifier: LGPL-2.1+
-(( $+functions[_bootctl_command] )) || _bootctl_command()
+(( $+functions[_bootctl_commands] )) || _bootctl_commands()
{
local -a _bootctl_cmds
_bootctl_cmds=(
'--version[Prints a short version string and exits.]' \
'--path=[Path to the EFI System Partition (ESP)]:path:_directories' \
'--no-variables[Do not touch EFI variables]' \
- '*::bootctl command:_bootctl_command'
+ '*::bootctl command:_bootctl_commands'
# You should have received a copy of the GNU Lesser General Public License
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
-(( $+functions[_busctl_command] )) || _busctl_command()
+(( $+functions[_busctl_commands] )) || _busctl_commands()
{
local -a _busctl_cmds
_busctl_cmds=(
'--allow-interactive-authorization=[Allow interactive authorization for operation]:boolean:(1 0)' \
'--timeout=[Maximum time to wait for method call completion]:timeout (seconds)' \
'--augment-creds=[Extend credential data with data read from /proc/$PID]:boolean:(1 0)' \
- '*::busctl command:_busctl_command'
+ '*::busctl command:_busctl_commands'
#compdef coredumpctl
# SPDX-License-Identifier: LGPL-2.1+
-_coredumpctl_command(){
+(( $+functions[_coredumpctl_commands] )) ||
+_coredumpctl_commands(){
local -a _coredumpctl_cmds
_coredumpctl_cmds=(
'list:List available coredumps'
'--debugger=[Use the given debugger]:debugger: _command_names -e' \
{-D,--directory=}'[Use the journal files in the specified dir]:directory: _directories' \
{-q,--quiet}'[Do not show info messages and privilege warning]' \
- '*::coredumpctl commands:_coredumpctl_command'
+ '*::coredumpctl commands:_coredumpctl_commands'
#compdef hostnamectl
# SPDX-License-Identifier: LGPL-2.1+
+(( $+functions[_hostnamectl_set-hostname] )) ||
_hostnamectl_set-hostname() {
if (( CURRENT <= 3 )); then
_message "new hostname"
fi
}
+(( $+functions[_hostnamectl_set-icon-name] )) ||
_hostnamectl_set-icon-name() {
if (( CURRENT <= 3 )); then
_message "new icon name"
fi
}
+(( $+functions[_hostnamectl_set-chassis] )) ||
_hostnamectl_set-chassis() {
if (( CURRENT <= 3 )); then
_chassis=( desktop laptop convertible server tablet handset watch embedded vm container )
fi
}
+(( $+functions[_hostnamectl_set-deployment] )) ||
_hostnamectl_set-deployment() {
if (( CURRENT <= 3 )); then
_message "new environment"
fi
}
+(( $+functions[_hostnamectl_set-location] )) ||
_hostnamectl_set-location() {
if (( CURRENT <= 3 )); then
_message "new location"
fi
}
-_hostnamectl_command() {
+(( $+functions[_hostnamectl_commands] )) ||
+_hostnamectl_commands() {
local -a _hostnamectl_cmds
_hostnamectl_cmds=(
"status:Show current hostname settings"
'--no-ask-password[Do not prompt for password]' \
{-H+,--host=}'[Operate on remote host]:userathost:_sd_hosts_or_user_at_host' \
{-M+,--machine=}'[Operate on local container]:machines:_sd_machines' \
- '*::hostnamectl commands:_hostnamectl_command'
+ '*::hostnamectl commands:_hostnamectl_commands'
#compdef journalctl
# SPDX-License-Identifier: LGPL-2.1+
-_list_fields() {
+(( $+functions[_journalctl_fields] )) ||
+_journalctl_fields() {
local -a journal_fields
journal_fields=(MESSAGE{,_ID} PRIORITY CODE_{FILE,LINE,FUNC}
ERRNO SYSLOG_{FACILITY,IDENTIFIER,PID}
__CURSOR __{REALTIME,MONOTONIC}_TIMESTAMP)
case $_jrnl_none in
yes) _values -s '=' 'possible fields' \
- "${journal_fields[@]}:value:_journal_fields ${words[CURRENT]%%=*}" ;;
+ "${journal_fields[@]}:value:_journalctl_field_values ${words[CURRENT]%%=*}" ;;
*) _describe 'possible fields' journal_fields ;;
esac
}
-_journal_none() {
+(( $+functions[_journalctl_none] )) ||
+_journalctl_none() {
local -a _commands _files _jrnl_none
# Setting use-cache will slow this down considerably
_commands=( ${"$(_call_program commands "$service $_sys_service_mgr -F _EXE" 2>/dev/null)"} )
_alternative : \
'files:/dev files:_files -W /dev -P /dev/' \
"commands:commands:($_commands[@])" \
- 'fields:fields:_list_fields'
+ 'fields:fields:_journalctl_fields'
}
-_journal_fields() {
+(( $+functions[_journalctl_field_values] )) ||
+_journalctl_field_values() {
local -a _fields cmd
cmd=("journalctl $_sys_service_mgr" "-F ${@[-1]}" "2>/dev/null" )
_fields=$(_call_program fields $cmd[@])
_describe 'possible values' _fields
}
-_journal_boots() {
+(( $+functions[_journalctl_boots] )) ||
+_journalctl_boots() {
local -a _bootid _previousboots
_bootid=( ${(f)"$(_call_program bootid "$service -F _BOOT_ID")"} )
_previousboots=( -{1..${#_bootid}} )
{-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' \
+ {-b+,--boot=}'[Show data only from the specified boot or offset]::boot id or offset:_journalctl_boots' \
'--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' \
- '--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' \
- {-t+,--identifier=}'[Show only messages with the specified syslog identifier]:identifier:_journal_fields SYSLOG_IDENTIFIER' \
- {-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' \
+ {-u+,--unit=}'[Show data only from the specified unit]:units:_journalctl_field_values _SYSTEMD_UNIT' \
+ '--user-unit=[Show data only from the specified user session unit]:units:_journalctl_field_values USER_UNIT' \
+ {-p+,--priority=}'[Show only messages within the specified priority range]:priority:_journalctl_field_values PRIORITY' \
+ {-t+,--identifier=}'[Show only messages with the specified syslog identifier]:identifier:_journalctl_field_values SYSLOG_IDENTIFIER' \
+ {-c+,--cursor=}'[Start showing entries from the specified cursor]:cursors:_journalctl_field_values __CURSORS' \
+ '--after-cursor=[Start showing entries from after the specified cursor]:cursors:_journalctl_field_values __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' \
+ {-F,--field=}'[List all values a certain field takes]:Fields:_journalctl_fields' \
'--system[Show system and kernel messages]' \
'--user[Show messages from user services]' \
'(--directory -D -M --machine --root --file)'{-M+,--machine=}'[Operate on local container]:machines:_sd_machines' \
'--interval=[Time interval for changing the FSS sealing key]:time interval' \
'--verify[Verify journal file consistency]' \
'--verify-key=[Specify FSS verification key]:FSS key' \
- '*::default: _journal_none'
+ '*::default: _journalctl_none'
#compdef kernel-install
# SPDX-License-Identifier: LGPL-2.1+
-_images(){
+(( $+functions[_kernel-install_images] )) ||
+_kernel-install_images(){
if [[ "$words[2]" == "remove" ]]; then
_message 'No more options'
else
fi
}
-_kernels(){
+(( $+functions[_kernel-install_kernels] )) ||
+_kernel-install_kernels(){
read _MACHINE_ID < /etc/machine-id
_kernel=( /lib/modules/[0-9]* )
if [[ "$cmd" == "remove" && -n "$_MACHINE_ID" ]]; then
_arguments \
'1::add or remove:(add remove)' \
- '2::kernel versions:_kernels' \
- '3::kernel images:_images'
+ '2::kernel versions:_kernel-install_kernels' \
+ '3::kernel images:_kernel-install_images'
#vim: set ft=zsh sw=4 ts=4 et
#compdef localectl
# SPDX-License-Identifier: LGPL-2.1+
+(( $+functions[_localectl_set-locale] )) ||
_localectl_set-locale() {
local -a _locales locale_fields
locale_fields=(LANG LANGUAGE LC_CTYPE LC_NUMERIC LC_TIME \
fi
}
+(( $+functions[_localectl_set-keymap] )) ||
_localectl_set-keymap() {
local -a _keymaps
if (( CURRENT <= 3 )); then
fi
}
+(( $+functions[_localectl_set-x11-keymap] )) ||
_localectl_set-x11-keymap() {
if (( $+commands[pkg-config] )); then
local -a _file _layout _model _variant _options
fi
}
-_localectl_command() {
+(( $+functions[_localectl_commands] )) ||
+_localectl_commands() {
local -a _localectl_cmds
_localectl_cmds=(
'status:Show current locale settings'
'--no-ask-password[Do not prompt for password]' \
{-H+,--host=}'[Operate on remote host]:userathost:_sd_hosts_or_user_at_host' \
{-M+,--machine=}'[Operate on local container]:machine' \
- '*::localectl commands:_localectl_command'
+ '*::localectl commands:_localectl_commands'
#compdef loginctl
# SPDX-License-Identifier: LGPL-2.1+
+(( $+functions[_loginctl_all_sessions] )) ||
_loginctl_all_sessions() {
local session description
loginctl --no-legend list-sessions | while read -r session description; do
done
}
+(( $+functions[_loginctl_all_users] )) ||
_loginctl_all_users() {
local uid description
loginctl --no-legend list-users | while read -r uid description; do
done
}
+(( $+functions[_loginctl_all_seats] )) ||
_loginctl_all_seats() {
local seat description
loginctl --no-legend list-seats | while read -r seat description; do
# no loginctl completion for:
# [STANDALONE]='list-sessions list-users list-seats flush-devices'
-(( $+functions[_loginctl_command] )) || _loginctl_command()
+(( $+functions[_loginctl_commands] )) || _loginctl_commands()
{
local -a _loginctl_cmds
_loginctl_cmds=(
'--no-ask-password[Do not ask for system passwords]' \
{-n+,--lines=}'[Number of journal entries to show]' \
{-o+,--output=}'[Change journal output mode]:output modes:_sd_outputmodes' \
- '*::loginctl command:_loginctl_command'
+ '*::loginctl command:_loginctl_commands'
#compdef machinectl
# SPDX-License-Identifier: LGPL-2.1+
-__get_available_machines () {
+(( $+functions[__machinectl_get_machines] )) ||
+__machinectl_get_machines () {
machinectl --no-legend list-images | {while read -r a b; do echo $a; done;}
}
-_available_machines() {
+(( $+functions[_machinectl_machines] )) ||
+_machinectl_machines() {
local -a _machines
- _machines=("${(fo)$(__get_available_machines)}")
+ _machines=("${(fo)$(__machinectl_get_machines)}")
typeset -U _machines
if [[ -n "$_machines" ]]; then
_describe 'machines' _machines
fi
}
-(( $+functions[_machinectl_command] )) || _machinectl_command()
+(( $+functions[_machinectl_commands] )) || _machinectl_commands()
{
local -a _machinectl_cmds
_machinectl_cmds=(
list*|cancel-transfer|pull-tar|pull-raw)
msg="no options" ;;
clone)
- _available_machines ;;
+ _machinectl_machines ;;
start)
- _available_machines ;;
+ _machinectl_machines ;;
*)
_sd_machines
esac
{-o+,--output=}'[Change journal output mode.]:output modes:_sd_outputmodes' \
'--verify=[Verification mode for downloaded images.]:verify:(no checksum signature)' \
'--force[Download image even if already exists.]' \
- '*::machinectl command:_machinectl_command'
+ '*::machinectl command:_machinectl_commands'
#compdef networkctl
# SPDX-License-Identifier: LGPL-2.1+
-_networkctl_command(){
+(( $+functions[_networkctl_commands] )) ||
+_networkctl_commands(){
local -a _networkctl_cmds
_networkctl_cmds=(
'list:List existing links'
'--no-legend[Do not print the column headers]' \
{-h,--help}'[Show this help]' \
'--version[Show package version]' \
- '*::networkctl commands:_networkctl_command'
+ '*::networkctl commands:_networkctl_commands'
#autoload
# SPDX-License-Identifier: LGPL-2.1+
-__get_machines () {
+
+(( $+functions[__sd_machines_get_machines] )) ||
+__sd_machines_get_machines () {
machinectl --full --no-legend --no-pager list | {while read -r a b; do echo $a; done;};
}
local -a _machines
-_machines=("${(fo)$(__get_machines)}")
+_machines=("${(fo)$(__sd_machines_get_machines)}")
typeset -U _machines
if [[ -n "$_machines" ]]; then
_describe 'machines' _machines
#compdef systemctl
# SPDX-License-Identifier: LGPL-2.1+
-(( $+functions[_systemctl_command] )) || _systemctl_command()
+(( $+functions[_systemctl_commands] )) || _systemctl_commands()
{
local -a _systemctl_cmds
_systemctl_cmds=(
fi
}
+# @todo _systemd-run has a helper with the same name, so we must redefine
__systemctl()
{
systemctl $_sys_service_mgr --full --no-legend --no-pager "$@" 2>/dev/null
# Fills the unit list
+(( $+functions[_systemctl_all_units] )) ||
_systemctl_all_units()
{
if ( [[ ${+_sys_all_units} -eq 0 ]] || _cache_invalid SYS_ALL_UNITS$_sys_service_mgr ) ||
}
# Fills the unit list including all file units
+(( $+functions[_systemctl_really_all_units] )) ||
_systemctl_really_all_units()
{
local -a all_unit_files;
fi
}
+(( $+functions[_filter_units_by_property] )) ||
_filter_units_by_property() {
local property=$1 value=$2; shift 2
local -a units; units=("${(q-)@}")
echo -E - "${(@g:o:)${(k@)props[(Re)$property=$value]}#Id=}"
}
+(( $+functions[_systemctl_get_non_template_names] )) ||
_systemctl_get_non_template_names() { echo -E - ${^${(R)${(f)"$(
__systemctl $mode list-unit-files "$PREFIX*"
__systemctl $mode list-units --all "$PREFIX*"
)"}:#*@.*}%%[[:space:]]*} }
+(( $+functions[_systemctl_get_template_names] )) ||
_systemctl_get_template_names() { echo -E - ${^${(M)${(f)"$(__systemctl list-unit-files "$PREFIX*" )"}##*@.[^[:space:]]##}%%@.*}\@ }
-
+(( $+functions[_systemctl_active_units] )) ||
_systemctl_active_units() {_sys_active_units=( ${${(f)"$(__systemctl list-units "$PREFIX*" )"}%% *} )}
+(( $+functions[_systemctl_startable_units] )) ||
_systemctl_startable_units(){
_sys_startable_units=( $( _filter_units_by_property ActiveState inactive $(
_filter_units_by_property CanStart yes ${${${(f)"$(
)) )
}
+(( $+functions[_systemctl_restartable_units] )) ||
_systemctl_restartable_units(){
_sys_restartable_units=( $( _filter_units_by_property CanStart yes ${${${(f)"$(
__systemctl $mode list-unit-files --state enabled,disabled,static "$PREFIX*"
)"}:#*@.*}%%[[:space:]]*} ) )
}
+(( $+functions[_systemctl_failed_units] )) ||
_systemctl_failed_units() {_sys_failed_units=( ${${(f)"$(__systemctl list-units --state=failed "$PREFIX*" )"}%% *} ) }
+
+(( $+functions[_systemctl_unit_state] )) ||
_systemctl_unit_state() { typeset -gA _sys_unit_state; _sys_unit_state=( $(__systemctl list-unit-files "$PREFIX*" ) ) }
local fun
# emergency exit halt kexec list-jobs list-units
# list-unit-files poweroff reboot rescue show-environment'
+(( $+functions[_systemctl_caching_policy] )) ||
_systemctl_caching_policy()
{
local _sysunits
return 1
}
-_unit_states() {
+(( $+functions[_systemctl_unit_states] )) ||
+_systemctl_unit_states() {
local -a _states
_states=("${(fo)$(__systemctl --state=help)}")
_values -s , "${_states[@]}"
}
-_unit_types() {
+(( $+functions[_systemctl_unit_types] )) ||
+_systemctl_unit_types() {
local -a _types
_types=("${(fo)$(__systemctl -t help)}")
_values -s , "${_types[@]}"
}
-_unit_properties() {
+(( $+functions[_systemctl_unit_properties] )) ||
+_systemctl_unit_properties() {
if ( [[ ${+_sys_all_properties} -eq 0 ]] || _cache_invalid SYS_ALL_PROPERTIES$_sys_service_mgr ) ||
! _retrieve_cache SYS_ALL_PROPERTIES$_sys_service_mgr;
then
_values -s , "${_sys_all_properties[@]}"
}
-_job_modes() {
+(( $+functions[_systemctl_job_modes] )) ||
+_systemctl_job_modes() {
local -a _modes
_modes=(fail replace replace-irreversibly isolate ignore-dependencies ignore-requirements flush)
_values -s , "${_modes[@]}"
_arguments -s \
{-h,--help}'[Show help]' \
'--version[Show package version]' \
- {-t+,--type=}'[List only units of a particular type]:unit type:_unit_types' \
- '--state=[Display units in the specified state]:unit state:_unit_states' \
- '--job-mode=[Specify how to deal with other jobs]:mode:_job_modes' \
- {-p+,--property=}'[Show only properties by specific name]:unit property:_unit_properties' \
+ {-t+,--type=}'[List only units of a particular type]:unit type:_systemctl_unit_types' \
+ '--state=[Display units in the specified state]:unit state:_systemctl_unit_states' \
+ '--job-mode=[Specify how to deal with other jobs]:mode:_systemctl_job_modes' \
+ {-p+,--property=}'[Show only properties by specific name]:unit property:_systemctl_unit_properties' \
{-a,--all}'[Show all units/properties, including dead/empty ones]' \
'--reverse[Show reverse dependencies]' \
'--after[Show units ordered after]' \
'--firmware-setup[Tell the firmware to show the setup menu on next boot]' \
'--plain[When used with list-dependencies, print output as a list]' \
'--failed[Show failed units]' \
- '*::systemctl command:_systemctl_command'
+ '*::systemctl command:_systemctl_commands'
#compdef systemd-analyze
# SPDX-License-Identifier: LGPL-2.1+
-_systemd_analyze_log-level() {
+(( $+functions[_systemd-analyze_log-level] )) ||
+_systemd-analyze_log-level() {
local -a _levels
_levels=(debug info notice warning err crit alert emerg)
_describe -t level 'logging level' _levels || compadd "$@"
}
-_systemd_analyze_log-target() {
+(( $+functions[_systemd-analyze_log-target] )) ||
+_systemd-analyze_log-target() {
local -a _targets
_targets=(console journal kmsg journal-or-kmsg null)
_describe -t target 'logging target' _targets || compadd "$@"
}
-_systemd_analyze_verify() {
+(( $+functions[_systemd-analyze_verify] )) ||
+_systemd-analyze_verify() {
_sd_unit_files
}
-_systemd_analyze_service-watchdogs() {
+(( $+functions[_systemd-analyze_service-watchdogs] )) ||
+_systemd-analyze_service-watchdogs() {
local -a _states
_states=(on off)
_describe -t state 'state' _states || compadd "$@"
}
-_systemd_analyze_command(){
+(( $+functions[_systemd-analyze_commands] )) ||
+_systemd-analyze_commands(){
local -a _systemd_analyze_cmds
# Descriptions taken from systemd-analyze --help.
_systemd_analyze_cmds=(
local curcontext="$curcontext"
cmd="${${_systemd_analyze_cmds[(r)$words[1]:*]%%:*}}"
if (( $#cmd )); then
- if (( $+functions[_systemd_analyze_$cmd] )) && (( CURRENT == 2 )); then
- _systemd_analyze_$cmd
+ if (( $+functions[_systemd-analyze_$cmd] )) && (( CURRENT == 2 )); then
+ _systemd-analyze_$cmd
else
_message "no more options"
fi
'--to-pattern=[When generating a dependency graph, filter only destinations]:GLOB' \
{-H+,--host=}'[Operate on remote host]:userathost:_sd_hosts_or_user_at_host' \
{-M+,--machine=}'[Operate on local container]:machine:_sd_machines' \
- '*::systemd-analyze commands:_systemd_analyze_command'
+ '*::systemd-analyze commands:_systemd-analyze_commands'
#compdef systemd-delta
# SPDX-License-Identifier: LGPL-2.1+
-_delta_type() {
+(( $+functions[_systemd-delta_types] )) ||
+_systemd-delta_types() {
local -a _delta_types
_delta_types=(masked equivalent redirected overridden unchanged)
_values -s , "${_delta_types[@]}"
'--version[Show package version]' \
'--no-pager[Do not pipe output into a pager]' \
'--diff=[Show a diff when overridden files differ]:boolean:(1 0)' \
- {-t+,--type=}'[Only display a selected set of override types]:types:_delta_type' \
+ {-t+,--type=}'[Only display a selected set of override types]:types:_systemd-delta_types' \
':SUFFIX:(tmpfiles.d sysctl.d systemd/system)'
#compdef systemd-inhibit
# SPDX-License-Identifier: LGPL-2.1+
-_systemd_inhibit_command(){
+(( $+functions[_systemd-inhibit_commands] )) ||
+_systemd-inhibit_commands(){
if (( CURRENT == 1 )); then
compset -q
_normal
fi
}
-_inhibit_what() {
+(( $+functions[_systemd-inhibit_what] )) ||
+_systemd-inhibit_what() {
local _inhibit
_inhibit=(shutdown sleep idle handle-power-key handle-suspend-key handle-hibernate-key handle-lid-switch)
_values -s : "${_inhibit[@]}"
'--why=[A descriptive string why is being inhibited]:reason for the lock:' \
'--mode=[One of block or delay]:lock mode:( block delay )' \
'--list[List active inhibitors]' \
- '*:commands:_systemd_inhibit_command'
+ '*:commands:_systemd-inhibit_commands'
#compdef systemd-nspawn
# SPDX-License-Identifier: LGPL-2.1+
-_nspawn-caps(){
+(( $+functions[_systemd-nspawn_caps] )) ||
+_systemd-nspawn_caps(){
local -a _caps
_caps=( CAP_CHOWN CAP_DAC_OVERRIDE CAP_DAC_READ_SEARCH
CAP_FOWNER CAP_FSETID CAP_IPC_OWNER CAP_KILL CAP_LEASE CAP_LINUX_IMMUTABLE
{--port=,-p+}'[Expose a container IP port on the host.]: : _message port' \
{--selinux-context=,-Z+}'[Sets the SELinux security context to be used to label processes in the container.]: : _message "SELinux context"' \
{--selinux-apifs-context=,-L+}'[Sets the SELinux security context to be used to label files in the virtual API file systems in the container.]: : _message "SELinux context"' \
- '--capability=[List one or more additional capabilities to grant the container.]:capabilities:_nspawn-caps' \
- '--drop-capability=[Specify one or more additional capabilities to drop for the containerm]:capabilities:_nspawn-caps' \
+ '--capability=[List one or more additional capabilities to grant the container.]:capabilities:_systemd-nspawn_caps' \
+ '--drop-capability=[Specify one or more additional capabilities to drop for the containerm]:capabilities:_systemd-nspawn_caps' \
"--link-journal=[Control whether the container's journal shall be made visible to the host system.]:options:(no host guest auto)" \
'-j[Equivalent to --link-journal=guest.]' \
'--read-only[Mount the root file system read only for the container.]' \
# You should have received a copy of the GNU Lesser General Public License
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
-_dns_protocol() {
+(( $+functions[_systemd-resolve_protocols] )) ||
+_systemd-resolve_protocols() {
local -a _protocol
_protocol=( $(_call_program protocol ${service} --legend=no --protocol help; echo help) )
_values 'protocol' "$_protocol[@]"
}
-_dns_type() {
+(( $+functions[_systemd-resolve_types] )) ||
+_systemd-resolve_types() {
local -a _type
_type=( $(_call_program type ${service} --legend=no --type help; echo help) )
_values 'type' "$_type[@]"
}
-_dns_class() {
+(( $+functions[_systemd-resolve_classes] )) ||
+_systemd-resolve_classes() {
local -a _class
_class=( $(_call_program class ${service} --legend=no --class help; echo help) )
_values 'class' "$_class[@]"
}
+(( $+functions[_systemd-resolve_none] )) ||
_systemd-resolve_none() {
_alternative : \
'domain:DNS address:' \
'-4[Resolve IPv4 addresses]' \
'-6[Resolve IPv6 addresses]' \
{-i+,--interface=}'[Look on interface]:interface:_net_interfaces' \
- {-p+,--protocol=}'[Look via protocol]:protocol:_dns_protocol' \
- {-t+,--type=}'[Query RR with DNS type]:type:_dns_type' \
- {-c+,--class=}'[Query RR with DNS class]:class:_dns_class' \
+ {-p+,--protocol=}'[Look via protocol]:protocol:_systemd-resolve_protocols' \
+ {-t+,--type=}'[Query RR with DNS type]:type:_systemd-resolve_types' \
+ {-c+,--class=}'[Query RR with DNS class]:class:_systemd-resolve_classes' \
'--service[Resolve services]' \
'--service-address=no[Do not resolve address for services]' \
'--service-txt=no[Do not resolve TXT records for services]' \
#compdef systemd-run
# SPDX-License-Identifier: LGPL-2.1+
+# @todo _systemctl has a helper with the same name, so we must redefine
__systemctl() {
local -a _modes
_modes=("--user" "--system")
systemctl ${words:*_modes} --full --no-legend --no-pager "$@" 2>/dev/null
}
-__get_slices () {
+(( $+functions[__systemd-run_get_slices] )) ||
+__systemd-run_get_slices () {
__systemctl list-units --all -t slice \
| { while read -r a b; do echo $a; done; };
}
-__slices () {
+(( $+functions[__systemd-run_slices] )) ||
+__systemd-run_slices () {
local -a _slices
- _slices=(${(fo)"$(__get_slices)"})
+ _slices=(${(fo)"$(__systemd-run_get_slices)"})
typeset -U _slices
_describe 'slices' _slices
}
ProtectSystem= ProtectHome= RuntimeDirectory= PassEnvironment= \
))' \
'--description=[Description for unit]:description' \
- '--slice=[Run in the specified slice]:slices:__slices' \
+ '--slice=[Run in the specified slice]:slices:__systemd-run_slices' \
{-r,--remain-after-exit}'[Leave service around until explicitly stopped]' \
'--send-sighup[Send SIGHUP when terminating]' \
'--service-type=[Service type]:type:(simple forking oneshot dbus notify idle)' \
#compdef udevadm
# SPDX-License-Identifier: LGPL-2.1+
+(( $+functions[_udevadm_info] )) ||
_udevadm_info(){
_arguments \
'--query=[Query the database for specified type of device data. It needs the --path or --name to identify the specified device.]:type:(name symlink path property all)' \
'--cleanup-db[Cleanup the udev database.]'
}
+(( $+functions[_udevadm_trigger] )) ||
_udevadm_trigger(){
_arguments \
'--verbose[Print the list of devices which will be triggered.]' \
'--parent-match=[Trigger events for all children of a given device.]'
}
+(( $+functions[_udevadm_settle] )) ||
_udevadm_settle(){
_arguments \
'--timeout=[Maximum number of seconds to wait for the event queue to become empty.]' \
'--help[Print help text.]'
}
+(( $+functions[_udevadm_control] )) ||
_udevadm_control(){
_arguments \
'--exit[Signal and wait for systemd-udevd to exit.]' \
'--help[Print help text.]'
}
+(( $+functions[_udevadm_monitor] )) ||
_udevadm_monitor(){
_arguments \
'--kernel[Print the kernel uevents.]' \
'--help[Print help text.]'
}
+(( $+functions[_udevadm_test] )) ||
_udevadm_test(){
_arguments \
'--action=[The action string.]:actions:(add change remove)' \
'*::devpath:_files -P /sys/ -W /sys'
}
+(( $+functions[_udevadm_test-builtin] )) ||
_udevadm_test-builtin(){
if (( CURRENT == 2 )); then
_arguments \
fi
}
+(( $+functions[_udevadm_mounts] )) ||
_udevadm_mounts(){
local dev_tmp dpath_tmp mp_tmp mline
'directories:mount point:compadd -a mp_tmp'
}
-
-_udevadm_command(){
+(( $+functions[_udevadm_commands] )) ||
+_udevadm_commands(){
local -a _udevadm_cmds
_udevadm_cmds=(
'info:query sysfs or the udev database'
'--debug[Print debug messages to stderr]' \
'--version[Print version number]' \
'--help[Print help text]' \
- '*::udevadm commands:_udevadm_command'
+ '*::udevadm commands:_udevadm_commands'