Преглед изворни кода

g.list and g.remove: make guisections consistent and put related things together

 * group print options together (move from optional)
 * group pattern flags together (move from optional)
 * remove raster (contained just one flag)
 * move names group to be first (not perfect, names and ignore have different usages, related in implementation, not for user)


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@62248 15284696-431f-4ddb-bdfa-cd5b030d7da7
Vaclav Petras пре 10 година
родитељ
комит
b66d9ef83e
2 измењених фајлова са 17 додато и 14 уклоњено
  1. 2 0
      general/g.list/main.c
  2. 15 14
      general/g.remove/main.c

+ 2 - 0
general/g.list/main.c

@@ -114,6 +114,7 @@ int main(int argc, char *argv[])
 	_("'.' for current mapset; '*' for all mapsets in location");
     opt.separator = G_define_standard_option(G_OPT_F_SEP);
     opt.separator->answer = "newline";
+    opt.separator->guisection = _("Print");
 
     opt.region = G_define_standard_option(G_OPT_M_REGION);
     opt.region->label = _("Name of saved region for map search (default: not restricted)");
@@ -124,6 +125,7 @@ int main(int argc, char *argv[])
     opt.output->required = NO;
     opt.output->label = _("Name for output file");
     opt.output->description = _("If not given or '-' then standard output");
+    opt.output->guisection = _("Print");
 
     flag.regex = G_define_flag();
     flag.regex->key = 'r';

+ 15 - 14
general/g.remove/main.c

@@ -80,18 +80,6 @@ int main(int argc, char *argv[])
     opt.type->descriptions = M_get_option_desc(TRUE);
     opt.type->guidependency = "pattern,exclude,names,ignore";
 
-    opt.pattern = G_define_option();
-    opt.pattern->key = "pattern";
-    opt.pattern->type = TYPE_STRING;
-    opt.pattern->description = _("File name search pattern");
-    opt.pattern->guisection = _("Pattern");
-
-    opt.exclude = G_define_option();
-    opt.exclude->key = "exclude";
-    opt.exclude->type = TYPE_STRING;
-    opt.exclude->description = _("File name exclusion pattern (default: none)");
-    opt.exclude->guisection = _("Pattern");
-
     opt.names = G_define_option();
     opt.names->key = "names";
     opt.names->type = TYPE_STRING;
@@ -109,15 +97,29 @@ int main(int argc, char *argv[])
 	_("File names to ignore separated by a comma (default: none)");
     opt.ignore->guisection = _("Names");
 
+    opt.pattern = G_define_option();
+    opt.pattern->key = "pattern";
+    opt.pattern->type = TYPE_STRING;
+    opt.pattern->description = _("File name search pattern");
+    opt.pattern->guisection = _("Pattern");
+
+    opt.exclude = G_define_option();
+    opt.exclude->key = "exclude";
+    opt.exclude->type = TYPE_STRING;
+    opt.exclude->description = _("File name exclusion pattern (default: none)");
+    opt.exclude->guisection = _("Pattern");
+
     flag.regex = G_define_flag();
     flag.regex->key = 'r';
     flag.regex->description =
 	_("Use basic regular expressions instead of wildcards");
+    flag.regex->guisection = _("Pattern");
 
     flag.extended = G_define_flag();
     flag.extended->key = 'e';
     flag.extended->description =
 	_("Use extended regular expressions instead of wildcards");
+    flag.extended->guisection = _("Pattern");
 
     flag.force = G_define_flag();
     flag.force->key = 'f';
@@ -127,8 +129,7 @@ int main(int argc, char *argv[])
     flag.basemap = G_define_flag();
     flag.basemap->key = 'b';
     flag.basemap->description = _("Remove base raster maps");
-    flag.basemap->guisection = _("Raster");
-    
+
     G_option_exclusive(flag.regex, flag.extended, NULL);
     G_option_exclusive(opt.pattern, opt.names, NULL);
     G_option_exclusive(opt.exclude, opt.ignore, NULL);