mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-12-24 21:34:08 +03:00
bash-completion: ensure iterators are locally scoped
Avoids leaking the 'i' variable to the user's shell session.
This commit is contained in:
parent
26be51de33
commit
a632a03076
@ -55,7 +55,7 @@ __get_masked_units () { __systemctl list-unit-files \
|
|||||||
|
|
||||||
_systemctl () {
|
_systemctl () {
|
||||||
local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
|
local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
|
||||||
local verb comps
|
local i verb comps
|
||||||
|
|
||||||
local -A OPTS=(
|
local -A OPTS=(
|
||||||
[STANDALONE]='--all -a --defaults --fail --ignore-dependencies --failed --force -f --full --global
|
[STANDALONE]='--all -a --defaults --fail --ignore-dependencies --failed --force -f --full --global
|
||||||
@ -203,7 +203,7 @@ __get_all_seats () { loginctl list-seats | { while read -r a b; do printf
|
|||||||
|
|
||||||
_loginctl () {
|
_loginctl () {
|
||||||
local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
|
local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
|
||||||
local verb comps
|
local i verb comps
|
||||||
|
|
||||||
local -A OPTS=(
|
local -A OPTS=(
|
||||||
[STANDALONE]='--all -a --help -h --no-pager --privileged -P --version'
|
[STANDALONE]='--all -a --help -h --no-pager --privileged -P --version'
|
||||||
@ -341,7 +341,7 @@ _journalctl() {
|
|||||||
complete -F _journalctl journalctl
|
complete -F _journalctl journalctl
|
||||||
|
|
||||||
_timedatectl() {
|
_timedatectl() {
|
||||||
local verb comps
|
local i verb comps
|
||||||
local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
|
local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
|
||||||
local OPTS='-h --help --version --adjust-system-clock --no-pager
|
local OPTS='-h --help --version --adjust-system-clock --no-pager
|
||||||
--no-ask-password -H --host'
|
--no-ask-password -H --host'
|
||||||
@ -391,7 +391,7 @@ _timedatectl() {
|
|||||||
complete -F _timedatectl timedatectl
|
complete -F _timedatectl timedatectl
|
||||||
|
|
||||||
_localectl() {
|
_localectl() {
|
||||||
local verb comps
|
local i verb comps
|
||||||
local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
|
local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
|
||||||
local OPTS='-h --help --version --no-convert --no-pager --no-ask-password
|
local OPTS='-h --help --version --no-convert --no-pager --no-ask-password
|
||||||
-H --host'
|
-H --host'
|
||||||
@ -441,7 +441,7 @@ _localectl() {
|
|||||||
complete -F _localectl localectl
|
complete -F _localectl localectl
|
||||||
|
|
||||||
_hostnamectl() {
|
_hostnamectl() {
|
||||||
local verb comps
|
local i verb comps
|
||||||
local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
|
local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
|
||||||
local OPTS='-h --help --version --transient --static --pretty
|
local OPTS='-h --help --version --transient --static --pretty
|
||||||
--no-ask-password -H --host'
|
--no-ask-password -H --host'
|
||||||
|
Loading…
Reference in New Issue
Block a user