git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* how optparse can go horribly wrong
@ 2009-09-25 23:32 Shawn O. Pearce
  2009-09-26  1:51 ` Nicolas Sebrecht
  2009-10-01 20:16 ` [PATCH 1/2] do not mangle short options which take arguments Clemens Buchacher
  0 siblings, 2 replies; 21+ messages in thread
From: Shawn O. Pearce @ 2009-09-25 23:32 UTC (permalink / raw)
  To: git

*sigh*.  Someone just ran into this today:

  $ git commit -a -ammend
  [work ce38944] mend
   1 files changed, 2 insertions(+), 0 deletions(-)

Omit one - and include an extra 'm', and instead of --amend you
have -a -m mend.  Which isn't exactly what you wanted.

We do catch -amend with an error though:

  $ git commit -amend
  error: did you mean `--amend` (with two dashes ?)

I wonder, should the -m flag on commit not allow cuddling its
value against the switch when its combined in short form with
other switches?

-- 
Shawn.

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2009-10-03  9:27 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-25 23:32 how optparse can go horribly wrong Shawn O. Pearce
2009-09-26  1:51 ` Nicolas Sebrecht
2009-09-26 13:44   ` Sverre Rabbelier
2009-09-26 19:25     ` Shawn O. Pearce
2009-09-28 13:37       ` Clemens Buchacher
2009-10-01 20:16 ` [PATCH 1/2] do not mangle short options which take arguments Clemens Buchacher
2009-10-01 20:23   ` [PATCH 2/2] allow mangling short options which take integer arguments Clemens Buchacher
2009-10-01 21:55     ` Johannes Schindelin
2009-10-02  7:43       ` Clemens Buchacher
2009-10-02  7:50         ` Jeff King
2009-10-02  8:26           ` Clemens Buchacher
2009-10-02  8:41             ` Johannes Schindelin
2009-10-03  9:23           ` Clemens Buchacher
2009-10-01 21:53   ` [PATCH 1/2] do not mangle short options which take arguments Johannes Schindelin
2009-10-02  6:11   ` Jeff King
2009-10-02  7:36     ` Clemens Buchacher
2009-10-02  7:46       ` Paolo Bonzini
2009-10-02  7:57       ` Jeff King
2009-10-02  8:42       ` Johannes Schindelin
2009-10-02  8:43         ` Jeff King
2009-10-02  9:04           ` Johannes Schindelin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).