diff --git a/src/grdconvert.c b/src/grdconvert.c index 610c7eb620c..ee53f7caf1c 100644 --- a/src/grdconvert.c +++ b/src/grdconvert.c @@ -29,7 +29,7 @@ #define THIS_MODULE_MODERN_NAME "grdconvert" #define THIS_MODULE_LIB "core" #define THIS_MODULE_PURPOSE "Convert between different grid formats" -#define THIS_MODULE_KEYS "G}" +#define THIS_MODULE_KEYS "': /* Output file may be set this way from the external API */ - n_errors += gmt_M_repeated_module_option (API, Ctrl->G.active); - n_errors += gmt_get_required_file (GMT, opt->arg, opt->option, 0, GMT_IS_GRID, GMT_OUT, GMT_FILE_LOCAL, &(Ctrl->G.file)); - n_in++; + if (!Ctrl->G.active) { /* No output grid yet. This should be used when returning the output grid to Julia/Matlab */ + n_errors += gmt_M_repeated_module_option (API, Ctrl->G.active); + n_errors += gmt_get_required_file (GMT, opt->arg, opt->option, 0, GMT_IS_GRID, GMT_OUT, GMT_FILE_LOCAL, &(Ctrl->G.file)); + n_in++; + } break; /* Processes program-specific parameters */