projects
/
tools
/
git-buildpackage.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3f05eba
)
bash completion: avoid space after options taking an argument
author
Guido Günther
<agx@sigxcpu.org>
Fri, 7 Jan 2011 08:54:10 +0000
(09:54 +0100)
committer
Guido Günther
<agx@sigxcpu.org>
Fri, 7 Jan 2011 08:58:16 +0000
(09:58 +0100)
This makes branch and tag completion more useful.
debian/git-buildpackage.bash-completion
patch
|
blob
|
history
diff --git
a/debian/git-buildpackage.bash-completion
b/debian/git-buildpackage.bash-completion
index
57b2675
..
8c61170
100644
(file)
--- a/
debian/git-buildpackage.bash-completion
+++ b/
debian/git-buildpackage.bash-completion
@@
-60,7
+60,12
@@
_gbp_comp ()
return 0
fi
- COMPREPLY=($(compgen -W "$options" -- $cur))
+ # separate opts by tab so we can append a space to all options not ending
+ # with an equal sign
+ tab_opts=$(echo "$options" | sed -e 's/ \+/\t/g' -e 's/[^=]$/& /g')
+ type compopt &>/dev/null && compopt -o nospace
+ local IFS=$'\t\n'
+ COMPREPLY=($(compgen -W "$tab_opts" -- $cur))
}