tail --bytes=NUM will efficiently seek to the end of block devices,
rather than reading from the start.
+ Utilities which do not support long options (other than the default --help
+ and --version), e.g. cksum and sleep, now use more consistent error diagnostic
+ for unknown long options.
+
** Build-related
Default man pages are now distributed which are used if perl is
# include "die.h"
# include "error.h"
+static struct option const long_options[] =
+{
+ {NULL, 0, NULL, 0}
+};
+
/* Number of bytes to read at once. */
# define BUFLEN (1 << 16)
parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE, Version,
usage, AUTHORS, (char const *) NULL);
- if (getopt_long (argc, argv, "", NULL, NULL) != -1)
+ if (getopt_long (argc, argv, "", long_options, NULL) != -1)
usage (EXIT_FAILURE);
have_read_stdin = false;
proper_name ("David MacKenzie"), \
proper_name ("Stuart Kemp")
+static struct option const long_options[] =
+{
+ {NULL, 0, NULL, 0}
+};
+
/* Use SA_NOCLDSTOP as a proxy for whether the sigaction machinery is
present. */
#ifndef SA_NOCLDSTOP
usage, AUTHORS, (char const *) NULL);
close_stdout_required = false;
- if (getopt_long (argc, argv, "", NULL, NULL) != -1)
+ if (getopt_long (argc, argv, "", long_options, NULL) != -1)
usage (EXIT_FAILURE);
/* Initialize translation table to identity translation. */
#define AUTHORS proper_name ("Jim Meyering")
+static struct option const long_options[] =
+{
+ {NULL, 0, NULL, 0}
+};
+
void
usage (int status)
{
parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE_NAME, Version,
usage, AUTHORS, (char const *) NULL);
- if (getopt_long (argc, argv, "", NULL, NULL) != -1)
+ if (getopt_long (argc, argv, "", long_options, NULL) != -1)
usage (EXIT_FAILURE);
if (optind < argc)
#define AUTHORS proper_name ("Jim Meyering")
+static struct option const long_options[] =
+{
+ {NULL, 0, NULL, 0}
+};
+
#if !defined HAVE_SETHOSTNAME && defined HAVE_SYSINFO && \
defined HAVE_SYS_SYSTEMINFO_H
# include <sys/systeminfo.h>
parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE_NAME, Version,
usage, AUTHORS, (char const *) NULL);
- if (getopt_long (argc, argv, "", NULL, NULL) != -1)
+ if (getopt_long (argc, argv, "", long_options, NULL) != -1)
usage (EXIT_FAILURE);
if (argc == optind + 1)
#define AUTHORS proper_name ("Michael Stone")
+static struct option const long_options[] =
+{
+ {NULL, 0, NULL, 0}
+};
+
void
usage (int status)
{
parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE_NAME, Version,
usage, AUTHORS, (char const *) NULL);
- if (getopt_long (argc, argv, "", NULL, NULL) != -1)
+ if (getopt_long (argc, argv, "", long_options, NULL) != -1)
usage (EXIT_FAILURE);
if (argc < optind + 2)
#define AUTHORS proper_name ("FIXME: unknown")
+static struct option const long_options[] =
+{
+ {NULL, 0, NULL, 0}
+};
+
void
usage (int status)
{
parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE_NAME, Version,
usage, AUTHORS, (char const *) NULL);
- if (getopt_long (argc, argv, "", NULL, NULL) != -1)
+ if (getopt_long (argc, argv, "", long_options, NULL) != -1)
usage (EXIT_FAILURE);
if (optind < argc)
#define AUTHORS proper_name ("Jim Meyering")
+static struct option const long_options[] =
+{
+ {NULL, 0, NULL, 0}
+};
+
/* Exit statuses. */
enum
{
parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE_NAME, Version,
usage, AUTHORS, (char const *) NULL);
- if (getopt_long (argc, argv, "+", NULL, NULL) != -1)
+ if (getopt_long (argc, argv, "+", long_options, NULL) != -1)
usage (exit_internal_failure);
if (argc <= optind)
proper_name ("Jim Meyering"), \
proper_name ("Paul Eggert")
+static struct option const long_options[] =
+{
+ {NULL, 0, NULL, 0}
+};
+
void
usage (int status)
{
parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE_NAME, Version,
usage, AUTHORS, (char const *) NULL);
- if (getopt_long (argc, argv, "", NULL, NULL) != -1)
+ if (getopt_long (argc, argv, "", long_options, NULL) != -1)
usage (EXIT_FAILURE);
if (argc == 1)
#define AUTHORS proper_name ("Mark Kettenis")
+static struct option const long_options[] =
+{
+ {NULL, 0, NULL, 0}
+};
+
/* Token delimiters when reading from a file. */
#define DELIM " \t\n"
parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE, Version,
usage, AUTHORS, (char const *) NULL);
- if (getopt_long (argc, argv, "", NULL, NULL) != -1)
+ if (getopt_long (argc, argv, "", long_options, NULL) != -1)
usage (EXIT_FAILURE);
if (1 < argc - optind)
#define AUTHORS proper_name ("Michael Stone")
+static struct option const long_options[] =
+{
+ {NULL, 0, NULL, 0}
+};
+
void
usage (int status)
{
parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE_NAME, Version,
usage, AUTHORS, (char const *) NULL);
- if (getopt_long (argc, argv, "", NULL, NULL) != -1)
+ if (getopt_long (argc, argv, "", long_options, NULL) != -1)
usage (EXIT_FAILURE);
if (argc < optind + 1)
proper_name ("David MacKenzie"), \
proper_name ("Kaveh Ghazi")
+static struct option const long_options[] =
+{
+ {NULL, 0, NULL, 0}
+};
+
static void
print_uptime (size_t n, const STRUCT_UTMP *this)
{
parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE_NAME, Version,
usage, AUTHORS, (char const *) NULL);
- if (getopt_long (argc, argv, "", NULL, NULL) != -1)
+ if (getopt_long (argc, argv, "", long_options, NULL) != -1)
usage (EXIT_FAILURE);
switch (argc - optind)
proper_name ("Joseph Arceneaux"), \
proper_name ("David MacKenzie")
+static struct option const long_options[] =
+{
+ {NULL, 0, NULL, 0}
+};
+
static int
userid_compare (const void *v_a, const void *v_b)
{
parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE_NAME, Version,
usage, AUTHORS, (char const *) NULL);
- if (getopt_long (argc, argv, "", NULL, NULL) != -1)
+ if (getopt_long (argc, argv, "", long_options, NULL) != -1)
usage (EXIT_FAILURE);
switch (argc - optind)
#define AUTHORS proper_name ("Richard Mlynarik")
+static struct option const long_options[] =
+{
+ {NULL, 0, NULL, 0}
+};
+
void
usage (int status)
{
parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE_NAME, Version,
usage, AUTHORS, (char const *) NULL);
- if (getopt_long (argc, argv, "", NULL, NULL) != -1)
+ if (getopt_long (argc, argv, "", long_options, NULL) != -1)
usage (EXIT_FAILURE);
if (optind != argc)
#define AUTHORS proper_name ("David MacKenzie")
+static struct option const long_options[] =
+{
+ {NULL, 0, NULL, 0}
+};
+
void
usage (int status)
{
parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE_NAME, Version,
usage, AUTHORS, (char const *) NULL);
- if (getopt_long (argc, argv, "+", NULL, NULL) != -1)
+ if (getopt_long (argc, argv, "+", long_options, NULL) != -1)
usage (EXIT_FAILURE);
char **operands = argv + optind;