From: Karel Zak Date: Mon, 2 Sep 2013 09:42:44 +0000 (+0200) Subject: last: --fulltime and --time-format are mutually exclusive X-Git-Tag: v2.24-rc1~298 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2ea747ebf1ed89cd1d5a704677e72c2d008eb6f1;p=thirdparty%2Futil-linux.git last: --fulltime and --time-format are mutually exclusive Signed-off-by: Karel Zak --- diff --git a/login-utils/last.c b/login-utils/last.c index d407bf9d63..eb64bde6a8 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);