]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
test: Document that -a and -o are undesirable
authorEric Blake <eblake@redhat.com>
Fri, 4 Mar 2016 16:47:33 +0000 (09:47 -0700)
committerEric Blake <eblake@redhat.com>
Fri, 4 Mar 2016 18:55:22 +0000 (11:55 -0700)
POSIX recommends avoiding -a and -o, for good reason.
src/test.c (usage): Mention that inherent ambiguities exist with
binary -a and -o.
Problem reported by Martin Gebert in: http://bugs.gnu.org/22909

src/test.c

index 36817d24e54a6fe31e4ccf5c46231a6140952de7..8ac7467f1b3f5ecea278e0cb453b2b4de9e1ab43 100644 (file)
@@ -790,6 +790,11 @@ INTEGER may also be -l STRING, which evaluates to the length of STRING.\n\
 "), stdout);
       fputs (_("\
 \n\
+NOTE: Binary -a and -o are inherently ambiguous.  Use 'test EXPR1 && test\n\
+EXPR2' or 'test EXPR1 || test EXPR2' instead.\n\
+"), stdout);
+      fputs (_("\
+\n\
 NOTE: [ honors the --help and --version options, but test does not.\n\
 test treats each of those as it treats any other nonempty STRING.\n\
 "), stdout);