1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-07-30 23:42:44 +03:00

shell-completion: use 4 space indentation too

The same as in other places, indentation levels were all over the place.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2019-04-05 11:39:14 +02:00
parent cc5549ca12
commit 843cfcb15c
39 changed files with 2518 additions and 2524 deletions

View File

@ -3,7 +3,6 @@
# #
# This file is part of systemd. # This file is part of systemd.
# #
#
# systemd is free software; you can redistribute it and/or modify it # systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by # under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or # the Free Software Foundation; either version 2.1 of the License, or

View File

@ -3,7 +3,6 @@
# #
# This file is part of systemd. # This file is part of systemd.
# #
#
# systemd is free software; you can redistribute it and/or modify it # systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by # under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or # the Free Software Foundation; either version 2.1 of the License, or

View File

@ -25,9 +25,9 @@ __contains_word () {
done done
} }
__locale_fields=( LANG LANGUAGE LC_CTYPE LC_NUMERIC LC_TIME \ __locale_fields=( LANG LANGUAGE LC_CTYPE LC_NUMERIC LC_TIME
LC_COLLATE LC_MONETARY LC_MESSAGES LC_PAPER \ LC_COLLATE LC_MONETARY LC_MESSAGES LC_PAPER
LC_NAME LC_ADDRESS LC_TELEPHONE \ LC_NAME LC_ADDRESS LC_TELEPHONE
LC_MEASUREMENT LC_IDENTIFICATION ) LC_MEASUREMENT LC_IDENTIFICATION )
# LC_ALL is omitted on purpose # LC_ALL is omitted on purpose

View File

@ -3,7 +3,6 @@
# #
# This file is part of systemd. # This file is part of systemd.
# #
#
# systemd is free software; you can redistribute it and/or modify it # systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by # under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or # the Free Software Foundation; either version 2.1 of the License, or
@ -43,8 +42,9 @@ _machinectl() {
local -A VERBS=( local -A VERBS=(
[STANDALONE]='list list-images clean pull-tar pull-raw list-transfers cancel-transfer import-fs' [STANDALONE]='list list-images clean pull-tar pull-raw list-transfers cancel-transfer import-fs'
[MACHINES]='status show start stop login shell enable disable poweroff reboot terminate kill bind copy-to copy-from [MACHINES]='status show start stop login shell enable disable poweroff reboot terminate kill bind
image-status show-image clone rename read-only remove set-limit export-tar export-raw' copy-to copy-from image-status show-image clone rename read-only remove set-limit
export-tar export-raw'
[FILE]='import-tar import-raw' [FILE]='import-tar import-raw'
) )

View File

@ -3,7 +3,6 @@
# #
# This file is part of systemd. # This file is part of systemd.
# #
#
# systemd is free software; you can redistribute it and/or modify it # systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by # under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or # the Free Software Foundation; either version 2.1 of the License, or

View File

@ -3,7 +3,6 @@
# #
# This file is part of systemd. # This file is part of systemd.
# #
#
# systemd is free software; you can redistribute it and/or modify it # systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by # under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or # the Free Software Foundation; either version 2.1 of the License, or

View File

@ -3,7 +3,6 @@
# #
# This file is part of systemd. # This file is part of systemd.
# #
#
# systemd is free software; you can redistribute it and/or modify it # systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by # under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or # the Free Software Foundation; either version 2.1 of the License, or

View File

@ -3,7 +3,6 @@
# #
# This file is part of systemd. # This file is part of systemd.
# #
#
# systemd is free software; you can redistribute it and/or modify it # systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by # under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or # the Free Software Foundation; either version 2.1 of the License, or

View File

@ -3,7 +3,6 @@
# #
# This file is part of systemd. # This file is part of systemd.
# #
#
# systemd is free software; you can redistribute it and/or modify it # systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by # under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or # the Free Software Foundation; either version 2.1 of the License, or

View File

@ -3,7 +3,6 @@
# #
# This file is part of systemd. # This file is part of systemd.
# #
#
# systemd is free software; you can redistribute it and/or modify it # systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by # under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or # the Free Software Foundation; either version 2.1 of the License, or

View File

@ -3,7 +3,6 @@
# #
# This file is part of systemd. # This file is part of systemd.
# #
#
# systemd is free software; you can redistribute it and/or modify it # systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by # under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or # the Free Software Foundation; either version 2.1 of the License, or
@ -63,14 +62,16 @@ _systemd_nspawn() {
local i verb comps local i verb comps
local -A OPTS=( local -A OPTS=(
[STANDALONE]='-h --help --version --private-network -b --boot --read-only -q --quiet --share-system --keep-unit -n --network-veth [STANDALONE]='-h --help --version --private-network -b --boot --read-only -q --quiet --share-system
-j -x --ephemeral -a --as-pid2 --private-users-chown -U' --keep-unit -n --network-veth -j -x --ephemeral -a --as-pid2 --private-users-chown -U'
[ARG]='-D --directory -u --user --uuid --capability --drop-capability --link-journal --bind --bind-ro -M --machine [ARG]='-D --directory -u --user --uuid --capability --drop-capability --link-journal --bind --bind-ro
-S --slice -E --setenv -Z --selinux-context -L --selinux-apifs-context --register --network-interface --network-bridge -M --machine -S --slice -E --setenv -Z --selinux-context -L --selinux-apifs-context
--personality -i --image --tmpfs --volatile --network-macvlan --kill-signal --template --notify-ready --root-hash --register --network-interface --network-bridge --personality -i --image --tmpfs
--chdir --pivot-root --property --private-users --network-namespace-path --network-ipvlan --network-veth-extra --volatile --network-macvlan --kill-signal --template --notify-ready --root-hash --chdir
--network-zone -p --port --system-call-filter --overlay --overlay-ro --settings --pivot-root --property --private-users --network-namespace-path --network-ipvlan
--rlimit --hostname --no-new-privileges --oom-score-adjust --cpu-affinity --resolv-conf --timezone' --network-veth-extra --network-zone -p --port --system-call-filter --overlay --overlay-ro
--settings --rlimit --hostname --no-new-privileges --oom-score-adjust --cpu-affinity
--resolv-conf --timezone'
) )
_init_completion || return _init_completion || return

View File

@ -110,6 +110,7 @@ _udevadm() {
local IFS=$'\n' local IFS=$'\n'
fi fi
;; ;;
'trigger') 'trigger')
if __contains_word "$prev" ${OPTS[TRIGGER_ARG]}; then if __contains_word "$prev" ${OPTS[TRIGGER_ARG]}; then
case $prev in case $prev in
@ -141,6 +142,7 @@ _udevadm() {
local IFS=$'\n' local IFS=$'\n'
fi fi
;; ;;
'settle') 'settle')
if __contains_word "$prev" ${OPTS[SETTLE]}; then if __contains_word "$prev" ${OPTS[SETTLE]}; then
case $prev in case $prev in
@ -157,6 +159,7 @@ _udevadm() {
comps="${OPTS[COMMON]} ${OPTS[SETTLE]}" comps="${OPTS[COMMON]} ${OPTS[SETTLE]}"
;; ;;
'control') 'control')
if __contains_word "$prev" ${OPTS[CONTROL_ARG]}; then if __contains_word "$prev" ${OPTS[CONTROL_ARG]}; then
case $prev in case $prev in
@ -173,6 +176,7 @@ _udevadm() {
comps="${OPTS[COMMON]} ${OPTS[CONTROL_STANDALONE]} ${OPTS[CONTROL_ARG]}" comps="${OPTS[COMMON]} ${OPTS[CONTROL_STANDALONE]} ${OPTS[CONTROL_ARG]}"
;; ;;
'monitor') 'monitor')
if __contains_word "$prev" ${OPTS[MONITOR_ARG]}; then if __contains_word "$prev" ${OPTS[MONITOR_ARG]}; then
case $prev in case $prev in
@ -186,6 +190,7 @@ _udevadm() {
comps="${OPTS[COMMON]} ${OPTS[MONITOR_STANDALONE]} ${OPTS[MONITOR_ARG]}" comps="${OPTS[COMMON]} ${OPTS[MONITOR_STANDALONE]} ${OPTS[MONITOR_ARG]}"
;; ;;
'test') 'test')
if __contains_word "$prev" ${OPTS[TEST]}; then if __contains_word "$prev" ${OPTS[TEST]}; then
case $prev in case $prev in
@ -207,6 +212,7 @@ _udevadm() {
local IFS=$'\n' local IFS=$'\n'
fi fi
;; ;;
'test-builtin') 'test-builtin')
for ((i=0; i < COMP_CWORD; i++)); do for ((i=0; i < COMP_CWORD; i++)); do
if __contains_word "${COMP_WORDS[i]}" "${builtins[@]}"; then if __contains_word "${COMP_WORDS[i]}" "${builtins[@]}"; then
@ -224,6 +230,7 @@ _udevadm() {
local IFS=$'\n' local IFS=$'\n'
fi fi
;; ;;
*) *)
comps=${VERBS[*]} comps=${VERBS[*]}
;; ;;

View File

@ -25,5 +25,3 @@ _arguments \
'1::add or remove:(add remove)' \ '1::add or remove:(add remove)' \
'2::kernel versions:_kernel-install_kernels' \ '2::kernel versions:_kernel-install_kernels' \
'3::kernel images:_kernel-install_images' '3::kernel images:_kernel-install_images'
#vim: set ft=zsh sw=4 ts=4 et

View File

@ -31,8 +31,8 @@ _loginctl_all_seats() {
local fun local fun
# Completion functions for SESSIONS # Completion functions for SESSIONS
for fun in session-status show-session activate lock-session unlock-session terminate-session kill-session ; do for fun in session-status show-session activate lock-session unlock-session terminate-session kill-session ; do
(( $+functions[_loginctl_$fun] )) || _loginctl_$fun() (( $+functions[_loginctl_$fun] )) ||
{ _loginctl_$fun() {
local -a _sys_all_sessions{,_descr} local -a _sys_all_sessions{,_descr}
_loginctl_all_sessions _loginctl_all_sessions
@ -52,8 +52,8 @@ done
# Completion functions for USERS # Completion functions for USERS
for fun in user-status show-user enable-linger disable-linger terminate-user kill-user ; do for fun in user-status show-user enable-linger disable-linger terminate-user kill-user ; do
(( $+functions[_loginctl_$fun] )) || _loginctl_$fun() (( $+functions[_loginctl_$fun] )) ||
{ _loginctl_$fun() {
local -a _sys_all_users{,_descr} local -a _sys_all_users{,_descr}
zstyle -a ":completion:${curcontext}:users" users _sys_all_users zstyle -a ":completion:${curcontext}:users" users _sys_all_users
@ -77,8 +77,8 @@ for fun in user-status show-user enable-linger disable-linger terminate-user kil
done done
# Completion functions for SEATS # Completion functions for SEATS
(( $+functions[_loginctl_seats] )) || _loginctl_seats() (( $+functions[_loginctl_seats] )) ||
{ _loginctl_seats() {
local -a _sys_all_seats{,_descr} local -a _sys_all_seats{,_descr}
_loginctl_all_seats _loginctl_all_seats
@ -95,13 +95,13 @@ done
fi fi
} }
for fun in seat-status show-seat terminate-seat ; do for fun in seat-status show-seat terminate-seat ; do
(( $+functions[_loginctl_$fun] )) || _loginctl_$fun() (( $+functions[_loginctl_$fun] )) ||
{ _loginctl_seats } _loginctl_$fun() { _loginctl_seats }
done done
# Completion functions for ATTACH # Completion functions for ATTACH
(( $+functions[_loginctl_attach] )) || _loginctl_attach() (( $+functions[_loginctl_attach] )) ||
{ _loginctl_attach() {
_arguments -w -C -S -s \ _arguments -w -C -S -s \
':seat:_loginctl_seats' \ ':seat:_loginctl_seats' \
'*:device:_files' '*:device:_files'
@ -110,8 +110,8 @@ done
# no loginctl completion for: # no loginctl completion for:
# [STANDALONE]='list-sessions list-users list-seats flush-devices' # [STANDALONE]='list-sessions list-users list-seats flush-devices'
(( $+functions[_loginctl_commands] )) || _loginctl_commands() (( $+functions[_loginctl_commands] )) ||
{ _loginctl_commands() {
local -a _loginctl_cmds local -a _loginctl_cmds
_loginctl_cmds=( _loginctl_cmds=(
"list-sessions:List sessions" "list-sessions:List sessions"

View File

@ -79,5 +79,3 @@ case "$service" in
;; ;;
*) _message 'eh?' ;; *) _message 'eh?' ;;
esac esac
#vim: set ft=zsh sw=4 ts=4 et

View File

@ -1,6 +1,5 @@
#compdef systemd-resolve #compdef systemd-resolve
# SPDX-License-Identifier: LGPL-2.1+ # SPDX-License-Identifier: LGPL-2.1+
# #
# This file is part of systemd. # This file is part of systemd.
# #

View File

@ -142,7 +142,6 @@ _udevadm_commands(){
fi fi
} }
_arguments \ _arguments \
'--debug[Print debug messages to stderr]' \ '--debug[Print debug messages to stderr]' \
'--version[Print version number]' \ '--version[Print version number]' \