diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2019-10-02 13:14:28 -0700 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2019-10-02 13:14:28 -0700 |
| commit | e25eaf9b92b62027ede8a8b142dadfb8d95c227a (patch) | |
| tree | 2a8d8d1ccf4376839431378714ebb7874e234ca7 | |
| parent | f0016a2d101b0b1eb02b14541947f69e734db319 (diff) | |
Default behavior for invalid bb commands is now to print an error
message to stdout on the default console screen and otherwise ignore it
instead of exiting.
| -rw-r--r-- | bb.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -815,7 +815,16 @@ bb_result_t process_cmd(bb_t *bb, const char *cmd) if (e) set_selected(bb, e, !IS_SELECTED(e)); return BB_OK; } - default: err("UNKNOWN COMMAND: '%s'", cmd); break; + default: { + fputs(T_LEAVE_BBMODE, tty_out); + restore_term(&orig_termios); + const char *msg = "Invalid bb command: "; + write(STDERR_FILENO, msg, strlen(msg)); + write(STDERR_FILENO, cmd, strlen(cmd)); + write(STDERR_FILENO, "\n", 1); + init_term(); + return BB_INVALID; + } } return BB_INVALID; } |
