|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
From f00ffd4f0ab82c38125d2292f8f429aa22865dc3 Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
Date: Thu, 6 Feb 2014 00:31:22 -0500
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
Subject: [PATCH] bash-completion: fix completion of complete verbs
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
When doing 'command verb<TAB>', the arguments for verb would be
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
proposed, but it is too early. We should complete verb first.
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
https://bugs.freedesktop.org/show_bug.cgi?id=74596
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
Conflicts:
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
shell-completion/bash/busctl
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
shell-completion/bash/loginctl
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
shell-completion/bash/systemctl
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
shell-completion/bash/systemd-analyze
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
shell-completion/bash/hostnamectl | 2 +-
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
shell-completion/bash/localectl | 2 +-
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
shell-completion/bash/loginctl | 2 +-
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
shell-completion/bash/systemctl | 2 +-
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
shell-completion/bash/systemd-analyze | 2 +-
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
shell-completion/bash/timedatectl | 2 +-
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
shell-completion/bash/udevadm | 2 +-
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
7 files changed, 7 insertions(+), 7 deletions(-)
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
diff --git a/shell-completion/bash/hostnamectl b/shell-completion/bash/hostnamectl
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
index 38ab134..9c75da9 100644
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
--- a/shell-completion/bash/hostnamectl
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
+++ b/shell-completion/bash/hostnamectl
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
@@ -41,7 +41,7 @@ _hostnamectl() {
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
[NAME]='set-hostname'
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
)
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
- for ((i=0; i <= COMP_CWORD; i++)); do
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
+ for ((i=0; i < COMP_CWORD; i++)); do
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
if __contains_word "${COMP_WORDS[i]}" ${VERBS[*]}; then
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
verb=${COMP_WORDS[i]}
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
break
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
diff --git a/shell-completion/bash/localectl b/shell-completion/bash/localectl
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
index bec9e78..84e2a6b 100644
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
--- a/shell-completion/bash/localectl
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
+++ b/shell-completion/bash/localectl
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
@@ -52,7 +52,7 @@ _localectl() {
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
[X11]='set-x11-keymap'
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
)
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
- for ((i=0; i <= COMP_CWORD; i++)); do
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
+ for ((i=0; i < COMP_CWORD; i++)); do
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
if __contains_word "${COMP_WORDS[i]}" ${VERBS[*]}; then
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
verb=${COMP_WORDS[i]}
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
break
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
diff --git a/shell-completion/bash/loginctl b/shell-completion/bash/loginctl
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
index 3104b30..26a8696 100644
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
--- a/shell-completion/bash/loginctl
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
+++ b/shell-completion/bash/loginctl
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
@@ -70,7 +70,7 @@ _loginctl () {
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
[ATTACH]='attach'
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
)
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
- for ((i=0; $i <= $COMP_CWORD; i++)); do
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
+ for ((i=0; i < COMP_CWORD; i++)); do
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
if __contains_word "${COMP_WORDS[i]}" ${VERBS[*]} &&
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG]}; then
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
verb=${COMP_WORDS[i]}
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
diff --git a/shell-completion/bash/systemctl b/shell-completion/bash/systemctl
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
index 84149e3..a5f10b4 100644
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
--- a/shell-completion/bash/systemctl
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
+++ b/shell-completion/bash/systemctl
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
@@ -146,7 +146,7 @@ _systemctl () {
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
[TARGETS]='set-default'
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
)
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
- for ((i=0; $i <= $COMP_CWORD; i++)); do
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
+ for ((i=0; i < COMP_CWORD; i++)); do
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
if __contains_word "${COMP_WORDS[i]}" ${VERBS[*]} &&
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG]}; then
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
verb=${COMP_WORDS[i]}
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
diff --git a/shell-completion/bash/systemd-analyze b/shell-completion/bash/systemd-analyze
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
index b65466b..6afcd96 100644
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
--- a/shell-completion/bash/systemd-analyze
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
+++ b/shell-completion/bash/systemd-analyze
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
@@ -39,7 +39,7 @@ _systemd_analyze() {
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
_init_completion || return
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
- for ((i=0; $i <= $COMP_CWORD; i++)); do
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
+ for ((i=0; i < COMP_CWORD; i++)); do
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
if __contains_word "${COMP_WORDS[i]}" ${VERBS[*]} &&
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG]}; then
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
verb=${COMP_WORDS[i]}
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
diff --git a/shell-completion/bash/timedatectl b/shell-completion/bash/timedatectl
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
index c6a6545..1a0acc6 100644
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
--- a/shell-completion/bash/timedatectl
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
+++ b/shell-completion/bash/timedatectl
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
@@ -52,7 +52,7 @@ _timedatectl() {
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
[TIME]='set-time'
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
)
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
- for ((i=0; i <= COMP_CWORD; i++)); do
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
+ for ((i=0; i < COMP_CWORD; i++)); do
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
if __contains_word "${COMP_WORDS[i]}" ${VERBS[*]}; then
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
verb=${COMP_WORDS[i]}
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
break
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
diff --git a/shell-completion/bash/udevadm b/shell-completion/bash/udevadm
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
index 8ad8550..7e89189 100644
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
--- a/shell-completion/bash/udevadm
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
+++ b/shell-completion/bash/udevadm
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
@@ -36,7 +36,7 @@ _udevadm() {
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
local verbs=(info trigger settle control monitor hwdb test-builtin test)
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
- for ((i=0; i <= COMP_CWORD; i++)); do
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
+ for ((i=0; i < COMP_CWORD; i++)); do
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
if __contains_word "${COMP_WORDS[i]}" "${verbs[@]}" &&
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG]}; then
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
verb=${COMP_WORDS[i]}
|