Skip to content

Commit

Permalink
Let the debug message finding -R -J history report the information (#…
Browse files Browse the repository at this point in the history
…6296)

In modern mode we go hunting for -R -J values in the history if -R -J are not specified on the command line.  If we find these in the history we append -R and/or -J to the internal command and report the lame message:

Modern mode: Added -R to options since history is available

However, the intended target for this message (developers) would appreciate to actually be told what was found, e.g.

Modern mode: Added -R to options since history is available [0/40/-2/5]

This PR takes care of that.
  • Loading branch information
PaulWessel authored Feb 4, 2022
1 parent a128e4c commit 12e5f5e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gmt_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -15409,7 +15409,7 @@ struct GMT_CTRL *gmt_init_module (struct GMTAPI_CTRL *API, const char *lib_name,
if ((opt = GMT_Make_Option (API, 'R', "")) == NULL) return NULL; /* Failure to make option */
if ((*options = GMT_Append_Option (API, opt, *options)) == NULL) return NULL; /* Failure to append option */
n_slashes = gmt_count_char (GMT, GMT->init.history[id], '/'); /* May need to know if it is 3 (2-D) or 5 (3-D) later regarding -p -JZ */
GMT_Report (API, GMT_MSG_DEBUG, "Modern mode: Added -R to options since history is available.\n");
GMT_Report (API, GMT_MSG_DEBUG, "Modern mode: Added -R to options since history is available [%s].\n", GMT->init.history[id]);
}
else if (strchr (required, 'g') || strchr (required, 'd')) { /* No history but can examine input data sets */
if (gmtinit_determine_R_option_from_data (API, required, false, options)) {
Expand All @@ -15426,7 +15426,7 @@ struct GMT_CTRL *gmt_init_module (struct GMTAPI_CTRL *API, const char *lib_name,
if ((id = gmt_get_option_id (id + 1, str)) >= 0 && GMT->init.history[id]) { /* There is history for this -J */
if ((opt = GMT_Make_Option (API, 'J', "")) == NULL) return NULL; /* Failure to make option */
if ((*options = GMT_Append_Option (API, opt, *options)) == NULL) return NULL; /* Failure to append option */
GMT_Report (API, GMT_MSG_DEBUG, "Modern: Adding -J to options since there is history available.\n");
GMT_Report (API, GMT_MSG_DEBUG, "Modern: Adding -J to options since history is available [%s].\n", GMT->init.history[id]);
got_J = true;
}
}
Expand Down

0 comments on commit 12e5f5e

Please sign in to comment.