Skip to content

Commit

Permalink
- save something
Browse files Browse the repository at this point in the history
Changed files:
    builder.bash-completion -> 1.2
  • Loading branch information
glensc authored and cvs2git committed Jun 24, 2012
1 parent 9915aa7 commit 329e9cf
Showing 1 changed file with 29 additions and 23 deletions.
52 changes: 29 additions & 23 deletions builder.bash-completion
Original file line number Diff line number Diff line change
@@ -1,38 +1,44 @@
# builder(1) completion
#

_builder()
{
local cur prev first

COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}

if [ $COMP_CWORD -eq 1 ]; then
# first parameter on line
case "$cur" in
*)

COMPREPLY=( $( compgen -W '
-5 -a5 -n5 -D -V -a -b -ba -bb -bp -bc -bi -bl -bs -B -c -cf -d -g
-h -l -m -nc -ncs -nd -nm -nu -ns -ns0 -nn -ske -q -r -A -R -RB
-FRB -sd -sdp -sf -sp -su -T -Tvs -Ts -Tv -Tp -tt -ir -v -u -un
-U -Upi -np
' -- $cur ) )
case "$prev" in
-@(g|--get))
_filedir
return 0
;;
esac
--with|--without)
./builder --show-avail-bconds automake.spec
return 0
;;
esac

return 0
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '
-5 -a5 -n5 -D -V -a -b -ba -bb -bp -bc -bi -bl -bs -B -c -cf -d -g
-h -l -m -nc -ncs -nd -nm -nu -ns -ns0 -nn -ske -q -r -A -R -RB
-FRB -sd -sdp -sf -sp -su -T -Tvs -Ts -Tv -Tp -tt -ir -v -u -un
-U -Upi -np
--with --without
' -- $cur ) )
else
# find which specfile to use
specfile=
for (( i=1; i < COMP_CWORD; i++ )); do
if [[ "${COMP_WORDS[i]}" == -@(?(build)file|f) ]]; then
specfile=${COMP_WORDS[i+1]}
break
fi
done
[ ! -f $specfile ] && return 0
fi

first=${COMP_WORDS[1]}

case "$first" in
-@(g|--get))
_filedir
;;
esac

return 0
}
#complete -F _builder builder

0 comments on commit 329e9cf

Please sign in to comment.