bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: plain test(1) with no arguments is not documented


From: Paul Eggert
Subject: Re: plain test(1) with no arguments is not documented
Date: Wed, 08 Sep 2004 20:58:59 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

Dan Jacobson <address@hidden> writes:

> plain
> $ test
> with no arguments is not documented.

Thanks.  I added the following patch, with a similar patch to
coreutils.texi:

2004-09-08  Paul Eggert  <address@hidden>

        * src/test.c (usage): Document "test" (with no args) and "[ ]".

Index: src/test.c
===================================================================
RCS file: /home/eggert/coreutils/cu/src/test.c,v
retrieving revision 1.105
diff -p -u -r1.105 test.c
--- src/test.c  6 Sep 2004 01:00:03 -0000       1.105
+++ src/test.c  9 Sep 2004 03:49:45 -0000
@@ -834,7 +834,9 @@ usage (int status)
     {
       fputs (_("\
 Usage: test EXPRESSION\n\
+  or:  test\n\
   or:  [ EXPRESSION ]\n\
+  or:  [ ]\n\
   or:  [ OPTION\n\
 Exit with the status determined by EXPRESSION.\n\
 \n\
@@ -843,6 +845,7 @@ Exit with the status determined by EXPRE
       fputs (VERSION_OPTION_DESCRIPTION, stdout);
       fputs (_("\
 \n\
+An omitted EXPRESSION defaults to false.  Otherwise,\n\
 EXPRESSION is true or false and sets exit status.  It is one of:\n\
 "), stdout);
       fputs (_("\




> And, document plain
> $ test -n
> which acts differently than plain
> $ test

That's already documented, as "test STRING".  -n is the STRING here.
The details are in the manual: it's too much to put into the usage
string.

> the test manpage perhaps should take a lesson from bash's help
> test, and not say recursive things like
>
> EXPRESSION is true or false and sets exit status.  It is one of:
>
>        ( EXPRESSION )
>               EXPRESSION is true
>
> until further down the page after first lays out what EXPRESSION is.

The recursion is essential, no?  Sounds like more a matter of taste.
My copy of Bash doesn't document the recursion at all, even though it
works.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]