Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 142480 - Proposal: --force-color to emerge
Summary: Proposal: --force-color to emerge
Status: RESOLVED DUPLICATE of bug 42115
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Enhancement/Feature Requests (show other bugs)
Hardware: All All
: Normal enhancement (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-01 16:12 UTC by Claes Strom
Modified: 2006-08-28 18:29 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
The "patch" is against sys-apps/portage-2.1-r1 (emerge--force-nocolor.diff.gz,603 bytes, text/gzip)
2006-08-01 16:13 UTC, Claes Strom
Details
Not gzipped this time ;-) (emerge--force-nocolor.diff,1.10 KB, patch)
2006-08-01 16:16 UTC, Claes Strom
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Claes Strom 2006-08-01 16:12:44 UTC
I have many times wanted to be able to do a:
  "emerge --force-color -vpuDN world | less -r"

It's possible with attached "patch"

/Claes
Comment 1 Claes Strom 2006-08-01 16:13:41 UTC
Created attachment 93237 [details]
The "patch" is against sys-apps/portage-2.1-r1
Comment 2 Claes Strom 2006-08-01 16:16:36 UTC
Created attachment 93238 [details, diff]
Not gzipped this time ;-)
Comment 3 Zac Medico gentoo-dev 2006-08-01 16:17:14 UTC
In 2.1.1_pre it's currently possible to force color by exporting NOCOLOR=no in the environment.

*** This bug has been marked as a duplicate of 42115 ***

*** This bug has been marked as a duplicate of 42115 ***
Comment 4 Claes Strom 2006-08-01 16:24:18 UTC
I think its easier and more logical to do:

  emerge --force-color ... | less -r

than:

  NOCOLOR=no emerge ... | less -r
Comment 5 Zac Medico gentoo-dev 2006-08-01 16:40:04 UTC
Indeed, but we'd really like to condense it into --color=yes,no,auto so that we don't need separate --force-color, --auto-color, and --no-color options.
Comment 6 Claes Strom 2006-08-01 16:49:27 UTC
(In reply to comment #5)
> Indeed, but we'd really like to condense it into --color=yes,no,auto so that we
> don't need separate --force-color, --auto-color, and --no-color options.
> 
Is --color=auto going to be able to knew that "| less -r" is able to display "colors"?
Comment 7 Claes Strom 2006-08-01 16:55:24 UTC
Forget it! I'm to tired to argue....
I have to get some sleep now!


*** This bug has been marked as a duplicate of 42115 ***
Comment 8 Zac Medico gentoo-dev 2006-08-01 16:56:05 UTC
How would it know?  I'd assume that auto would be just like the current default behavior, which is to disable color when sys.stdout.isatty() returns False.
Comment 9 Sebastian Stammler 2006-08-28 18:29:12 UTC
hi,
i think a cmdline option has some advantages over a environment variable. but call it --color=<state> instead of --<state>color(eg --force-color) is better, yes.
i want to point out that: 1)if some apps really read the emerge output and NOCOLOR=no is set, they get into trouble
2)emeber, you can easily add "alias emerge='emerge -color=yes'" to your rc's instead of setting NOCOLOR and this or this way, you have color through pipes enabled with just typing emerge. BUT with the cmdline option it's not possible that the apps get colored data. if the apps invoke emerge via its full path, they don't use the alias set. but they always use the environment variable...