[devscripts] 01/01: Special-case those options only allowed immediately after the command.

Ben Finney bignose-guest at moszumanska.debian.org
Sun May 15 09:15:23 UTC 2016


This is an automated email from the git hooks/post-receive script.

bignose-guest pushed a commit to branch wip/issue/824372/include-all-options
in repository devscripts.

commit 8f1eceacc530612671fc2370ae71ae9c69b83e2c
Author: Ben Finney <ben at benfinney.id.au>
Date:   Sun May 15 12:39:09 2016 +1000

    Special-case those options only allowed immediately after the command.
---
 scripts/debdiff.bash_completion | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/scripts/debdiff.bash_completion b/scripts/debdiff.bash_completion
index c97a5d7..1ae9eef 100644
--- a/scripts/debdiff.bash_completion
+++ b/scripts/debdiff.bash_completion
@@ -8,6 +8,7 @@
 _debdiff()
 {
     local options i
+    local command_name=debdiff
     local file_list_mode=normal
     local -i move_from=-1
     local -i move_to=-1
@@ -30,6 +31,19 @@ _debdiff()
     options+=' --move --move-regex'
     options+=' --exclude'
 
+    unset COMPREPLY
+
+    case "$prev" in
+        "$command_name")
+            options+=' --noconf --no-conf'
+            ;;
+
+    esac
+
+    if [[ -v COMPREPLY ]] ; then
+        return 0
+    fi
+
     for (( i=1; i<${#words[@]}; i++ )); do
         if [[ $file_list_mode == @(deb|dsc|changes) ]]; then
             if (( i == ${#words[@]}-1 )); then
@@ -73,10 +87,6 @@ _debdiff()
         if [[ $prev == --debs-dir ]]; then
             COMPREPLY=$( ( compgen -d -- "$cur" ) )
         elif [[ $cur == -* ]]; then
-            if [[ $prev == debdiff ]]; then
-                options+=' --no-conf'
-            fi
-    
             COMPREPLY=( $( compgen -W "${options}" -- "$cur" ) )
         else
             declare -a _compreply=( $( compgen -o filenames -G '*.@(deb|dsc|changes)' ) )

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/devscripts.git



More information about the devscripts-devel mailing list