dmesg: mark some options mutually exclusive

Reported-by: "Voelker, Bernhard" <bernhard.voelker@siemens-enterprise.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2011-07-20 15:50:34 +02:00
parent 42fac79a21
commit 641986cf92
1 changed files with 11 additions and 5 deletions

View File

@ -650,9 +650,9 @@ int main(int argc, char *argv[])
longopts, NULL)) != -1) { longopts, NULL)) != -1) {
if (cmd != -1 && strchr("CcnDE", c)) if (cmd != -1 && strchr("CcnDE", c))
errx(EXIT_FAILURE, "%s %s", errx(EXIT_FAILURE, _("clear, read-clear, console-level, "
"--{clear,read-clear,console-level,console-on,console-off}", "console-on, and console-off options are mutually "
_("options are mutually exclusive")); "exclusive"));
switch (c) { switch (c) {
case 'C': case 'C':
@ -733,8 +733,14 @@ int main(int argc, char *argv[])
if (cmd == -1) if (cmd == -1)
cmd = SYSLOG_ACTION_READ_ALL; /* default */ cmd = SYSLOG_ACTION_READ_ALL; /* default */
if (ctl.raw && (ctl.fltr_lev || ctl.fltr_fac)) if (ctl.raw && (ctl.fltr_lev || ctl.fltr_fac || ctl.delta ||
errx(EXIT_FAILURE, _("options --level and --facility cannot be used for raw output")); 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) { switch (cmd) {
case SYSLOG_ACTION_READ_ALL: case SYSLOG_ACTION_READ_ALL: