-
Notifications
You must be signed in to change notification settings - Fork 54
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
Support --color
and --no-color
flags?
#77
Comments
Sounds good! |
Nice to have :) |
Hi there, my name is Andre Willomitzer and I am a student from Canada studying computer programming. Currently we are contributing to open source projects we are interested in. Recently, I built a command line tool for parsing TXT/MD files to html files. Would you be interested in discussing me working on this issue? I think this can be done using Yargs another open source library. It allows the use of "alias" and "options" in the command line. For example you could type --no-color, and then in the code check for whether argv.noColor exists (OR) if the "NO_COLOR" in env is true. Either way, you would disable colors in the terminal right? If I am misunderstanding what the --color and --no-color is supposed to do please let me know. |
In this case, we just need to const colors = createColors({
useColor: process.argv.includes("--color") && !process.argv.includes("--no-color")
}) Either way, we don't really need to add a dependency. |
@AndreWillomitzer Would be awesome if you could work on this! |
I think that So, both of the following should produce no color.
|
Yep, agree |
Available in |
@jorgebucaran Readme needs to be updated. |
Should be good now. Thank you, everyone! 🙌 |
Wow you guys fixed that so fast. And the idea about not adding libraries makes sense, I never considered that you want the fewest dependencies. Is there any other issue you think a beginner like myself would be able to fix? Thanks, that makes a ton of sense what you did with const colors = createColors({ |
Pretty sure issues will pop up sooner or later. If you decide to watch this repository, you'll find out when that happens, and perhaps you'll help us then. Thank you, Andre. |
Okay! Thanks Jorge nice e-meeting you I'll watch the repo then. Sad I didn't get to contribute a change though because this type of task seems perfect for learning haha. All the best, Andre |
@AndreWillomitzer I'm going to shamelessly hijack the thread, but if you are looking for a not-too-complicated OSS task to do, I would be happy if you could take a look at kibertoad/toad-scheduler#24 :D |
We should probably support
--color
and--no-color
flags inprocess.argv
like chalk/supports-color does.Also: webpack/webpack-cli#2966
cc @kibertoad @snitin315 @alexander-akait
The text was updated successfully, but these errors were encountered: