[PATCH BlueZ] shared/shell: Add prompt item to bt_shell_menu structure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This allows to associate specific prompts with main menu
and submenus thus providing for better navigation when
submenus are in use.
---
 src/shared/shell.c | 3 +++
 src/shared/shell.h | 1 +
 2 files changed, 4 insertions(+)

diff --git a/src/shared/shell.c b/src/shared/shell.c
index cfdcc76c4..a821c8d0a 100644
--- a/src/shared/shell.c
+++ b/src/shared/shell.c
@@ -1226,6 +1226,9 @@ bool bt_shell_set_menu(const struct bt_shell_menu *menu)
 	if (!data.main)
 		data.main = menu;
 
+	if (menu->prompt)
+		bt_shell_set_prompt(menu->prompt);
+
 	return true;
 }
 
diff --git a/src/shared/shell.h b/src/shared/shell.h
index e14d58381..a9eee506f 100644
--- a/src/shared/shell.h
+++ b/src/shared/shell.h
@@ -53,6 +53,7 @@ struct bt_shell_menu_entry {
 struct bt_shell_menu {
 	const char *name;
 	const char *desc;
+	const char *prompt;
 	const struct bt_shell_menu_entry entries[];
 };
 
-- 
2.21.0




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux