Skip to content

Commit 07a16c2

Browse files
PaulWesselseisman
andauthored
If called from external with -Vi or lower, print command string (#4131)
* If called from external with -Vi or lower, print command string For simpler debugging from external calls, we echo out the module call string when -Vi is used. * Update gmt_api.c * Update gmt_api.c * Change to -Vd instead * Update src/gmt_api.c Co-authored-by: Dongdong Tian <[email protected]> Co-authored-by: Dongdong Tian <[email protected]>
1 parent fffc517 commit 07a16c2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/gmt_api.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11034,6 +11034,12 @@ int GMT_Call_Module (void *V_API, const char *module, int mode, void *args) {
1103411034
else { /* Call the function and pass back its return value */
1103511035
gmt_manage_workflow (API, GMT_USE_WORKFLOW, NULL); /* First detect and set modern mode if modern mode session dir is found */
1103611036
gmtapi_check_for_modern_oneliner (API, module, mode, args); /* If a modern mode one-liner we must switch run--mode here */
11037+
if (API->external && gmt_M_is_verbose (API->GMT, GMT_MSG_DEBUG)) {
11038+
/* For externals only, print the equivalent command-line string under -Vd */
11039+
char *text = (mode == GMT_MODULE_OPT) ? GMT_Create_Cmd (API, args) : args;
11040+
GMT_Report (API, GMT_MSG_DEBUG, "GMT_Call_Command string: %s %s\n", module, text);
11041+
if (mode == GMT_MODULE_OPT) GMT_Destroy_Cmd (API, &text);
11042+
}
1103711043
status = (*p_func) (V_API, mode, args); /* Call the module in peace */
1103811044
}
1103911045
return (status);

0 commit comments

Comments
 (0)