From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [RFC PATCH 1/1] test.sh: colorize the output
Date: Thu, 5 Jan 2017 10:24:59 +0100 [thread overview]
Message-ID: <20170105092457.GA15400@rei.lan> (raw)
In-Reply-To: <20170105085711.8903-1-petr.vorel@gmail.com>
Hi!
> Hi, I know you're busy with release and this is just a toy for interactive
> running. But it you find it useful for upstream, I'll try to polish it and
> implement TODO.
I guess that we can add support for colors.
> TODO:
> * Create environment variable or getopt switch for enabling/disabling
> colors (instead of macro USE_ANSCI_COLOR), default off. Work in
> similar way like ls (--color[=WHEN], WHEN can be 'always' (default if
> omitted), 'auto', or 'never').
Adding more default options for testcases does not seem to be good idea
to me, environment variable sounds much better.
I would expect colorized output enabled by default, but the color output
would be produced only if we are writing to actual terminal. Utils such
as grep use stat() on stdout to check if it's char device and isatty()
as well. And we should also have some env variable, something as
LTP_COLORIZE_OUTPUT to override the decision.
> * DRY: Keep default definition only on one place => generate with make?
> * Allow user to define colors (overwrite with environment variables).
User defined colors does not sound that useful to me.
--
Cyril Hrubis
chrubis@suse.cz
next prev parent reply other threads:[~2017-01-05 9:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-05 8:57 [LTP] [RFC PATCH 1/1] test.sh: colorize the output Petr Vorel
2017-01-05 9:24 ` Cyril Hrubis [this message]
2017-01-05 12:41 ` Petr Vorel
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=20170105092457.GA15400@rei.lan \
--to=chrubis@suse.cz \
--cc=ltp@lists.linux.it \
/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