[darcs-users] darcs patch: make '--output-auto-name' accept optional directory argument

David Roundy droundy at darcs.net
Fri Sep 12 15:54:38 UTC 2008


On Fri, Sep 12, 2008 at 07:48:45PM +0400, Dmitry Kurochkin wrote:
> On Fri, Sep 12, 2008 at 7:06 PM, David Roundy <droundy at darcs.net> wrote:
> [skip]
> > I ended up fixing this myself (it was pretty easy).  So there's no
> > need for you to send something.
> 
> hunk ./src/Darcs/Arguments.lhs 1150
> -    show_long_options (map (++(" "++arg)) b) ++ latex_help h ++ "\\\\"
> +    show_long_options (map (++("[="++arg++"]")) b) ++ latex_help h ++ "\\\\"
> 
> In other cases space (" ") is used to separate option name from
> argument. I think it should be changed to "=" or " " in all cases for
> consistency.

It can't be " " for optional arguments because getopt won't parse
that.  Just try running:

$ darcs send --output-auto-name foo

darcs failed:  Not a repository: /home/droundy/darcs/foo
(/home/droundy/darcs/foo/_darcs/inventory: openBinaryFile:
inappropriate type (Not a directory))

$ darcs send --output-auto-name=foo
Creating patch to "http://darcs.net"...       
No recorded local changes to send!

So we can't use a space for optional arguments, but we can for
required arguments.  We can also use an '='  for required arguments,
if you like.  Personally I prefer to not use the '='.

David


More information about the darcs-users mailing list