+Mon Oct 18 00:13:40 1993 Jim Meyering (meyering@comco.com)
+
+ * src/*.c (usage): Now the usage message is simply
+ "Try `%s --help' for more information. From Francois Pinard.
+
+ * src/Makefile.in [LIBPROGS]: Depend on ../lib/libfu.a and version.o.
+
+ * src/*.c (usage): Remove blank line before "Try `%s --help..."
+ in usage message.
+
Sun Oct 17 00:19:58 1993 Jim Meyering (meyering@comco.com)
* fileblocks.c [!NINDIR]: Define BSIZE only if it's not already
Major changes in release 3.9:
-* --help gives one-line description of each option and shows correspondence
- between short and long-named options.
+* --help gives a one-line description of each option and shows the
+ correspondence between short and long-named options.
+* work around systems with BROKEN_STAT_MACROS
+* work around problem where $(srcdir)/config.h was used instead of
+ ../config.h -- this happened only when building in a subdirectory
+ and when config.h remained in $(srcdir) from a previous ./configure.
* GNU chmod treats symlinks the same way other vendor's versions do.
Now symlinks listed on the command line are processed (they were
ignored before); the permissions of the dereferenced files are
usage (status)
int status;
{
- fprintf (status == 0 ? stdout : stderr, "\
-Usage: %s [OPTION]... GROUP FILE...\n\
-",
- program_name);
-
- if (status == 0)
- printf ("\
+ if (status != 0)
+ fprintf (stderr, "Try `%s --help' for more information.\n",
+ program_name);
+ else
+ {
+ printf ("Usage: %s [OPTION]... GROUP FILE...\n", program_name);
+ printf ("\
\n\
-c, --changes like verbose but report only when a change is made\n\
-f, --silent, --quiet suppress most error messages\n\
-R, --recursive change files and directories recursively\n\
--help display this help and exit\n\
--version output version information and exit\n");
-
- else
- fprintf (stderr, "Try `%s --help' for more information.\n",
- program_name);
-
+ }
exit (status);
}
usage (status)
int status;
{
- fprintf (status == 0 ? stdout : stderr, "\
+ if (status != 0)
+ fprintf (stderr, "Try `%s --help' for more information.\n",
+ program_name);
+ else
+ {
+ printf ("\
Usage: %s [OPTION]... MODE[,MODE]... FILE...\n\
or: %s [OPTION]... OCTAL_MODE FILE...\n\
",
- program_name, program_name);
-
- if (status == 0)
- printf ("\
+ program_name, program_name);
+ printf ("\
\n\
-c, --changes like verbose but report only when a change is made\n\
-f, --silent, --quiet suppress most error messages\n\
\n\
Each MODE is one or more of the letters ugoa, one of the symbols +-= and\n\
one or more of the letters rwxXstugo.\n");
-
- else
- fprintf (stderr, "Try `%s --help' for more information.\n",
- program_name);
-
+ }
exit (status);
}
usage (status)
int status;
{
- fprintf (status == 0 ? stdout : stderr, "\
+ if (status != 0)
+ fprintf (stderr, "Try `%s --help' for more information.\n",
+ program_name);
+ else
+ {
+ printf ("\
Usage: %s [OPTION]... OWNER[.[GROUP]] FILE...\n\
or: %s [OPTION]... .[GROUP] FILE...\n\
",
- program_name, program_name);
-
- if (status == 0)
- printf ("\
+ program_name, program_name);
+ printf ("\
\n\
-c, --changes be verbose whenever change occurs\n\
-f, --silent, --quiet suppress most error messages\n\
\n\
Owner is unchanged if missing. Group is unchanged if missing, but changed\n\
to login group if implied by a period. A colon may replace the period.\n");
-
- else
- fprintf (stderr, "Try `%s --help' for more information.\n",
- program_name);
-
+ }
exit (status);
}
break;
default:
- usage ((char *) 0, 2);
+ usage (2, (char *) 0);
}
}
}
if (show_help)
- usage (NULL, 0);
+ usage (0, NULL);
if (flag_hard_link && flag_symbolic_link)
- usage ("cannot make both hard and symbolic links", 2);
+ usage (2, "cannot make both hard and symbolic links");
if (make_backups)
backup_type = get_version (version);
int ret = 0;
if (optind >= argc)
- usage ("missing file arguments", 2);
+ usage (2, "missing file arguments");
if (optind >= argc - 1)
- usage ("missing file argument", 2);
+ usage (2, "missing file argument");
dest = argv[argc - 1];
struct stat source_stats;
if (flag_path)
- usage ("when preserving paths, last argument must be a directory", 2);
+ usage (2, "when preserving paths, last argument must be a directory");
source = argv[optind];
return copy (source, new_dest, new_dst, 0, (struct dir_list *) 0);
}
else
- usage ("when copying multiple files, last argument must be a directory",
- 2);
+ usage (2,
+ "when copying multiple files, last argument must be a directory");
}
\f
/* Copy the file SRC_PATH to the file DST_PATH. The files may be of
usage (status)
int status;
{
- fprintf (status == 0 ? stdout : stderr, "\
-Usage: %s [OPTION]...\n\
-",
- program_name);
-
- if (status == 0)
- printf ("\
+ if (status != 0)
+ fprintf (stderr, "Try `%s --help' for more information.\n",
+ program_name);
+ else
+ {
+ printf ("Usage: %s [OPTION]...\n", program_name);
+ printf ("\
\n\
bs=BYTES force ibs=BYTES and obs=BYTES\n\
cbs=BYTES convert BYTES bytes at a time\n\
swab swap every pair of input bytes\n\
noerror continue after read errors\n\
sync pad every input block with NULs to ibs-size\n");
-
- else
- fprintf (stderr, "Try `%s --help' for more information.\n",
- program_name);
-
+ }
exit (status);
}
usage (status)
int status;
{
- fprintf (status == 0 ? stdout : stderr, "\
-Usage: %s [OPTION] [PATH]...\n\
-",
- program_name);
-
- if (status == 0)
- printf ("\
+ if (status != 0)
+ fprintf (stderr, "Try `%s --help' for more information.\n",
+ program_name);
+ else
+ {
+ printf ("Usage: %s [OPTION] [PATH]...\n", program_name);
+ printf ("\
\n\
-a, --all include filesystems having 0 blocks\n\
-i, --inodes list inode information instead of block usage\n\
--version output version information and exit\n\
\n\
If no PATHs are given, list all currently mounted filesystems.\n");
-
- else
- fprintf (stderr, "Try `%s --help' for more information.\n",
- program_name);
-
+ }
exit (status);
}
};
static void
-usage (reason, status)
- char *reason;
+usage (status, reason)
int status;
+ char *reason;
{
if (reason != NULL)
fprintf (status == 0 ? stdout : stderr, "%s: %s\n",
program_name, reason);
- fprintf (status == 0 ? stdout : stderr, "\
-Usage: %s [OPTION]... [PATH]...\n\
-",
- program_name);
-
- if (status == 0)
- printf ("\
+ if (status != 0)
+ fprintf (stderr, "Try `%s --help' for more information.\n",
+ program_name);
+ else
+ {
+ printf ("Usage: %s [OPTION]... [PATH]...\n", program_name);
+ printf ("\
\n\
-a, --all write counts for all files, not just directories\n\
-b, --bytes print size in bytes\n\
-S, --separate-dirs do not include size of subdirectories\n\
--help display this help and exit\n\
--version output version information and exit\n");
-
- else
- fprintf (stderr, "Try `%s --help' for more information.\n",
- program_name);
-
+ }
exit (status);
}
\f
break;
default:
- usage ((char *) 0, 2);
+ usage (2, (char *) 0);
}
}
}
if (show_help)
- usage (NULL, 0);
+ usage (0, NULL);
if (opt_all && opt_summarize_only)
- usage ("cannot both summarize and show all entries", 2);
+ usage (2, "cannot both summarize and show all entries");
/* Initialize the hash structure for inode numbers. */
hash_init (INITIAL_HASH_MODULE, INITIAL_ENTRY_TAB_SIZE);
usage (status)
int status;
{
- fprintf (status == 0 ? stdout : stderr, "\
+ if (status != 0)
+ fprintf (stderr, "Try `%s --help' for more information.\n",
+ program_name);
+ else
+ {
+ printf ("\
Usage: %s [OPTION]... SOURCE DEST (1st format)\n\
or: %s [OPTION]... SOURCE... DIRECTORY (2nd format)\n\
or: %s [OPTION]... DIRECTORY... (3nd format)\n\
",
- program_name, program_name, program_name);
-
- if (status == 0)
- printf ("\
+ program_name, program_name, program_name);
+ printf ("\
\n\
-c (ignored)\n\
-d, --directory create [leading] directories, mandatory for 3rd format\n\
-s, --strip strip symbol tables, only for 1st and 2nd formats\n\
--help display this help and exit\n\
--version output version information and exit\n");
-
- else
- fprintf (stderr, "Try `%s --help' for more information.\n",
- program_name);
-
+ }
exit (status);
}
usage (status)
int status;
{
- fprintf (status == 0 ? stdout : stderr, "\
+ if (status != 0)
+ fprintf (stderr, "Try `%s --help' for more information.\n",
+ program_name);
+ else
+ {
+ printf ("\
Usage: %s [OPTION]... SOURCE [DEST]\n\
or: %s [OPTION]... SOURCE... DIRECTORY\n\
",
- program_name, program_name);
-
- if (status == 0)
- printf ("\
+ program_name, program_name);
+ printf ("\
\n\
-b, --backup make backups for removed files\n\
-d, -F, --directory hard link directories (super-user only)\n\
\n\
t, numbered make numbered backups\n\
nil, existing numbered if numbered backups exist, simple otherwise\n\
- never, simple always make simple backups \n");
-
- else
- fprintf (stderr, "Try `%s --help' for more information.\n",
- program_name);
-
+ never, simple always make simple backups\n");
+ }
exit (status);
}
usage (status)
int status;
{
- fprintf (status == 0 ? stdout : stderr, "\
-Usage: %s [OPTION]... [PATH]...\n\
-",
- program_name);
-
- if (status == 0)
+ if (status != 0)
+ fprintf (stderr, "Try `%s --help' for more information.\n",
+ program_name);
+ else
{
+ printf ("Usage: %s [OPTION]... [PATH]...\n", program_name);
printf ("\
\n\
-a, --all do not hide entries starting with .\n\
Sort entries alphabetically if none of -cftuSUX nor --sort.\n");
}
- else
- fprintf (stderr, "Try `%s --help' for more information.\n",
- program_name);
-
exit (status);
}
usage (status)
int status;
{
- fprintf (status == 0 ? stdout : stderr, "\
-Usage: %s [OPTION] DIRECTORY...\n\
-",
- program_name);
-
- if (status == 0)
- printf ("\
+ if (status != 0)
+ fprintf (stderr, "Try `%s --help' for more information.\n",
+ program_name);
+ else
+ {
+ printf ("Usage: %s [OPTION] DIRECTORY...\n", program_name);
+ printf ("\
\n\
-p, --parents no error if existing, make parent directories as needed\n\
-m, --mode MODE set permission mode (as in chmod), not 0777 - umask\n\
--help display this help and exit\n\
--version output version information and exit\n");
-
- else
- fprintf (stderr, "Try `%s --help' for more information.\n",
- program_name);
-
+ }
exit (status);
}
usage (status)
int status;
{
- fprintf (status == 0 ? stdout : stderr, "\
-Usage: %s [OPTION] PATH...\n\
-",
- program_name);
-
- if (status == 0)
- printf ("\
+ if (status != 0)
+ fprintf (stderr, "Try `%s --help' for more information.\n",
+ program_name);
+ else
+ {
+ printf ("Usage: %s [OPTION] PATH...\n", program_name);
+ printf ("\
\n\
-m, --mode MODE set permission mode (as in chmod), not 0666 - umask\n\
--help display this help and exit\n\
--version output version information and exit\n");
-
- else
- fprintf (stderr, "Try `%s --help' for more information.\n",
- program_name);
-
+ }
exit (status);
}
#endif
usage (status)
int status;
{
- fprintf (status == 0 ? stdout : stderr, "\
-Usage: %s [OPTION]... PATH TYPE [MAJOR MINOR]\n\
-",
- program_name);
-
- if (status == 0)
- printf ("\
+ if (status != 0)
+ fprintf (stderr, "Try `%s --help' for more information.\n",
+ program_name);
+ else
+ {
+ printf ("Usage: %s [OPTION]... PATH TYPE [MAJOR MINOR]\n", program_name);
+ printf ("\
\n\
-m, --mode MODE set permission mode (as in chmod), not 0666 - umask\n\
--help display this help and exit\n\
b create a block (buffered) special file\n\
c, u create a character (unbuffered) special file \n\
p create a FIFO\n");
-
- else
- fprintf (stderr, "Try `%s --help' for more information.\n",
- program_name);
-
+ }
exit (status);
}
usage (status)
int status;
{
- fprintf (status == 0 ? stdout : stderr, "\
+ if (status != 0)
+ fprintf (stderr, "Try `%s --help' for more information.\n",
+ program_name);
+ else
+ {
+ printf ("\
Usage: %s [OPTION]... SOURCE DEST\n\
or: %s [OPTION]... SOURCE... DIRECTORY\n\
",
- program_name, program_name);
-
- if (status == 0)
- printf ("\
+ program_name, program_name);
+ printf ("\
\n\
-b, --backup make backup before removal\n\
-f, --force remove existing destinations, never prompt\n\
t, numbered make numbered backups\n\
nil, existing numbered if numbered backups exist, simple otherwise\n\
never, simple always make simple backups \n");
-
- else
- fprintf (stderr, "Try `%s --help' for more information.\n",
- program_name);
-
+ }
exit (status);
}
usage (status)
int status;
{
- fprintf (status == 0 ? stdout : stderr, "\
-Usage: %s [OPTION]... PATH...\n\
-",
- program_name);
-
- if (status == 0)
- printf ("\
+ if (status != 0)
+ fprintf (stderr, "Try `%s --help' for more information.\n",
+ program_name);
+ else
+ {
+ printf ("Usage: %s [OPTION]... PATH...\n", program_name);
+ printf ("\
\n\
-d, --directory unlink directory, even if non-empty (super-user only)\n\
-f, --force ignore nonexistent files, never prompt\n\
-r, -R, --recursive remove the contents of directories recursively\n\
--help display this help and exit\n\
--version output version information and exit\n");
-
- else
- fprintf (stderr, "Try `%s --help' for more information.\n",
- program_name);
-
+ }
exit (status);
}
usage (status)
int status;
{
- fprintf (status == 0 ? stdout : stderr, "\
-Usage: %s [OPTION]... DIRECTORY...\n\
-",
- program_name);
-
- if (status == 0)
- printf ("\
+ if (status != 0)
+ fprintf (stderr, "Try `%s --help' for more information.\n",
+ program_name);
+ else
+ {
+ printf ("Usage: %s [OPTION]... DIRECTORY...\n", program_name);
+ printf ("\
\n\
-p, --parents remove explicit parent directories if being emptied\n\
--help display this help and exit\n\
--version output version information and exit\n");
-
- else
- fprintf (stderr, "Try `%s --help' for more information.\n",
- program_name);
-
+ }
exit (status);
}
usage (status)
int status;
{
- fprintf (status == 0 ? stdout : stderr, "\
-Usage: %s [OPTION]... FILE...\n\
-",
- program_name);
-
- if (status == 0)
- printf ("\
+ if (status != 0)
+ fprintf (stderr, "Try `%s --help' for more information.\n",
+ program_name);
+ else
+ {
+ printf ("Usage: %s [OPTION]... FILE...\n", program_name);
+ printf ("\
\n\
-a change only the access time\n\
-c do not create any files\n\
--version output version information and exit\n\
\n\
STAMP may be used without -t if none of -drt, nor --, are used.\n");
-
- else
- fprintf (stderr, "Try `%s --help' for more information.\n",
- program_name);
-
+ }
exit (status);
}