Thanks for the patch. As soon as I have tested it I'll put it up. I guess thats a complete rewrite, there is not much left of what I put in ;)

I have to admit that I hate shell syntax.

regards,

Brian

On Tue, 19 Oct 2004 11:54:55 +0900
nobu.nokada / softhome.net wrote:

> Hi,
> 
> At Tue, 12 Oct 2004 21:20:31 +0900,
> Mauricio Fern.ANandez wrote in [ruby-talk:116288]:
> > Please find attached a patch to allow completion of unknown ports and
> > discrimination between installed and available ports.
> 
> You forgot to change RPA_PORT_COMANDS for compgen.
> 
> And improvement for multiple package completion.
> 
> 
> # Debian GNU/Linux rpa completion > # Made for "rpa (rpa-base 0.2.2-6) RPA 0.0" > # Copyright 2004 Brian Schr.ANvder <mail / brian-schroeder.de> > # See http://ruby.brian-schroeder.de/ for the latest version. > # License: GNU LGPL v2 or later > > _rpa() { > local cur prev cmd idx > > COMPREPLY=() > cur=${COMP_WORDS[COMP_CWORD]} > > RPA_SIMPLE_COMMANDS=(dist list update rollback clean help) > RPA_LOCAL_PORT_COMMANDS=(remove info check) > RPA_REMOTE_PORT_COMMANDS=(install build source query search) > RPA_PORT_COMMANDS=(${RPA_LOCAL_PORT_COMMANDS[*]} ${RPA_REMOTE_PORT_COMMANDS[*]}) > RPA_OPTIONS=(-h --help --no-proxy --proxy -q --quiet -x --extended \ > --verbose --debug -v --version \ > -f --force -p --parallelize --no-tests -r --requires \ > -c --classification -e -eval -D --eval-display) > > idx=1 > while [ $idx -lt $COMP_CWORD ]; do > case "${COMP_WORDS[idx]}" in > -*) ;; > *) prev="${COMP_WORDS[idx]}"; break;; > esac > idx=$[idx+1] > done > if [ ${prev+set} ]; then > case " ${RPA_SIMPLE_COMMANDS[*]} " in > *" $prev "*) > COMPREPLY=( $(compgen -W "${RPA_OPTIONS[*]}" ${cur}) ); > return 0;; > esac > case " ${RPA_LOCAL_PORT_COMMANDS[*]} " in > *" $prev "*) > cmd=list;; > esac > case " ${RPA_REMOTE_PORT_COMMANDS[*]} " in > *" $prev "*) > cmd=query;; > esac > if [ "$cmd" ]; then > COMPREPLY=( $(compgen -W "$(rpa $cmd | ruby -n -e 'puts $1 if /([-\w]+)\s+[0-9]+/')" ${cur} ) ) > else > COMPREPLY=( $(compgen -W "${RPA_SIMPLE_COMMANDS[*]} ${RPA_PORT_COMMANDS[*]} ${RPA_OPTIONS[*]}" ${cur} ) ) > fi > fi > > return 0 > } > complete -F _rpa rpa > > # 10/11/2004: First release > # 10/12/2004: Patch by Mauricio FernáÏdez >
> > -- > Nobu Nakada >