summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2005-06-30 16:47:00 +0000
committerJim Meyering <jim@meyering.net>2005-06-30 16:47:00 +0000
commit779a89cdb444cf4426eb31ab3d63b2575b29431f (patch)
tree01064c3b5bacb8c1583af5f5d86e8ba73418c4a1 /src
parentf2daebf810ff4ee99fb3a2b03cce44e464944234 (diff)
downloadcoreutils-779a89cdb444cf4426eb31ab3d63b2575b29431f.tar.xz
Add uses of ARGMATCH_VERIFY to ensure that
corresponding option string and value arrays are consistent. Remove a harmless trailing `, 0' from a value list.
Diffstat (limited to 'src')
-rw-r--r--src/cp.c6
-rw-r--r--src/du.c5
2 files changed, 6 insertions, 5 deletions
diff --git a/src/cp.c b/src/cp.c
index d413bf5ee..a2810c30c 100644
--- a/src/cp.c
+++ b/src/cp.c
@@ -94,23 +94,23 @@ static char const *const sparse_type_string[] =
{
"never", "auto", "always", NULL
};
-
static enum Sparse_type const sparse_type[] =
{
SPARSE_NEVER, SPARSE_AUTO, SPARSE_ALWAYS
};
+ARGMATCH_VERIFY (sparse_type_string, sparse_type);
/* Valid arguments to the `--reply' option. */
static char const* const reply_args[] =
{
"yes", "no", "query", NULL
};
-
/* The values that correspond to the above strings. */
static int const reply_vals[] =
{
I_ALWAYS_YES, I_ALWAYS_NO, I_ASK_USER
};
+ARGMATCH_VERIFY (reply_args, reply_vals);
static struct option const long_opts[] =
{
@@ -729,13 +729,13 @@ decode_preserve_arg (char const *arg, struct cp_options *x, bool on_off)
PRESERVE_MODE, PRESERVE_TIMESTAMPS,
PRESERVE_OWNERSHIP, PRESERVE_LINK, PRESERVE_ALL
};
-
/* Valid arguments to the `--preserve' option. */
static char const* const preserve_args[] =
{
"mode", "timestamps",
"ownership", "links", "all", NULL
};
+ ARGMATCH_VERIFY (preserve_args, preserve_vals);
char *arg_writable = xstrdup (arg);
char *s = arg_writable;
diff --git a/src/du.c b/src/du.c
index b6fc5add9..bd6aeba34 100644
--- a/src/du.c
+++ b/src/du.c
@@ -245,6 +245,7 @@ static enum time_type const time_types[] =
{
time_atime, time_atime, time_atime, time_ctime, time_ctime
};
+ARGMATCH_VERIFY (time_args, time_types);
/* `full-iso' uses full ISO-style dates and times. `long-iso' uses longer
ISO-style time stamps, though shorter than `full-iso'. `iso' uses shorter
@@ -260,11 +261,11 @@ static char const *const time_style_args[] =
{
"full-iso", "long-iso", "iso", NULL
};
-
static enum time_style const time_style_types[] =
{
- full_iso_time_style, long_iso_time_style, iso_time_style, 0
+ full_iso_time_style, long_iso_time_style, iso_time_style
};
+ARGMATCH_VERIFY (time_style_args, time_style_types);
void
usage (int status)