summaryrefslogtreecommitdiffstats
path: root/term-utils/setterm.c
diff options
context:
space:
mode:
authorSami Kerola2014-05-18 15:39:58 +0200
committerSami Kerola2014-05-19 23:54:24 +0200
commit11f69359fabca6cf3f0561fc1e5a6d4337853bd4 (patch)
tree35e1dc0a309a966ff60cabd4bb4b0d8d1d7078f2 /term-utils/setterm.c
parentsetterm: various visual terminal effects are not console specific (diff)
downloadkernel-qcow2-util-linux-11f69359fabca6cf3f0561fc1e5a6d4337853bd4.tar.gz
kernel-qcow2-util-linux-11f69359fabca6cf3f0561fc1e5a6d4337853bd4.tar.xz
kernel-qcow2-util-linux-11f69359fabca6cf3f0561fc1e5a6d4337853bd4.zip
setterm: mark some options to be exclusive with each other
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'term-utils/setterm.c')
-rw-r--r--term-utils/setterm.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/term-utils/setterm.c b/term-utils/setterm.c
index 854efcbd5..d2fb596a0 100644
--- a/term-utils/setterm.c
+++ b/term-utils/setterm.c
@@ -78,6 +78,7 @@
#include "c.h"
#include "closestream.h"
#include "nls.h"
+#include "optutils.h"
#include "strutils.h"
#include "xalloc.h"
@@ -533,8 +534,16 @@ static void parse_option(struct setterm_control *ctl, int argc, char **argv)
{"help", no_argument, NULL, OPT_HELP},
{NULL, 0, NULL, 0}
};
+ static const ul_excl_t excl[] = {
+ { OPT_DEFAULT, OPT_STORE },
+ { OPT_TABS, OPT_CLRTABS, OPT_REGTABS },
+ { OPT_MSG, OPT_MSGLEVEL },
+ { 0 }
+ };
+ int excl_st[ARRAY_SIZE(excl)] = UL_EXCL_STATUS_INIT;
while ((c = getopt_long_only(argc, argv, "", longopts, NULL)) != -1) {
+ err_exclusive_options(c, longopts, excl, excl_st);
switch (c) {
case OPT_TERM:
ctl->opt_term = set_opt_flag(ctl->opt_term);