diff options
author | Jim Meyering <jim@meyering.net> | 1996-05-18 18:36:36 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1996-05-18 18:36:36 +0000 |
commit | 971c5b13793bcdbae767c434e07a4eb8578fe8cf (patch) | |
tree | d57b4690c8c44acdc6aa55211526c44d4cf61ede | |
parent | 2d8de9b8ab695a46ff93387b75264611b73e2b49 (diff) | |
download | coreutils-971c5b13793bcdbae767c434e07a4eb8578fe8cf.tar.xz |
(main): Don't recognize --help, --h, --he, --version, --v, etc.
if the POSIXLY_CORRECT environment variable is set.
-rw-r--r-- | src/printf.c | 4 | ||||
-rw-r--r-- | src/test.c | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/printf.c b/src/printf.c index 526e68ca6..59b5801eb 100644 --- a/src/printf.c +++ b/src/printf.c @@ -137,7 +137,9 @@ main (int argc, char **argv) exit_status = 0; - parse_long_options (argc, argv, "printf", PACKAGE_VERSION, usage); + /* Don't recognize --help or --version if POSIXLY_CORRECT is set. */ + if (getenv ("POSIXLY_CORRECT") == NULL) + parse_long_options (argc, argv, "printf", PACKAGE_VERSION, usage); if (argc == 1) { diff --git a/src/test.c b/src/test.c index e124ed51b..bb0ae00b1 100644 --- a/src/test.c +++ b/src/test.c @@ -1073,7 +1073,9 @@ main (int margc, char **margv) if (margv[0] && strcmp (margv[0], "[") == 0) { - parse_long_options (argc, argv, COMMAND_NAME, PACKAGE_VERSION, usage); + /* Don't recognize --help or --version if POSIXLY_CORRECT is set. */ + if (getenv ("POSIXLY_CORRECT") == NULL) + parse_long_options (argc, argv, COMMAND_NAME, PACKAGE_VERSION, usage); --margc; |