Diff between c0ed04ab07b88d1e1cba919e37da80cbc8b79934 and 80c810ec9e724cb58a3abd81481b96ee96c28126

Changed Files

File Additions Deletions Status
src/shared/shell.c +10 -0 modified
src/shared/shell.h +2 -0 modified

Full Patch

diff --git a/src/shared/shell.c b/src/shared/shell.c
index 6749920..4e42bd6 100644
--- a/src/shared/shell.c
+++ b/src/shared/shell.c
@@ -1708,3 +1708,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 e431db9..eebbc71 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);