X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fargmatch.c;h=f180f1a262fec9e0aab150f32409a5d05d77bfeb;hb=a19e601b42a86b59b4af13aa9f960397f5306c38;hp=aa5593329765506faf3a4f67c52f1d5fff2c8f54;hpb=56a7a6715289da1dc2714ed125054ae68b828fb8;p=gnulib.git diff --git a/lib/argmatch.c b/lib/argmatch.c index aa5593329..f180f1a26 100644 --- a/lib/argmatch.c +++ b/lib/argmatch.c @@ -39,9 +39,7 @@ or -2 if it is ambiguous (is a prefix of more than one element). */ int -argmatch (arg, optlist) - const char *arg; - const char *const *optlist; +argmatch (const char *arg, const char *const *optlist) { int i; /* Temporary index in OPTLIST. */ size_t arglen; /* Length of ARG. */ @@ -78,15 +76,10 @@ argmatch (arg, optlist) PROBLEM is the return value from argmatch. */ void -invalid_arg (kind, value, problem) - const char *kind; - const char *value; - int problem; +invalid_arg (const char *kind, const char *value, int problem) { - fprintf (stderr, "%s: ", program_name); - if (problem == -1) - fprintf (stderr, "invalid"); - else /* Assume -2. */ - fprintf (stderr, "ambiguous"); - fprintf (stderr, " %s `%s'\n", kind, value); + const char *fmt = (problem == -1 + ? "%s: invalid %s `%s'\n" + : "%s: ambiguous %s `%s'\n"); + fprintf (stderr, fmt, program_name, kind, value); }