diff options
author | Karel Zak <kzak@redhat.com> | 2013-05-28 15:27:22 +0200 |
---|---|---|
committer | Karel Zak <kzak@redhat.com> | 2013-05-28 15:27:22 +0200 |
commit | 201b39f0019ae0fab34459bf6ec8b86773fb0b72 (patch) | |
tree | fe19dd6a46d85acf69873428fa7afdef6e5b3bee /misc-utils | |
parent | b947210258580d06242283d25f28d3a0b2100b9c (diff) | |
download | util-linux-201b39f0019ae0fab34459bf6ec8b86773fb0b72.tar.gz |
cal: simplify colormode parsing
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'misc-utils')
-rw-r--r-- | misc-utils/cal.c | 9 |
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); |