chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add bash completion for systemd-cat
[elogind.git]
/
shell-completion
/
bash
/
timedatectl
diff --git
a/shell-completion/bash/timedatectl
b/shell-completion/bash/timedatectl
index 2842b3106925d81fb470f670b1cd439a748792f6..1a0acc6c7c089793d59d8de4d895cb51c47bc0c7 100644
(file)
--- a/
shell-completion/bash/timedatectl
+++ b/
shell-completion/bash/timedatectl
@@
-18,9
+18,10
@@
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
__contains_word () {
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
__contains_word () {
- local word=$1; shift
- for w in $*; do [[ $w = $word ]] && return 0; done
- return 1
+ local w word=$1; shift
+ for w in "$@"; do
+ [[ $w = "$word" ]] && return
+ done
}
_timedatectl() {
}
_timedatectl() {
@@
-51,7
+52,7
@@
_timedatectl() {
[TIME]='set-time'
)
[TIME]='set-time'
)
- for ((i=0; i <
=
COMP_CWORD; i++)); do
+ for ((i=0; i < COMP_CWORD; i++)); do
if __contains_word "${COMP_WORDS[i]}" ${VERBS[*]}; then
verb=${COMP_WORDS[i]}
break
if __contains_word "${COMP_WORDS[i]}" ${VERBS[*]}; then
verb=${COMP_WORDS[i]}
break