Skip to content

Commit

Permalink
v.db.connect: Replace -o flag with the standard --overwrite (#3214)
Browse files Browse the repository at this point in the history
* v.db.connect: Implement standard --overwrite and remove -o flag

* Add -o => --overwrite to renamed_options
  • Loading branch information
HuidaeCho committed Mar 23, 2024
1 parent 10d1b55 commit 2c298d9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
2 changes: 2 additions & 0 deletions lib/gis/renamed_options
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,8 @@ v.buffer|bufcolumn:column
v.clean|thresh:threshold
# v.colors
v.colors|volume:raster_3d
# v.db.connect
v.db.connect|-o:--overwrite
# v.db.join
v.db.join|otable:other_table
v.db.join|ocolumn:other_column
Expand Down
13 changes: 4 additions & 9 deletions vector/v.db.connect/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ int main(int argc, char **argv)
struct GModule *module;
struct Option *inopt, *dbdriver, *dbdatabase, *dbtable, *field_opt, *dbkey,
*sep_opt;
struct Flag *overwrite, *print, *columns, *delete, *shell_print;
struct Flag *print, *columns, *delete, *shell_print;
dbDriver *driver;
dbString table_name;
dbTable *table;
Expand Down Expand Up @@ -101,11 +101,6 @@ int main(int argc, char **argv)
"layer and exit");
columns->guisection = _("Print");

overwrite = G_define_flag();
overwrite->key = 'o';
overwrite->description =
_("Overwrite connection parameter for certain layer");

delete = G_define_flag();
delete->key = 'd';
delete->description =
Expand Down Expand Up @@ -271,9 +266,9 @@ int main(int argc, char **argv)
G_debug(3, "Vect_map_check_dblink = %d", ret);
if (ret == 1) {
/* field already defined */
if (!overwrite->answer)
G_fatal_error(_("Use -o to overwrite existing link "
"for layer <%d>"),
if (!G_get_overwrite())
G_fatal_error(_("Use --overwrite to overwrite "
"existing link for layer <%d>"),
field);
else {
dbColumn *column;
Expand Down

0 comments on commit 2c298d9

Please sign in to comment.