Project

General

Profile

Actions

Feature #3062

closed

Add --no-color support

Added by Marek Hulán over 10 years ago. Updated over 10 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:
Actions #1

Updated by Ohad Levy over 10 years ago

should this be the default? or can we detect the terminal and bg colors correctly?

Actions #2

Updated by Marek Hulán over 10 years ago

We can detect it using `tput colors` (even if it's not really OS agnostic).

But in general I'd say that installer in most cases will be used in color enabled terminals and displayed to people so color should be on by default. If we added users a way to disable them I thing that would be ok as well.

Actions #3

Updated by Dominic Cleal over 10 years ago

Often programs check for a tty to determine if it's interactive or non-interactive, so would provide a useful default.

Actions #4

Updated by Lukas Zapletal over 10 years ago

Again, if it is possible to get it into 1.3 I'd love to invest some time and cherry-pick that. I'd love to keep my beaker tests consistent for all foreman-installer based releases.

As Dominic said, the best way is the UNIX way. If the terminal is interactive, go for colors, otherwise go for non-colored mode. But please keep this option because I think beaker emulates terminal (while it is writing the output to log database).

Actions #5

Updated by Lukas Zapletal over 10 years ago

And I think it is okay to use /usr/bin/tput, if the binary is not there, just fallback to non-colored mode. We do not want to draw another dependency just to make a syscall. Please check katello-configure I think I have been already implementing some hack to rind out number of columns using tput with a fallback there:

https://github.com/Katello/katello-configure/blob/master/lib/util/functions.rb#L45

Actions #6

Updated by Marek Hulán over 10 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Marek Hulán
Actions #7

Updated by Marek Hulán over 10 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF