All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ 2/2] shared/shell: Highlight user prompt input
Date: Thu, 14 Mar 2019 16:51:05 +0200	[thread overview]
Message-ID: <20190314145105.25524-2-luiz.dentz@gmail.com> (raw)
In-Reply-To: <20190314145105.25524-1-luiz.dentz@gmail.com>

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

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


      reply	other threads:[~2019-03-14 14:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-14 14:51 [PATCH BlueZ 1/2] shared/shell: Fix colors not using proper escape sequence Luiz Augusto von Dentz
2019-03-14 14:51 ` Luiz Augusto von Dentz [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190314145105.25524-2-luiz.dentz@gmail.com \
    --to=luiz.dentz@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.