summaryrefslogtreecommitdiff
path: root/misc-utils
diff options
context:
space:
mode:
Diffstat (limited to 'misc-utils')
-rw-r--r--misc-utils/cal.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/misc-utils/cal.c b/misc-utils/cal.c
index 0142fd0e..c7c2fee7 100644
--- a/misc-utils/cal.c
+++ b/misc-utils/cal.c
@@ -346,12 +346,9 @@ main(int argc, char **argv) {
yflag = 1;
break;
case OPT_COLOR:
- if (optarg) {
- char *p = *optarg == '=' ? optarg + 1 : optarg;
- colormode = colormode_from_string(p);
- if (colormode < 0)
- errx(EXIT_FAILURE, _("unsupported color mode: '%s'"), p);
- }
+ if (optarg)
+ colormode = colormode_or_err(optarg,
+ _("unsupported color mode"));
break;
case 'V':
printf(UTIL_LINUX_VERSION);