1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

optget: display --help and --man in terse usage messages

The fact that every ksh builtin command self-documents with the
options --help and --man (and others, see 'getopts --man'; but
these are the essential ones) is poorly known; the information is
buried somewhere deep in the sh.1 manual page, and is incomplete at
that. None of the terse usage messages displayed on error point the
user to these options. So let's fix that.

src/lib/libast/misc/optget.c:
- Change generic 'options' placeholder, used in all terse usage
  messages, to 'options | --help | --man'.

src/cmd/ksh93/sh.1:
- Edit documentation of --man/-?, adding documentation on --help
  which was completely undocumented. Refer to 'getopts --man' for
  more advanced info.
- Separate these from the (important) documentation on special
  builtins using a paragraph break.
This commit is contained in:
Martijn Dekker 2020-06-15 16:56:11 +02:00
parent 7f2c81103b
commit 6916a873c2
3 changed files with 18 additions and 10 deletions

View file

@ -1627,7 +1627,7 @@ args(register Sfio_t* sp, register char* p, register int n, int flags, int style
else
{
sep = ' ';
o = T(NiL, ID, "options");
o = T(NiL, ID, "options | --help | --man");
b = style == STYLE_nroff ? "\\ " : " ";
for (;;)
{