Skip to content

Commit

Permalink
feedback from code review
Browse files Browse the repository at this point in the history
Use standard option in v.db.select and fix standard option attributes
  • Loading branch information
kritibirda26 committed May 17, 2024
1 parent 2b8cd68 commit 856d40f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
6 changes: 3 additions & 3 deletions lib/gis/parser_standard_options.c
Original file line number Diff line number Diff line change
Expand Up @@ -947,12 +947,12 @@ struct Option *G_define_standard_option(int opt)
Opt->key = "format";
Opt->type = TYPE_STRING;
Opt->key_desc = "name";
Opt->required = NO;
Opt->required = YES;
Opt->label = _("Output format");
Opt->answer = "plain";
Opt->options = "plain,json";
Opt->description = _("plain;Plain text output;"
"json;JSON (JavaScript Object Notation);");
Opt->descriptions = _("plain;Plain text output;"
"json;JSON (JavaScript Object Notation);");
break;
}

Expand Down
7 changes: 1 addition & 6 deletions vector/v.db.select/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,18 +119,13 @@ int main(int argc, char **argv)
_("GROUP BY conditions of SQL statement without 'group by' keyword");
options.group->guisection = _("Selection");

options.format = G_define_option();
options.format->key = "format";
options.format->type = TYPE_STRING;
options.format->required = YES;
options.format->label = _("Output format");
options.format = G_define_standard_option(G_OPT_F_FORMAT);
options.format->options = "plain,csv,json,vertical";
options.format->descriptions =
"plain;Configurable plain text output;"
"csv;CSV (Comma Separated Values);"
"json;JSON (JavaScript Object Notation);"
"vertical;Plain text vertical output (instead of horizontal)";
options.format->answer = "plain";
options.format->guisection = _("Format");

options.fsep = G_define_standard_option(G_OPT_F_SEP);
Expand Down

0 comments on commit 856d40f

Please sign in to comment.