Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --no-color option #749

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

andxyz
Copy link

@andxyz andxyz commented Jan 7, 2020

Make the --color=false option, work properly.

The --no-color feature appears to be not be working properly, I have more work to do here. But this is a simplified fix.

Interestingly enough, this feature is in the documentation. (My guess, is maybe at one time, we had this --no-color feature?)

$ foreman --help start
Usage:
  foreman start [PROCESS]

Options:
  -c, [--color], [--no-color]          # Force color to be enabled
  -e, [--env=ENV]                      # Specify an environment file to load, defaults to .env
  -m, [--formation="alpha=5,bar=3"]    # Specify what processes will run and how many. Default: "all=1"
  -p, [--port=N]
  -t, [--timeout=N]                    # Specify the amount of time (in seconds) processes have to shutdown gracefully before receiving a SIGKILL, defaults to 5.
      [--timestamp], [--no-timestamp]  # Include timestamp in output
                                       # Default: true
  -f, [--procfile=PROCFILE]            # Default: Procfile
  -d, [--root=ROOT]                    # Default: Procfile directory

Start the application (or a specific PROCESS)

@andxyz
Copy link
Author

andxyz commented Jan 7, 2020

Here is a pic of my terminal. it is hard to talk colors without some visuals

@ddollar
Copy link
Owner

ddollar commented Jan 7, 2020

Thor already supports the --no variants to boolean options. You could just check it for false (will be nil if unspecified)

Please also add a test that covers your change.

@andxyz
Copy link
Author

andxyz commented Jan 7, 2020

Ah, I see, I wondered how that --no-color option was getting into the docs. It was a Thor thing.

Thanks for the pointers, I will work towards your suggested approach. And add tests of course.

@daande
Copy link

daande commented Jan 15, 2020

Thor already supports the --no variants to boolean options. You could just check it for false (will be nil if unspecified)

@ddollar I am confused by the ask here?

and yes we will add a test!

@andxyz
Copy link
Author

andxyz commented Dec 2, 2021

I've updated things. However, adding tests in rspec that involve the def color? method, which relies on isatty, was getting nutty.
So I did manual testing and left it at that.

andxyz-2021-12-01-23-56-42

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants