1. 24
  1.  

  2. 4
    1. 4

      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.

      1. 3

        Isn’t getopt pretty magical already? I mean, it’s just shitting in the global namespace after all.

        1. 2

          That’s true of every C library function. I don’t think of strlen as being magical, though.

        2. 4

          Or… just stick with short options and reduce the clutter. After all, help is just a manpage away.

          1. 7

            Two counter-arguments:

            1. When reading commands you’ve written (in a shell script, for example), long opts are much more self-explanatory.
            2. Sometimes you need more than 26 flags

            Edit with a third: when two common ops occupy the same alphabetical space, such as --version and --verbose.

            1. 7

              Everybody knows -V for version and -v for verbose. :)

              1. 2

                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.

                1. 2

                  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.

                  1. 4

                    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.

                    1. 1

                      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.