case 'L':
colormode = UL_COLORMODE_AUTO;
if (optarg)
- colormode = colormode_or_err(optarg,
- _("unsupported color mode"));
+ colormode = colormode_or_err(optarg);
break;
case 'r':
read_only = 1;
case 'L':
colormode = UL_COLORMODE_AUTO;
if (optarg)
- colormode = colormode_or_err(optarg,
- _("unsupported color mode"));
+ colormode = colormode_or_err(optarg);
break;
case 'n':
noauto_pt = 1;
case OPT_COLOR:
colormode = UL_COLORMODE_AUTO;
if (optarg)
- colormode = colormode_or_err(optarg,
- _("unsupported color mode"));
+ colormode = colormode_or_err(optarg);
break;
case OPT_MOVEDATA:
sf->movedata = 1;
#endif
extern int colormode_from_string(const char *str);
-extern int colormode_or_err(const char *str, const char *errmsg);
+extern int colormode_or_err(const char *str);
/* Initialize the global variable UL_COLOR_TERM_OK */
extern int colors_init(int mode, const char *util_name);
#include "c.h"
#include "cctype.h"
#include "colors.h"
+#include "nls.h"
#include "pathnames.h"
#include "strutils.h"
/*
* Parses @str and exit(EXIT_FAILURE) on error
*/
-int colormode_or_err(const char *str, const char *errmsg)
+int colormode_or_err(const char *str)
{
const char *p = str && *str == '=' ? str + 1 : str;
int colormode;
colormode = colormode_from_string(p);
if (colormode < 0)
- errx(EXIT_FAILURE, "%s: '%s'", errmsg, p);
+ errx(EXIT_FAILURE, _("unsupported color mode: %s"), p);
return colormode;
}
color_scheme = optarg;
break;
case 'm':
- mode = colormode_or_err(optarg, "unsupported color mode");
+ mode = colormode_or_err(optarg);
break;
case 'n':
name = optarg;
case OPT_COLOR:
ctl.colormode = UL_COLORMODE_AUTO;
if (optarg)
- ctl.colormode = colormode_or_err(optarg,
- _("unsupported color mode"));
+ ctl.colormode = colormode_or_err(optarg);
break;
case OPT_REFORM:
ctl.reform_year = parse_reform_year(optarg);
case 'L':
colormode = UL_COLORMODE_AUTO;
if (optarg)
- colormode = colormode_or_err(optarg,
- _("unsupported color mode"));
+ colormode = colormode_or_err(optarg);
break;
case 'l':
ctl.fltr_lev= 1;
case 'L':
colormode = UL_COLORMODE_AUTO;
if (optarg)
- colormode = colormode_or_err(optarg,
- _("unsupported color mode"));
+ colormode = colormode_or_err(optarg);
break;
case 'n':
hex->length = strtosize_or_err(optarg, _("failed to parse length"));