argparse zero-length switch

Chris Angelico rosuav at gmail.com
Sat Oct 15 23:45:33 EDT 2011


On Sun, Oct 16, 2011 at 2:29 PM, Carl Banks <pavlovevidence at gmail.com> wrote:
> I don't really care for or agree with Steven and Ben Finney's foolish consistency.  I already weighed it against the benefits of consistency, and decided that this parameter was easily important enough to warrant special treatment.  It's actually a good thing for this parameter to look different from other switches; it marks it as specially important.

I'll weigh in then - in favour of the "foolish" consistency. It's a
far more valuable feature than you might imagine. Think how much time
your users (even yourself) are going to spend using your program; now
think how much time those same people will spend using other programs.
You can't fight something that's orders of magnitude bigger than you,
so what you'll be doing is creating a special-case that has to be kept
in the user's mind. You'll also run into trouble if anyone has a file
name that begins @; this situation already exists, but I think most
people know not to create a file called "-rf" (and even then, most
Unix programs accept "--" to mean "end of options, the next thing is a
filename").

Do what everyone else does. You'll thank yourself for it in a year or so.

ChrisA



More information about the Python-list mailing list