(main): Don't recognize --help, --h, --he, --version, --v, etc.
authorJim Meyering <jim@meyering.net>
Sat, 18 May 1996 18:36:36 +0000 (18:36 +0000)
committerJim Meyering <jim@meyering.net>
Sat, 18 May 1996 18:36:36 +0000 (18:36 +0000)
if the POSIXLY_CORRECT environment variable is set.

src/printf.c
src/test.c

index 526e68c..59b5801 100644 (file)
@@ -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)
     {
index e124ed5..bb0ae00 100644 (file)
@@ -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;