You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Jack Repenning <jr...@collab.net> on 2003/07/26 02:08:03 UTC

Re: [PATCH] bash_completion: improvement, fixes and tests [was: Re: subversion and programmable completion]

At 2:55 AM +0100 7/26/03, Philip Martin wrote:
>My argument is that "svn --help " breaks further completion so I don't
>want to completion to suggest it. The "--help" option is not special
>here, all options break completion if they occur first, so "svn -v "
>breaks further completion even though "svn -v st" is a valid command.

Once you get to the --stuff, your completion is broken anyway, isn't 
it?  But there are  potentially completable things out there.  Unless 
you wanted to universally encourage the neologism

svn commit filename --flag
-- 
-==-
Jack Repenning
CollabNet, Inc.
8000 Marina Boulevard, Suite 600
Brisbane, California 94005
o: 650.228.2562
c: 408.835-8090

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] bash_completion: improvement, fixes and tests [was: Re: subversion and programmable completion]

Posted by Sebastien Cevey <se...@cine7.net>.
On Sat, Jul 26, 2003 at 01:30:19PM +0100, Julian Foad wrote:

> 1. An enhancement.  On completing "st", it is annoying to stop at
> "st", "stat" and "status"; I think it should expand to "status"
> immediately.

+1

Since completion is here to complete commands, I think it makes sense
to have them, well, complete the commands rather than complete the
short forms of those commands. It is already short enough so that you
don't need completion if you want to use them, IMHO.


> This applies to most subcommands, but there are one or two
> exceptions: "co" should not expand immediately to "commit" as it
> means something else.

Well if you <TAB> after "co", you don't really expect it to complete
to "checkout", do you ? I mean why press <TAB> if you want to checkout
and you have already the command for it ?

I think that if the bash_completion is changed to complete only "long"
commands, it should complete intuitively to the command that matches
the user-input.

Oh did you mean that, eg "svn ps" <TAB> should be completed to "svn
propset" ? I'm no sure this is really useful, as I said in my first
paragraph.

-- 
Sebastien Cevey <se...@cine7.net>
Cine7.Net  -  Milcis.Net  -  ProgramPlay.Org
Jabber: theefer@albus.homelinux.net - ICQ: 48895760

" I saw my whole life flash before my eyes! ...It was boring! "
(Babs) [ Chicken Run ]

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] bash_completion: improvement, fixes and tests [was: Re: subversion and programmable completion]

Posted by Julian Foad <ju...@btopenworld.com>.
Philip Martin wrote:
> 
>>At 2:55 AM +0100 7/26/03, Philip Martin wrote:
>>
>>>My argument is that "svn --help " breaks further completion so I don't
>>>want to completion to suggest it. ...

That's a reasonable argument.  I hadn't thought of it that way around because I don't use "--help" followed by a subcommand.  I think of the valid syntaxes for help as being:

  svn --help|-h|-?
  svn help|h|? [SUBCOMMAND...]
  svn SUBCOMMAND --help|-h|-?

But "svn" accepts more than those.

I'm happy now that I understand your reasoning.


> --help option to be suggested as a completion for "svn".  What do we
> gain by encouraging "svn --help" over "svn help"?

<pedantic>
You mean 'by offering "--help" as well as "help"'.  We gain completion of "svn --h" to "svn --help " which tends to be what I want.  (If I want help on a subcommand I use "svn help SUBCOMMAND" or "svn SUBCOMMAND --help" instead.)  But as you point out, if the user asks for completion of "svn " then "--help" is listed as well as "help" and the user might choose "--help" and then try to get completion of subcommands, which doesn't work.  If "--help" had not been listed, he would have been more likely to have used "help" after which subcommand completion does work.  Pros and cons.  I don't mind either way now.
</pedantic>


Two more-significant issues:

1. An enhancement.  On completing "st", it is annoying to stop at "st", "stat" and "status"; I think it should expand to "status" immediately.  This applies to most subcommands, but there are one or two exceptions: "co" should not expand immediately to "commit" as it means something else.

2. It is difficult and unhelpful to make the completion match exactly the syntax that "svn" accepts because the syntax of "svn" itself is still, in my opinion, broken (including being too loose and not clearly defined).  Can we work on that instead?

- Julian


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] bash_completion: improvement, fixes and tests [was: Re: subversion and programmable completion]

Posted by Philip Martin <ph...@codematters.co.uk>.
Jack Repenning <jr...@collab.net> writes:

> At 2:55 AM +0100 7/26/03, Philip Martin wrote:
>>My argument is that "svn --help " breaks further completion so I don't
>>want to completion to suggest it. The "--help" option is not special
>>here, all options break completion if they occur first, so "svn -v "
>>breaks further completion even though "svn -v st" is a valid command.
>
> Once you get to the --stuff, your completion is broken anyway, isn't
> it?  But there are  potentially completable things out there.  Unless
> you wanted to universally encourage the neologism
>
> svn commit filename --flag

I'm not sure I understand what you mean, options can go in any order
after the sub-command.  Completion for

   svn commit -
   svn commit SomeFile -
   svn commit -m foo SomeFile AnotherFile -

all suggest a bunch of commit options.

Do you mean that completion for --username does file completion?  Yes,
it could do something more sophisticated than file completion (suggest
$USER perhaps), but that doesn't appear to me to be a reason for the
--help option to be suggested as a completion for "svn".  What do we
gain by encouraging "svn --help" over "svn help"?

-- 
Philip Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org