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:
14
src/chmod.c
14
src/chmod.c
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user