aboutsummaryrefslogtreecommitdiffstats
path: root/completion/be.bash
diff options
context:
space:
mode:
authorW. Trevor King <wking@drexel.edu>2008-11-27 09:34:54 -0500
committerW. Trevor King <wking@drexel.edu>2008-11-27 09:34:54 -0500
commit8e989347bdefab6a77e32072265fa0bd8c143c43 (patch)
treefc1d47e6b7bfef9c7d8e3517d8e9fbf7026ed8c6 /completion/be.bash
parentadb7e854b56aa7c3df6fae677fe383f417e364c4 (diff)
downloadbugseverywhere-8e989347bdefab6a77e32072265fa0bd8c143c43.tar.gz
Merged --commands and --options into --complete. Simpler that way.
Diffstat (limited to 'completion/be.bash')
-rw-r--r--completion/be.bash12
1 files changed, 4 insertions, 8 deletions
diff --git a/completion/be.bash b/completion/be.bash
index 8789352..dbe1214 100644
--- a/completion/be.bash
+++ b/completion/be.bash
@@ -11,13 +11,9 @@
# "An introduction to bash completion: part 2"
# http://www.debian-administration.org/articles/317
-# Support commands of the form:
-# be <command> [<long option>] [<long option>] ...
# Requires:
-# be --commands
-# to print a list of available commands
-# be command [<option> ...] --options
-# to print a list of available long options
+# be [X Y Z] --complete
+# to print a list of available completions at that point
_be()
{
local cur prev opts
@@ -27,7 +23,7 @@ _be()
if [ $COMP_CWORD -eq 1 ]; then
# no command yet, show all commands
- COMPREPLY=( $( compgen -W "$(be --commands)" -- $cur ) )
+ COMPREPLY=( $( compgen -W "$(be --complete)" -- $cur ) )
else
# remove the first word (should be "be") for security reasons
unset COMP_WORDS[0]
@@ -36,7 +32,7 @@ _be()
for i in `seq $COMP_CWORD ${#COMP_WORDS[@]}`; do
unset COMP_WORDS[$i];
done
- COMPREPLY=( $( compgen -W "$(be "${COMP_WORDS[@]}" --options)" -- $cur ) )
+ COMPREPLY=( $( compgen -W "$(be "${COMP_WORDS[@]}" --complete)" -- $cur ) )
fi
}