[GRASS-SVN] r65557 - grass/trunk/general/g.list
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Jul 9 10:58:03 PDT 2015
Author: hcho
Date: 2015-07-09 10:58:03 -0700 (Thu, 09 Jul 2015)
New Revision: 65557
Modified:
grass/trunk/general/g.list/main.c
Log:
g.list: Use G_options_* for checking parameter dependencies
Modified: grass/trunk/general/g.list/main.c
===================================================================
--- grass/trunk/general/g.list/main.c 2015-07-09 17:42:41 UTC (rev 65556)
+++ grass/trunk/general/g.list/main.c 2015-07-09 17:58:03 UTC (rev 65557)
@@ -151,27 +151,15 @@
flag.full->description = _("Verbose listing (also list map titles)");
flag.full->guisection = _("Print");
+ G_option_excludes(opt.region, flag.pretty, flag.full, NULL);
+ G_option_excludes(flag.pretty, flag.mapset, flag.type, NULL);
+ G_option_excludes(flag.full, flag.mapset, flag.type, NULL);
+ G_option_exclusive(flag.pretty, flag.full, NULL);
+ G_option_exclusive(flag.regex, flag.extended, NULL);
+
if (G_parser(argc, argv))
exit(EXIT_FAILURE);
- if ((flag.pretty->answer || flag.full->answer) && opt.region->answer)
- G_fatal_error(_("-%c/-%c and %s= are mutually exclusive"),
- flag.pretty->key, flag.full->key, opt.region->key);
-
- if ((flag.pretty->answer || flag.full->answer) &&
- (flag.mapset->answer || flag.type->answer))
- G_fatal_error(_("-%c/-%c and -%c/-%c are mutually exclusive"),
- flag.pretty->key, flag.full->key,
- flag.mapset->key, flag.type->key);
-
- if (flag.pretty->answer && flag.full->answer)
- G_fatal_error(_("-%c and -%c are mutually exclusive"),
- flag.pretty->key, flag.full->key);
-
- if (flag.regex->answer && flag.extended->answer)
- G_fatal_error(_("-%c and -%c are mutually exclusive"),
- flag.regex->key, flag.extended->key);
-
if (opt.pattern->answer) {
if (flag.regex->answer || flag.extended->answer)
filter = G_ls_regex_filter(opt.pattern->answer, 0,
More information about the grass-commit
mailing list