diff options
author | Sami Kerola | 2015-01-11 02:03:37 +0100 |
---|---|---|
committer | Karel Zak | 2015-06-29 13:39:37 +0200 |
commit | 254e9e58b7bb73ab2a45b28d29358a96e3e7a9b4 (patch) | |
tree | 58c27cd215b0d2122c053aa573508a815116ec83 /sys-utils/rtcwake.c | |
parent | rtcwake: improve coding style (diff) | |
download | kernel-qcow2-util-linux-254e9e58b7bb73ab2a45b28d29358a96e3e7a9b4.tar.gz kernel-qcow2-util-linux-254e9e58b7bb73ab2a45b28d29358a96e3e7a9b4.tar.xz kernel-qcow2-util-linux-254e9e58b7bb73ab2a45b28d29358a96e3e7a9b4.zip |
rtcwake: make some command line options mutually exclusive
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'sys-utils/rtcwake.c')
-rw-r--r-- | sys-utils/rtcwake.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sys-utils/rtcwake.c b/sys-utils/rtcwake.c index e6b4a8dae..d457a5bf6 100644 --- a/sys-utils/rtcwake.c +++ b/sys-utils/rtcwake.c @@ -36,6 +36,7 @@ #include "c.h" #include "closestream.h" #include "nls.h" +#include "optutils.h" #include "pathnames.h" #include "strutils.h" #include "timeutils.h" @@ -407,6 +408,11 @@ int main(int argc, char **argv) {"list-modes", no_argument, 0, OPT_LIST}, {0, 0, 0, 0 } }; + static const ul_excl_t excl[] = { + { 'a', 'l', 'u' }, + { 's', 't', OPT_DATE }, + }; + int excl_st[ARRAY_SIZE(excl)] = UL_EXCL_STATUS_INIT; setlocale(LC_ALL, ""); bindtextdomain(PACKAGE, LOCALEDIR); @@ -414,6 +420,7 @@ int main(int argc, char **argv) atexit(close_stdout); while ((t = getopt_long(argc, argv, "A:ahd:lm:ns:t:uVv", long_options, NULL)) != EOF) { + err_exclusive_options(t, long_options, excl, excl_st); switch (t) { case 'A': /* for better compatibility with hwclock */ |