The author has written more about the implementation.
Not sure what to think; on the one hand, I’m not a big fan of magic in source code and, especially when macros are involved, pretty spooky things can happen. However, if something is too much of a hassle to use (e.g. getopt_long, but also some of the “modern” and “simple” command-line combinators out there), people just won’t use them.
Isn’t getopt pretty magical already? I mean, it’s just shitting in the global namespace after all.
That’s true of every C library function. I don’t think of strlen as being magical, though.
Or… just stick with short options and reduce the clutter. After all, help is just a manpage away.
Edit with a third: when two common ops occupy the same alphabetical space, such as --version and --verbose.
Everybody knows -V for version and -v for verbose. :)
Except for the cases where it’s the other way around, and whenever there isn’t a verbose switch -v is generally used for version. Sort of annoying when you have to look up the version flag in the manpage (if it exists) if you don’t want to program to actually start doing whatever.
I’m also very not-a-fan of having to guess whether the syntax for “more verbose” is -vvv, -v3, -v=3, -v 3, –verbose=3, –verbose 3, …
But this is a lost cause.
This is the chapter of the Unix-Hater’s Handbook that has held up the best; X11, while still atrocious, has gotten less warty and terrible. C++ is a much better language than it was in 1991. sendmail is functionally extinct. But the state of Unix terminal software is still utter pants.
I would have guessed that “pants” as an intensifier had positive valence, rather than negative. Does the manpage…? :)
Heh, anyway, as you say. It’s nice to at least be able to look at progress in some areas.