diff options
author | Jim Meyering <jim@meyering.net> | 2004-06-17 14:34:07 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2004-06-17 14:34:07 +0000 |
commit | 72f51d66bf8e5364edfa0975c96ddebcaefd089e (patch) | |
tree | 1403f915dc59d87c39c34ff9260439b9c04c35a4 /src/yes.c | |
parent | 7870fa108121ddc3d4aa3ae252250040638a4f42 (diff) | |
download | coreutils-72f51d66bf8e5364edfa0975c96ddebcaefd089e.tar.xz |
(main): Recognize --help and --version even if POSIXLY_CORRECT is set.
Diffstat (limited to 'src/yes.c')
-rw-r--r-- | src/yes.c | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -71,10 +71,16 @@ main (int argc, char **argv) atexit (close_stdout); - /* Don't recognize --help or --version if POSIXLY_CORRECT is set. */ - if (getenv ("POSIXLY_CORRECT") == NULL) - parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, - usage, AUTHORS, (char const *) NULL); + parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, + usage, AUTHORS, (char const *) NULL); + + /* The above handles --help and --version. + Since there is no other invocation of getopt, handle `--' here. */ + if (1 < argc && STREQ (argv[1], "--")) + { + --argc; + ++argv; + } if (argc == 1) { |