[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: rev 1791 - trunk/subversion/clients/cmdline trunk/tools/dev

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2002-04-27 02:31:25 CEST

Garrett Rooney <rooneg@electricjellyfish.net> writes:

> > > * tools/dev/bash_completion: New file.
> >
> > Whoa. That is so cool. I didn't know that Bash did this...

Yeah, I only discovered recently; it made me laugh at how cool it
could be!

>
> this is really cool, but i got syntax errors at lines 35 and 143.
> apparently bash 2.05a (compiled out of the FreeBSD ports tree) is
> having trouble with the following construct:
>
> @($foo)
>
> replacing it with
>
> @{$foo}
>
> seems to silence the syntax errors, and as far as i can tell, appears
> to work, but i don't know much about bash scripting, so i'm hesitant
> to commit this patch:

I don't know that much either, I stole most of this from other files
on my Debian box :)

@(...) is documented in the bash man page:

             @(pattern-list)
                     Matches exactly one of the given patterns
  
whereas @{...} doesn't appear there and doesn't work when I try it.

>
> Index: ./bash_completion
> ===================================================================
> --- ./bash_completion
> +++ ./bash_completion Fri Apr 26 20:02:20 2002
> @@ -32,7 +32,7 @@
> # if not typing an option, or if the previous option required a
> # parameter, then fallback on ordinary filename expansion
> if [[ "$cur" != -* ]] || \
> - [[ ${COMP_WORDS[COMP_CWORD-1]} == @($optsParam) ]] ; then
> + [[ ${COMP_WORDS[COMP_CWORD-1]} == @{$optsParam} ]] ; then
> return 0

This line causes expansion of things like

    'svn ci -F -'

to not produce a list of options since -F takes a mandatory file name.

-- 
Philip
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Apr 27 02:32:27 2002

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.