Message ID | 20241022141118.150143-7-hadess@hadess.net (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | Fix bluetoothctl --help hanging if daemon isn't running | expand |
Context | Check | Description |
---|---|---|
tedd_an/pre-ci_am | success | Success |
tedd_an/CheckPatch | success | CheckPatch PASS |
tedd_an/GitLint | success | Gitlint PASS |
tedd_an/IncrementalBuild | success | Incremental Build PASS |
diff --git a/src/shared/shell.c b/src/shared/shell.c index 2f83717b2d39..88cc7df2d565 100644 --- a/src/shared/shell.c +++ b/src/shared/shell.c @@ -1697,3 +1697,13 @@ int bt_shell_get_timeout(void) { return data.timeout; } + +void bt_shell_handle_non_interactive_help(void) +{ + if (!data.mode) + return; + if (data.argv[0] != cmplt) + return; + print_cmds(); + exit(EXIT_SUCCESS); +} diff --git a/src/shared/shell.h b/src/shared/shell.h index e431db9f5821..eebbc71faffb 100644 --- a/src/shared/shell.h +++ b/src/shared/shell.h @@ -60,6 +60,8 @@ int bt_shell_exec(const char *input); void bt_shell_quit(int status); void bt_shell_noninteractive_quit(int status); +void bt_shell_handle_non_interactive_help(void); + bool bt_shell_set_menu(const struct bt_shell_menu *menu); bool bt_shell_add_submenu(const struct bt_shell_menu *menu);