From: Petr Machata <petrm@nvidia.com>
To: Sam Foxman <elasticvine@protonmail.com>
Cc: <netdev@vger.kernel.org>
Subject: Re: [PATCH iproute2-next] Enable automatic color output by default.
Date: Mon, 11 Sep 2023 12:20:02 +0200 [thread overview]
Message-ID: <87sf7l3sn8.fsf@nvidia.com> (raw)
In-Reply-To: <20230911044440.49366-1-elasticvine@protonmail.com>
Sam Foxman <elasticvine@protonmail.com> writes:
> Automatic color should be enabled by default because it makes command
> output much easier to read, especially `ip addr` with many interfaces.
> Color is enabled only in interactive use, scripts are not affected.
tc and bridge should do the same.
FWIW, `ls' on Fedora is aliased to `ls --color=auto' by default. My
guess is that the reason that it's not auto by default was the
performance hit resulting from having to stat every file.
iproute2 tools do not have that issue -- overhead from those escape
sequences must surely be noise? So it would IMHO make sense to default
to color output for iproute2 tools.
> ---
> ip/ip.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/ip/ip.c b/ip/ip.c
> index 8c046ef1..aad6b6d7 100644
> --- a/ip/ip.c
> +++ b/ip/ip.c
> @@ -168,7 +168,7 @@ int main(int argc, char **argv)
> const char *libbpf_version;
> char *batch_file = NULL;
> char *basename;
> - int color = 0;
> + int color = COLOR_OPT_AUTO;
>
> /* to run vrf exec without root, capabilities might be set, drop them
> * if not needed as the first thing.
next prev parent reply other threads:[~2023-09-11 10:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-11 4:45 [PATCH iproute2-next] Enable automatic color output by default Sam Foxman
2023-09-11 10:20 ` Petr Machata [this message]
2023-09-11 10:35 ` Petr Machata
2023-09-11 16:19 ` Stephen Hemminger
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=87sf7l3sn8.fsf@nvidia.com \
--to=petrm@nvidia.com \
--cc=elasticvine@protonmail.com \
--cc=netdev@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 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).