I am interested to hear about the history because I have a prominent command line product that has decided to use -h for something that does not print a help message.
-h
being help was never formally declared as standard. It's a (mostly) accepted convention. If a tool has a different, more sensible use for h
, then it's up to that tool what to use.
Maybe because it's simply the most easy to guess single character to come up with when having no idea how a utility works or how to ask for more information.
I guess it would be interesting to hear when it first was started and also when it became a sort of "standard" thing to do.
I once heard this:
A Tale of Conquering the Frontier Land East of the Command Name
In 'ye olde times of total freedom' it was an anything goes - some may say a lawless time - out there in Computing Gulch.
Asking for help is an exceptional use, so quite often ?
was chosen as that nicely leaves all letters free for regular use. But there wasn't any general preference for it versus using other brands. Some ranchers liked the h
while others wanted to see a H
.
Then sheriff POSIX was sent to town by the authorities in 1988. He was supposed to not only bring law to one town but all of the wild lands. One of his very first measures was to tame the command line with his 14 commandments of Utility Syntax Guidelines. Most relevant here are number three and four:
Thus the humble question mark had to leave the town, -h
became for many the place to ask for help. And while h
wasn't really enforced, it became an accepted convention
All was nice, and the citizens of Computing Gulch did like the new cleaned up environment. Still it was a frontier place with mighty ranchers driving their GNU to town to ship them worldwide. While they liked the new conformity, they had to maintain their status as the true powers behind and insisted to tweak those 14 into Nine. At the same time felt there was still something missing. Not at least as their cattle were of course the most mighty and capable of all. They were sure that even twice 26 letters weren't enough.
So GNU introduced the long option name as part of their Program Argument Syntax Conventions. They shunned anyone calling it bloaty. To pacify their fellow citizens they added another hyphen (--option
). In fact, this worked better than expected as --help
can now be used everywhere, even in saloons where if -h
was reserved for handling the holster rack.
That's the way law and order was brought to Command Line Valley and everyone lived happy ever after.
Of course this is just a single tale, colported by news papers and pulp 'literature'. Other valley and villages may have had different experience and still live by different conventions.
I guess it would also be interesting to hear what system in addition to the time.
While command line parameters date back to 'ancient' systems like Multics or TOPS-10 (*1), the whole modern origin is ofc. *NIX. So pick anything inbetween PDP-11 to 8086 or thereafter.
*1 - Or RDOS/AOS when it comes to the MS-DOS/Windows separator of '/'.