2

Historically, which places (and when) does the -h command-line option come from? I’m speaking of the meaning matching the one of --help not --human-readable. Some command use the later (such as du or sort), so I suppose it wasn't there from the beginning since it’s not consistent… Was it introduced by GNU? by Bells Lab/AT&T UNIX? by Berkeley? BSD? POSIX/SUS? When? I suppose it was by several of them, and we can’t know who did the first, and probably many invented it independently, but what I’d like to know is more specifically when was it invented, as well as some examples of companies or organizations that may have begin to spread the practice among unices.

closed as primarily opinion-based by Thomas Dickey, Jeff Schaller, Romeo Ninov, Timothy Martin, Archemar Mar 28 '18 at 7:06

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    Like the help command/--help option, it probably originated in several places and was reinvented many times. – n.caillou Mar 24 '18 at 21:28
  • @n.caillou Long argument like --help afaik were invented by gnu. However I’d like to know then what were the multiples places where it was invented, and also when: before berkeley began working on unix? before gnu creation? before bsd? before posix? afterwards? – galex-713 Mar 24 '18 at 21:32
  • 1
    Once it's decided that -- and - means option, isn't it obvious that many people will be able to come up with --help and -h, even when not trying to copy something else or respect some historical standard? – n.caillou Mar 25 '18 at 22:43
  • -- came far later (with GNU) than -, and since -h to mean “help” could be virtually copied on any program, for the sake of consistency and ergonomy, it would become stupid to use -h to mean anything else (as do sort and du), so it must have happened later: the first answer attempt link seems to confirm that. So no it’s not obvious, and must have been done, maybe by several people at the same time, at some point of history, maybe the one described by the second answer attempt. – galex-713 Mar 26 '18 at 9:54
  • The help option in any program, will use more memory space. So this would mean longer load times and more disk usage. Especially if you have already man pages on the system, you waste twice the memory. So my guess would be that it was introduced, when performance/space wasn't an issue any more. But readability might have been an issue from the very begging. So du -h and sort -h have been there long before the -h option for help. – Raphael Ahrens Mar 27 '18 at 12:42
-2

From my point of view the best describe is written in "The Art of Unix Programming" by Eric S. Raymond in chapter "Command-Line options".

  • 1
    The questioner asked "When?", to which neither this nor the book chapter pointed to give an answer. – JdeBP Mar 24 '18 at 20:41
  • Sorry. I hurried. I will be much closer. – Yurij Goncharuk Mar 24 '18 at 20:46
  • 1
    This says it was “less common” in early unix history, not they didn’t invented it later, or when and who invented it. However thanks anyway for the link, as it features many informations of the same kind that I may value ^^ – galex-713 Mar 24 '18 at 20:47
-2

Most end users would have encountered command line help with early GNU efforts. In particular gcc, which was the undisputed king of cross-platform compilers for many years. In an era (late 80s, early 90s) when each new system bought seemed to have a different OS and architecture the consistent build tools were very popular. If you've ever tried building something on SunOS, Solaris, AIX, and one of the MCC Linux releases (TWO 5.25" floppies!) you'll understand why O'Reilly could market books like Porting UNIX Software, and the impetus behind POSIX.

[ In addition to gcc, GNU Make was fairly popular as a cross-platform solution and bison was ubiquitous. groff also seemed to be everywhere, as an alternative to vendor roffs. Other projects like emacs, while common, didn't really get a ton of command line usage. ]

Vendor wise the tipping point was probably SVR4 which developed jointly by AT&T and Sun and merged features from BSD and SVR3, including a separate "BSD command set." Everything following SVR4 can be loosely categorized as BSD/System 5/or dual universe. It's really the inflection point where commands had completely different arguments and command line help turned into an everyday use kind of thing. (Most commonly used after trying a BSD style ps on AIX and letting out a howl of rage.) For whatever it's worth O'Reilly published UNIX in a Nutshell in 1986 and the second edition expanded for SVR4 and Solaris 2.0 appeared in 1992. They did roughly annual printings and corrections between those, to give you some idea of the market for what's basically a book listing of command line arguments.

Of course the rise of Linux really spread the practice, since help was an option on every command not just the GNU commands everyone was using on commercial systems.

  • But that doesn't answer the question. In a quick check, I see that I've been providing usage-messages for 30+ years. – Thomas Dickey Mar 25 '18 at 20:59
  • It’s still a quite interesting contribution, yet not a valid answer as did note @ThomasDickey: was this time of great incompatibilities the one were the incentive to have something like -h the highest and then the moment where it has been introduced first by one or several of those companies? given what you say, I guess it was more useful outside of GNU and was then likely not something coming from GNU hence… but then I would have think it would have been much older than GNU, not contemporaneous… – galex-713 Mar 26 '18 at 9:57
  • Offhand, while the use of h for help is obvious, that probably dates back to the mid-1970s. Raymond's book isn't useful for research, so you'd have to spend some quality time at bitsavers. – Thomas Dickey Mar 26 '18 at 12:31

Not the answer you're looking for? Browse other questions tagged or ask your own question.