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

test/[: remove effectively inaccessible self-doc

Did you know that you could get a manual page for the 'test'/'['
builtin command using one of these strange command lines?

	test --man --

	[ --man -- ]

Neither did I. It's not documented or mentioned anywhere (and this
syntax violates POSIX). So nobody knows about it, which makes that
documentation useless. (The regular --man option doesn't work
because that would break 'test'.) I only found out how to invoke it
when I understood what the uncommented C code handling this does.

The test/[ command's self-documentation is unmaintained since 2003
and somewhat incomplete. It's also mostly redundant with the
documentation on Conditional Expressions in the main (k)sh.1 manual
page. But unlike the latter, this is resident in RAM, wasting
working memory in every shell process.

src/cmd/ksh93/sh.1:
- Add documentation for 'test'/'[' commands (yes, they were not
  mentioned in the main manual page until now), describing them
  in terms of differences from '[[' and recommending the latter.

src/cmd/ksh93/include/test.h,
src/cmd/ksh93/bltins/test.c,
src/cmd/ksh93/data/testops.c:
- Remove RAM-resident --man doc for test/[ command.
- Remove the bizarre option parsing that allowed invoking it.
This commit is contained in:
Martijn Dekker 2020-08-30 07:47:20 +01:00
parent cd2cf236c2
commit fa6a180fdd
4 changed files with 24 additions and 119 deletions

View file

@ -61,7 +61,6 @@ extern int test_unop(Shell_t*,int, const char*);
extern int test_inode(const char*, const char*);
extern int test_binop(Shell_t*,int, const char*, const char*);
extern const char sh_opttest[];
extern const char test_opchars[];
extern const char e_argument[];
extern const char e_missing[];