summaryrefslogtreecommitdiffstats
path: root/misc-utils
diff options
context:
space:
mode:
authorKarel Zak2013-05-28 15:27:22 +0200
committerKarel Zak2013-05-28 15:27:22 +0200
commit201b39f0019ae0fab34459bf6ec8b86773fb0b72 (patch)
treefe19dd6a46d85acf69873428fa7afdef6e5b3bee /misc-utils
parentMerge branch 'cal-fourth' of git://github.com/kerolasa/lelux-utiliteetit (diff)
downloadkernel-qcow2-util-linux-201b39f0019ae0fab34459bf6ec8b86773fb0b72.tar.gz
kernel-qcow2-util-linux-201b39f0019ae0fab34459bf6ec8b86773fb0b72.tar.xz
kernel-qcow2-util-linux-201b39f0019ae0fab34459bf6ec8b86773fb0b72.zip
cal: simplify colormode parsing
Signed-off-by: Karel Zak <kzak@redhat.com>
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 0142fd0ec..c7c2fee7e 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);