Re: how optparse can go horribly wrong
- From
Shawn O. Pearce <spearce@spearce.org>
- Date
- Sep 26, 2009, 19:25 UTC
- Message-ID
- <20090926192527.GF14660@spearce.org>
- In-Reply-To
- <fabb9a1e0909260644w781d3c3h4fca22e3b7d97768@mail.gmail.com>
Sverre Rabbelier <srabbelier@gmail.com> wrote:
Show 8 quoted lines
> On Sat, Sep 26, 2009 at 03:51, Nicolas Sebrecht <nicolas.s.dev@gmx.fr> wrote: > > Doing this only to -m flag would break consistency. That said, I don't > > have any opinion in disallowing the sticked form for _all_ short > > options. > > Perhaps instead disallow it for short options that do not take a > one-symbol argument, that is -n4 makes a lot of sense to me, but -m"my > commit message here" not so much.
-1 on that, because long, long, long ago when I worked on -m support for commit I remember insisting that -mfoo and -m foo should be the same. I often do `git commit -a -mwip` or something to save my branch state and come back later.
What I think we should do is not allow cuddling of short options when the final option takes more than 1 character worth of argument. Thus `git commit -a -mfoo` is OK, but `git commit -amfoo` is not.
-- Shawn.