3 # jhbuild tab completion for bash.
4 # (c) 2004, Davyd Madeley <davyd@ucc.asn.au>
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2, or (at your option)
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software Foundation,
18 # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 # To use this completion function simply source this file into your bashrc
22 # . ~/path/to/jhbuild/contrib/jhbuild_completion.bash
23 # This completion function depends on helper functions from the main set of
24 # bash completions, ensure you've sourced /etc/bash_completion before sourcing
30 local cur prev command_list i v
32 cur
=${COMP_WORDS[COMP_CWORD]}
33 prev
=${COMP_WORDS[COMP_CWORD-1]}
36 gui|tinderbox|shell|sanitycheck|bootstrap
)
39 update|updateone|build|buildone|list|dot|info|
-t|
-s|
-a|
-n|
-c)
40 # FIXME: some of these options can take multiple module names
41 # give them a list of modules
42 command_list
="`jhbuild list -a`"
45 # give them a list of commands
46 COMP_WORDS
=(COMP_WORDS
[0] $cur)
51 # give them file completion
55 # give them directory completion
59 command_list
="gui update updateone build buildone tinderbox run shell sanitycheck bootstrap list dot info"
62 if [ $COMP_CWORD -gt 2 ]; then
63 for i
in $command_list; do
64 if [ "${COMP_WORDS[COMP_CWORD-2]}" == "$i" ]; then
77 for i
in $command_list; do
78 if [ -z "${i/$cur*}" ]; then
79 COMPREPLY
=( ${COMPREPLY[@]} $i )
85 complete
-F _jhbuild jhbuild