From: Christian Couder <chriscool@tuxfamily.org>
To: Pierre Habouzit <madcoder@debian.org>
Cc: "Shawn O. Pearce" <spearce@spearce.org>, git@vger.kernel.org
Subject: Re: [PATCH] Add some fancy colors in the test library when terminal supports it.
Date: Tue, 23 Oct 2007 06:08:14 +0200 [thread overview]
Message-ID: <200710230608.15124.chriscool@tuxfamily.org> (raw)
In-Reply-To: <20071022081341.GC32763@artemis.corp>
Hi Pierre,
Le lundi 22 octobre 2007, Pierre Habouzit a écrit :
> +
> +say_color () {
> + [ "$nocolor" = 0 ] && [ "$1" != '-1' ] && tput setaf "$1"
> + shift
> + echo "* $*"
> + tput op
> +}
> +
> error () {
> - echo "* error: $*"
> + say_color 9 "* error: $*"
This will print something like "* * error: ..." instead of "* error: ..."
The following should work:
> + say_color 9 "error: $*"
By the way, where do the 9 here and the 10 and the -1 below come from ?
"man 5 terminfo" says that only values form 0 to 7 are portably defined.
Maybe 9 is a bold red and 10 a bold green, or something like that, but it
doesn't seem to work on my konsole.
Anyway, perhaps having:
_red=1
_green=2
and then using "say_color $_red stuff" might be easier to understand and
change if needed.
Thanks for this good idea,
Christian.
next prev parent reply other threads:[~2007-10-23 4:01 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-22 8:13 [PATCH] Add some fancy colors in the test library when terminal supports it Pierre Habouzit
2007-10-22 8:53 ` Johannes Sixt
2007-10-22 11:24 ` Pierre Habouzit
2007-10-22 11:35 ` Johannes Sixt
2007-10-22 12:11 ` Pierre Habouzit
2007-10-22 12:18 ` Johannes Sixt
2007-10-22 13:45 ` Pierre Habouzit
2007-10-23 4:08 ` Christian Couder [this message]
2007-10-23 6:37 ` Johannes Sixt
2007-10-23 8:13 ` Pierre Habouzit
-- strict thread matches above, loose matches on Subject: below --
2007-10-24 20:03 Small enhancements of the test-lib.sh Pierre Habouzit
[not found] ` <1193256219-24222-2-git-send-email-madcoder@debian.org>
2007-10-24 20:28 ` [PATCH] Add some fancy colors in the test library when terminal supports it Pierre Habouzit
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=200710230608.15124.chriscool@tuxfamily.org \
--to=chriscool@tuxfamily.org \
--cc=git@vger.kernel.org \
--cc=madcoder@debian.org \
--cc=spearce@spearce.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).