I stumbled upon this the first time when I wanted to add an option -h
to my program and got an error that -h
is already in use: With add_help=True
, Python's argparse
automatically creates a help page for arguments -h
and --help
.
But using both -h
and --help
to show the help page is not the case for most programs, is it? Which popular commands even have -h
short for --help
? I had a look at some commands and oftentimes it's the abbreviation for --human-readable
or another help-unrelated option. Using -h
for the help message doesn't work with ls
, cd
, df
and diff
for example - just a few commands that I've tested, not an exhaustive or representative list of course, yet very popular commands.
Possibly -h
has been in use as the default argument to show the help page, historically, and --help
only came later? Where do man
or info
pages come in?
I don't want to confuse users by using -h
for something else than the help page if that's a popular default. However, personally, I've never used -h
and am always going for --help
.