From 2ea747ebf1ed89cd1d5a704677e72c2d008eb6f1 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 2 Sep 2013 11:42:44 +0200 Subject: last: --fulltime and --time-format are mutually exclusive Signed-off-by: Karel Zak --- login-utils/last.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'login-utils') diff --git a/login-utils/last.c b/login-utils/last.c index d407bf9d6..eb64bde6a 100644 --- a/login-utils/last.c +++ b/login-utils/last.c @@ -42,6 +42,7 @@ #include "c.h" #include "nls.h" +#include "optutils.h" #include "pathnames.h" #include "xalloc.h" #include "closestream.h" @@ -834,7 +835,6 @@ int main(int argc, char **argv) enum { OPT_TIME_FORMAT = CHAR_MAX + 1 }; - static const struct option long_opts[] = { { "limit", required_argument, NULL, 'n' }, { "help", no_argument, NULL, 'h' }, @@ -853,6 +853,11 @@ int main(int argc, char **argv) { "time-format", required_argument, NULL, OPT_TIME_FORMAT }, { NULL, 0, NULL, 0 } }; + static const ul_excl_t excl[] = { /* rows and cols in in ASCII order */ + { 'F', OPT_TIME_FORMAT }, /* fulltime, time-format */ + { 0 } + }; + int excl_st[ARRAY_SIZE(excl)] = UL_EXCL_STATUS_INIT; setlocale(LC_ALL, ""); bindtextdomain(PACKAGE, LOCALEDIR); @@ -861,6 +866,9 @@ int main(int argc, char **argv) while ((c = getopt_long(argc, argv, "hVf:n:RxadFit:p:s:0123456789w", long_opts, NULL)) != -1) { + + err_exclusive_options(c, long_opts, excl, excl_st); + switch(c) { case 'h': usage(stdout); -- cgit v1.2.3-55-g7522