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);
|
||||
} else {
|
||||
} else if (out_handling == SHELL_OUTPUT_PRINT) {
|
||||
printf("%s", out);
|
||||
}
|
||||
}
|
||||
|
@ -10,11 +10,12 @@ extern "C" {
|
||||
#endif // __cplusplus
|
||||
|
||||
#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, ...) \
|
||||
run_command(HANDLE_OUTPUT, OUT_BUF, BUF_SIZE, __VA_ARGS__, NULL)
|
||||
|
||||
typedef enum {
|
||||
SHELL_OUTPUT_DISCARD,
|
||||
SHELL_OUTPUT_PRINT,
|
||||
SHELL_OUTPUT_CAPTURE,
|
||||
} CMDOutHandling;
|
||||
|
Loading…
Reference in New Issue
Block a user