1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-04-21 03:12:48 +02:00

(usage): Mention --help and --version.

(main): Handle flag_help and flag_version before checking for invocation errors.
This commit is contained in:
Jim Meyering
1993-04-04 14:41:38 +00:00
parent dc932e0a18
commit a92a94f719
17 changed files with 63 additions and 55 deletions

View File

@@ -140,17 +140,18 @@ main (argc, argv)
}
}
if (modeind == 0)
modeind = optind++;
if (optind >= argc)
usage ();
if (flag_version)
fprintf (stderr, "%s\n", version_string);
if (flag_help)
usage ();
if (modeind == 0)
modeind = optind++;
if (optind >= argc)
usage ();
changes = mode_compile (argv[modeind],
MODE_MASK_EQUALS | MODE_MASK_PLUS | MODE_MASK_MINUS);
if (changes == MODE_INVALID)
@@ -288,7 +289,8 @@ static void
usage ()
{
fprintf (stderr, "\
Usage: %s [-Rcfv] mode file...\n\
Usage: %s [-Rcfv] [--recursive] [--changes] [--silent] [--quiet]\n\
[--verbose] [--help] [--version] mode file...\n\
mode is [ugoa...][[+-=][rwxXstugo...]...][,...] or octal number\n",
program_name);
exit (1);