Skip to content

Commit d708637

Browse files
authored
Fix #8726 (#8738)
1 parent fe1f74d commit d708637

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/grdconvert.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#define THIS_MODULE_MODERN_NAME "grdconvert"
3030
#define THIS_MODULE_LIB "core"
3131
#define THIS_MODULE_PURPOSE "Convert between different grid formats"
32-
#define THIS_MODULE_KEYS "<G{,>G}"
32+
#define THIS_MODULE_KEYS "<G{,GG}"
3333
#define THIS_MODULE_NEEDS ""
3434
#define THIS_MODULE_OPTIONS "-RVf"
3535

@@ -170,9 +170,11 @@ static int parse (struct GMT_CTRL *GMT, struct GRDCONVERT_CTRL *Ctrl, struct GMT
170170
n_in++;
171171
break;
172172
case '>': /* Output file may be set this way from the external API */
173-
n_errors += gmt_M_repeated_module_option (API, Ctrl->G.active);
174-
n_errors += gmt_get_required_file (GMT, opt->arg, opt->option, 0, GMT_IS_GRID, GMT_OUT, GMT_FILE_LOCAL, &(Ctrl->G.file));
175-
n_in++;
173+
if (!Ctrl->G.active) { /* No output grid yet. This should be used when returning the output grid to Julia/Matlab */
174+
n_errors += gmt_M_repeated_module_option (API, Ctrl->G.active);
175+
n_errors += gmt_get_required_file (GMT, opt->arg, opt->option, 0, GMT_IS_GRID, GMT_OUT, GMT_FILE_LOCAL, &(Ctrl->G.file));
176+
n_in++;
177+
}
176178
break;
177179

178180
/* Processes program-specific parameters */

0 commit comments

Comments
 (0)