]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
dmesg: mark some options mutually exclusive
authorKarel Zak <kzak@redhat.com>
Wed, 20 Jul 2011 13:50:34 +0000 (15:50 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 20 Jul 2011 13:50:34 +0000 (15:50 +0200)
Reported-by: "Voelker, Bernhard" <bernhard.voelker@siemens-enterprise.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/dmesg.c

index b71097dc126cd2fc6ca2d25420587f1cf4938475..2be34075ab360485d354155ef2fb423df0fbd5eb 100644 (file)
@@ -650,9 +650,9 @@ int main(int argc, char *argv[])
                                longopts, NULL)) != -1) {
 
                if (cmd != -1 && strchr("CcnDE", c))
-                       errx(EXIT_FAILURE, "%s %s",
-                               "--{clear,read-clear,console-level,console-on,console-off}",
-                               _("options are mutually exclusive"));
+                       errx(EXIT_FAILURE, _("clear, read-clear, console-level, "
+                            "console-on, and console-off options are mutually "
+                            "exclusive"));
 
                switch (c) {
                case 'C':
@@ -733,8 +733,14 @@ int main(int argc, char *argv[])
        if (cmd == -1)
                cmd = SYSLOG_ACTION_READ_ALL;   /* default */
 
-       if (ctl.raw && (ctl.fltr_lev || ctl.fltr_fac))
-               errx(EXIT_FAILURE, _("options --level and --facility cannot be used for raw output"));
+       if (ctl.raw && (ctl.fltr_lev || ctl.fltr_fac || ctl.delta ||
+                       ctl.notime || ctl.ctime || ctl.decode))
+               errx(EXIT_FAILURE, _("--raw can't be used together with level, "
+                    "facility, decode, delta, ctime or notime options"));
+
+       if (ctl.notime && (ctl.ctime || ctl.delta))
+               errx(EXIT_FAILURE, _("--notime can't be used together with ctime "
+                    "or delta options"));
 
        switch (cmd) {
        case SYSLOG_ACTION_READ_ALL: