[PATCH BlueZ 2/2] shared/shell: Highlight user prompt input

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

 



From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>

This makes them more evident compared to regular output which is now
possible since coloring prompts should not produce artifacs anymore.
---
 src/shared/shell.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/shared/shell.c b/src/shared/shell.c
index d7fbf46aa..eac654f40 100644
--- a/src/shared/shell.c
+++ b/src/shared/shell.c
@@ -592,7 +592,8 @@ void bt_shell_prompt_input(const char *label, const char *msg,
 
 		prompt = new0(struct bt_shell_prompt_input, 1);
 
-		if (asprintf(&prompt->str, "[%s] %s ", label, msg) < 0) {
+		if (asprintf(&str, COLOR_HIGHLIGHT "[%s] %s " COLOR_OFF, label,
+								msg) < 0) {
 			free(prompt);
 			return;
 		}
@@ -605,7 +606,8 @@ void bt_shell_prompt_input(const char *label, const char *msg,
 		return;
 	}
 
-	if (asprintf(&str, "[%s] %s ", label, msg) < 0)
+	if (asprintf(&str, COLOR_HIGHLIGHT "[%s] %s " COLOR_OFF, label,
+								msg) < 0)
 		return;
 
 	prompt_input(str, func, user_data);
-- 
2.20.1




[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