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

Re: [PATCH] improved bash completion v2

From: Fabien COELHO <fabien_at_coelho.net>
Date: 2005-11-15 14:37:59 CET

Dear Julian,

Thanks for the very active testing;-)

> This patch makes Bash suggest different completions in different
> circumstances: in particular, if you request completion of an empty word and
> there is some required part missing from the command, it only suggests the
> missing thing. I wasn't too sure about that idea to begin with, but it seems
> to work rather well in practice.

Yes,

I think that directing the syntax to provide the mandatory parts helps.
The price is that options are actually parsed.

> I found some bugs:

Good;-)

> (1)
> $ svn pe --revprop -r10 svn:l_
> <TAB>
> $ svn pe --revprop -r10 svn:svn:log
>
> This doesn't happen every time, only when trying that completion for the
> first time after trying a different one. Perhaps that indicates an
> uninitialised variable or similar.

Maybe. I'll try to spot the reason for it.

> (2)
> $ svn bl_ subversion/clients/cmdline/main.c
> <TAB>
> $ svn blank-log-msg.patch subversion/clients/cmdline/main.c
>
> That's the name of a local file; it should complete the subcommand name
> "blame" instead. The filename afterwards seems to confuse it.

Yep. I'm not sure the script is ok when completing inside a line rather
than at the end. I have not tested that, so it must be wrong.

> $ svn pset svn:mime-type ima_ www/images/jolt-2005.jpg
> <TAB>
> <BEEP>
>
> Similarly, here I expect the completion "image/", but it doesn't recognise
> that I'm entering a MIME type.

Idem, it is within a line, not at the end of it.

> (3)
> $ svn --help_
> <TAB>
> <BEEP>
>
> Bash beeps, presumably because this script returns no results. It should
> recognise that there is exactly one completion, and so Bash should quietly
> append a space. The same occurs for any already-complete "-" or "--" option
> after a subcommand.

I can look into that. This case is a little particular because the first
argument is expected to be a subcommand, not an option.

>> + # commands which only expect two arguments
>> + # diff has some variant with two arguments, but not all of them.
>> + # merge/switch have two or three args variants.
>> + twoArgsCmds='copy|cp|move|mv|export|import'
>
> "move" also has aliases "ren" and "rename".

Ok.

-- 
Fabien.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Nov 15 14:40:26 2005

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