1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-04-20 18:56:39 +02:00

(main): Handle leading command line argument of `--'.

This commit is contained in:
Jim Meyering
2002-09-13 09:50:23 +00:00
parent b4994d29a1
commit 5bd4fe2400

View File

@@ -545,6 +545,14 @@ main (int argc, char **argv)
parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION,
AUTHORS, usage);
/* 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)
{
fprintf (stderr, _("Usage: %s format [argument...]\n"), program_name);