1
0
mirror of https://github.com/systemd/systemd.git synced 2025-11-11 12:24:12 +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.
#
#
# 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
# the Free Software Foundation; either version 2.1 of the License, or

View File

@@ -3,7 +3,6 @@
#
# This file is part of systemd.
#
#
# 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
# the Free Software Foundation; either version 2.1 of the License, or

View File

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

View File

@@ -3,7 +3,6 @@
#
# This file is part of systemd.
#
#
# 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
# the Free Software Foundation; either version 2.1 of the License, or
@@ -43,8 +42,9 @@ _machinectl() {
local -A VERBS=(
[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
image-status show-image clone rename read-only remove set-limit export-tar export-raw'
[MACHINES]='status show start stop login shell enable disable poweroff reboot terminate kill bind
copy-to copy-from image-status show-image clone rename read-only remove set-limit
export-tar export-raw'
[FILE]='import-tar import-raw'
)

View File

@@ -3,7 +3,6 @@
#
# This file is part of systemd.
#
#
# 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
# the Free Software Foundation; either version 2.1 of the License, or

View File

@@ -3,7 +3,6 @@
#
# This file is part of systemd.
#
#
# 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
# the Free Software Foundation; either version 2.1 of the License, or

View File

@@ -3,7 +3,6 @@
#
# This file is part of systemd.
#
#
# 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
# the Free Software Foundation; either version 2.1 of the License, or

View File

@@ -3,7 +3,6 @@
#
# This file is part of systemd.
#
#
# 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
# the Free Software Foundation; either version 2.1 of the License, or

View File

@@ -3,7 +3,6 @@
#
# This file is part of systemd.
#
#
# 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
# the Free Software Foundation; either version 2.1 of the License, or

View File

@@ -3,7 +3,6 @@
#
# This file is part of systemd.
#
#
# 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
# the Free Software Foundation; either version 2.1 of the License, or

View File

@@ -3,7 +3,6 @@
#
# This file is part of systemd.
#
#
# 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
# the Free Software Foundation; either version 2.1 of the License, or
@@ -63,14 +62,16 @@ _systemd_nspawn() {
local i verb comps
local -A OPTS=(
[STANDALONE]='-h --help --version --private-network -b --boot --read-only -q --quiet --share-system --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
-S --slice -E --setenv -Z --selinux-context -L --selinux-apifs-context --register --network-interface --network-bridge
--personality -i --image --tmpfs --volatile --network-macvlan --kill-signal --template --notify-ready --root-hash
--chdir --pivot-root --property --private-users --network-namespace-path --network-ipvlan --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'
[STANDALONE]='-h --help --version --private-network -b --boot --read-only -q --quiet --share-system
--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 -S --slice -E --setenv -Z --selinux-context -L --selinux-apifs-context
--register --network-interface --network-bridge --personality -i --image --tmpfs
--volatile --network-macvlan --kill-signal --template --notify-ready --root-hash --chdir
--pivot-root --property --private-users --network-namespace-path --network-ipvlan
--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

View File

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

View File

@@ -25,5 +25,3 @@ _arguments \
'1::add or remove:(add remove)' \
'2::kernel versions:_kernel-install_kernels' \
'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
# Completion functions for SESSIONS
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}
_loginctl_all_sessions
@@ -52,8 +52,8 @@ done
# Completion functions for USERS
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}
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
# Completion functions for SEATS
(( $+functions[_loginctl_seats] )) || _loginctl_seats()
{
(( $+functions[_loginctl_seats] )) ||
_loginctl_seats() {
local -a _sys_all_seats{,_descr}
_loginctl_all_seats
@@ -95,13 +95,13 @@ done
fi
}
for fun in seat-status show-seat terminate-seat ; do
(( $+functions[_loginctl_$fun] )) || _loginctl_$fun()
{ _loginctl_seats }
(( $+functions[_loginctl_$fun] )) ||
_loginctl_$fun() { _loginctl_seats }
done
# Completion functions for ATTACH
(( $+functions[_loginctl_attach] )) || _loginctl_attach()
{
(( $+functions[_loginctl_attach] )) ||
_loginctl_attach() {
_arguments -w -C -S -s \
':seat:_loginctl_seats' \
'*:device:_files'
@@ -110,8 +110,8 @@ done
# no loginctl completion for:
# [STANDALONE]='list-sessions list-users list-seats flush-devices'
(( $+functions[_loginctl_commands] )) || _loginctl_commands()
{
(( $+functions[_loginctl_commands] )) ||
_loginctl_commands() {
local -a _loginctl_cmds
_loginctl_cmds=(
"list-sessions:List sessions"

View File

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

View File

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

View File

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