summaryrefslogtreecommitdiff
path: root/lib/argmatch.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1999-08-10 11:00:12 +0000
committerJim Meyering <jim@meyering.net>1999-08-10 11:00:12 +0000
commit843d60096ea8b35e0395c03788408582375dbd5b (patch)
treea5dc255158d06565fa3f0cf1ed36976d56d23a24 /lib/argmatch.c
parentbcfbd6fab13f02ff136d7695facf7c6033a041c3 (diff)
downloadcoreutils-843d60096ea8b35e0395c03788408582375dbd5b.tar.xz
(ARGMATCH_QUOTING_STYLE):
Change from escape_quoting_style to locale_quoting_style. (argmatch_invalid): Use new quotearg_style primitive for simplicity. Also, use ARGMATCH_QUOTING_STYLE to quote, instead of quoting ourselves.
Diffstat (limited to 'lib/argmatch.c')
-rw-r--r--lib/argmatch.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/lib/argmatch.c b/lib/argmatch.c
index f08fba35e..964270650 100644
--- a/lib/argmatch.c
+++ b/lib/argmatch.c
@@ -43,7 +43,7 @@
by using the quoting style ARGMATCH_QUOTING_STYLE. Do not use
literal_quoting_style. */
#ifndef ARGMATCH_QUOTING_STYLE
-# define ARGMATCH_QUOTING_STYLE escape_quoting_style
+# define ARGMATCH_QUOTING_STYLE locale_quoting_style
#endif
/* The following test is to work around the gross typo in
@@ -155,21 +155,11 @@ argcasematch (const char *arg, const char *const *arglist,
void
argmatch_invalid (const char *context, const char *value, int problem)
{
- enum quoting_style saved_quoting_style;
- char const *format;
+ char const *format = (problem == -1
+ ? _("invalid argument %s for `%s'")
+ : _("ambiguous argument %s for `%s'"));
- /* Make sure to have a good quoting style to report errors.
- literal is insane here. */
- saved_quoting_style = get_quoting_style (NULL);
- set_quoting_style (NULL, ARGMATCH_QUOTING_STYLE);
-
- format = (problem == -1
- ? _("invalid argument `%s' for `%s'")
- : _("ambiguous argument `%s' for `%s'"));
-
- error (0, 0, format, quotearg (value), context);
-
- set_quoting_style (NULL, saved_quoting_style);
+ error (0, 0, format, quotearg_style (ARGMATCH_QUOTING_STYLE, value), context);
}
/* List the valid arguments for argmatch.