aboutsummaryrefslogtreecommitdiffstats
path: root/misc/completion
diff options
context:
space:
mode:
authorW. Trevor King <wking@drexel.edu>2009-07-14 15:18:07 -0400
committerW. Trevor King <wking@drexel.edu>2009-07-14 15:18:07 -0400
commite7d150fd7ca22b01defd0c615000b6bfc367aacf (patch)
treeeacb8fbc153b3b15b48cc5d2ddfee9608d431c23 /misc/completion
parentc38907c85bbb62a2b3bb00dd05eeb588ecc6845d (diff)
downloadbugseverywhere-e7d150fd7ca22b01defd0c615000b6bfc367aacf.tar.gz
Reorganized directory structure, mostly to put all the interfaces in
one place and make things clearer to the uninitiated. Here's my current understanding: . |-- libbe (the guts of BE) |-- becommands (plugins for all "be *" commands) |-- doc (documentation, currently just the man page) |-- interfaces (non-commandline interface implementations) | |-- web | | |-- Bugs-Everywhere-Web (in Turbogears) | |-- gui | | |-- beg (in Tkinter) | | `-- wxbe (in WX) | |-- email | `-- xml (xml <-> whatever conversion) `-- misc (random odds and ends) `-- completion (shell completion scripts) Note that I haven't attempted to use the web or gui interfaces in a while, so I'm not sure how well they're holding vs the core development.
Diffstat (limited to 'misc/completion')
-rw-r--r--misc/completion/be.bash39
1 files changed, 39 insertions, 0 deletions
diff --git a/misc/completion/be.bash b/misc/completion/be.bash
new file mode 100644
index 0000000..834bf25
--- /dev/null
+++ b/misc/completion/be.bash
@@ -0,0 +1,39 @@
+#!/bin/bash
+# Bash completion script for be (Bugs Everywhere)
+#
+# System wide installation:
+# Copy this file to /etc/bash_completion/be
+# Per-user installation:
+# Copy this file to ~/.be-completion.sh and source it in your .bashrc:
+# source ~/.be-completion.sh
+#
+# For a good intro to Bash completion, see Steve Kemp's article
+# "An introduction to bash completion: part 2"
+# http://www.debian-administration.org/articles/317
+
+# Requires:
+# be [X Y Z] --complete
+# to print a list of available completions at that point
+_be()
+{
+ local cur prev opts
+ COMPREPLY=()
+ cur="${COMP_WORDS[COMP_CWORD]}"
+ prev="${COMP_WORDS[COMP_CWORD-1]}"
+
+ if [ $COMP_CWORD -eq 1 ]; then
+ # no command yet, show all commands
+ COMPREPLY=( $( compgen -W "$(be --complete)" -- $cur ) )
+ else
+ # remove the first word (should be "be") for security reasons
+ unset COMP_WORDS[0]
+ # remove the current word and all later words, because they
+ # are not needed for completion.
+ for i in `seq $COMP_CWORD ${#COMP_WORDS[@]}`; do
+ unset COMP_WORDS[$i];
+ done
+ COMPREPLY=( $( compgen -W "$(be "${COMP_WORDS[@]}" --complete $cur)" -- $cur ) )
+ fi
+}
+
+complete -F _be be