This is a review of v3, but based on the discussion about v2.
Fabien COELHO wrote:
>> $ svn pe --revprop -r10 svn:l_
>> $ 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.
I guess this is something to do with the way Bash uses the COMP_WORDBREAKS
variable. Maybe it reads the variable as soon as the user requests completion,
not after the completion function returns. Therefore, maybe, when completing
something that already begins with "svn:", instead of returning "svn:..." with
":" removed from the word breaks list, we need to put ":" back in the list (as
usual) and return just the "..." part.
>> $ svn bl_ subversion/clients/cmdline/main.c
>> $ 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.
OK, you seem to have fixed completion within a line.
>> $ svn --help_
>> 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.
As I said, it's not just the first argument that has this quirk, it also
happens after a subcommand. You have fixed that first-argument case, but not
the general case:
$ svn log --quiet_
Here are some bugs that I didn't notice before:
$ svn pget prop file --revision 1 -
--config-dir --non-interactive --revision -R
--help --password --strict -h
--no-auth-cache --recursive --username -r
It lists options including "--revision" and "-r" which should be excluded
because they have already been specified, and it doesn't list "--revprop" which
is required when "--revision" is given.
$ svn cp a b --_
$ svn cp a b -- _
After both arguments have been given to a command like "cp", it no longer
recognises options, and instead silently inserts a space.
The space is due to this line:
> + # some way to tell 'no completion'... is there a better one?
> + COMPREPLY=( '' )
This tells Bash that the only completion for this argument is the empty string.
I think it is more correct, and better in practice, to return an empty array;
although Bash then uses filenames for completion, it is more likely to result
in a beep (depending on what files are present) rather than a space. (As an
enhancement, maybe there is some way to tell Bash not to use file names for
I hope you enjoy fixing bugs! (I do.)
To unsubscribe, e-mail: firstname.lastname@example.org
For additional commands, e-mail: email@example.com
Received on Thu Nov 17 14:26:57 2005