Add option to discard command output
This commit is contained in:
parent
92c2439b56
commit
802b70f5ee
@ -101,7 +101,7 @@ internal inline CMDError get_command_output(FILE *fp,
|
|||||||
}
|
}
|
||||||
|
|
||||||
strcat(out_buf, out);
|
strcat(out_buf, out);
|
||||||
} else {
|
} else if (out_handling == SHELL_OUTPUT_PRINT) {
|
||||||
printf("%s", out);
|
printf("%s", out);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,11 +10,12 @@ extern "C" {
|
|||||||
#endif // __cplusplus
|
#endif // __cplusplus
|
||||||
|
|
||||||
#define CMD_NO_EXIT(ERR) \
|
#define CMD_NO_EXIT(ERR) \
|
||||||
((CMDResult){.exited = false, .exit_code = EXIT_FAILURE})
|
((CMDResult){.exited = false, .exit_code = EXIT_FAILURE, .error = ERR})
|
||||||
#define wapp_shell_commander_execute(HANDLE_OUTPUT, OUT_BUF, BUF_SIZE, ...) \
|
#define wapp_shell_commander_execute(HANDLE_OUTPUT, OUT_BUF, BUF_SIZE, ...) \
|
||||||
run_command(HANDLE_OUTPUT, OUT_BUF, BUF_SIZE, __VA_ARGS__, NULL)
|
run_command(HANDLE_OUTPUT, OUT_BUF, BUF_SIZE, __VA_ARGS__, NULL)
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
SHELL_OUTPUT_DISCARD,
|
||||||
SHELL_OUTPUT_PRINT,
|
SHELL_OUTPUT_PRINT,
|
||||||
SHELL_OUTPUT_CAPTURE,
|
SHELL_OUTPUT_CAPTURE,
|
||||||
} CMDOutHandling;
|
} CMDOutHandling;
|
||||||
|
Loading…
Reference in New Issue
Block a user