-
Notifications
You must be signed in to change notification settings - Fork 229
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, fix #15 #45
Conversation
oh nvm this is to always remove colors. |
bin/wscat
Outdated
@@ -66,8 +66,12 @@ Console.prototype.prompt = function prompt() { | |||
Console.prototype.print = function print(type, msg, color) { | |||
if (tty.isatty(1)) { | |||
this.clear(); | |||
color = color || Console.Colors.Default; | |||
this.stdout.write(color + type + msg + Console.Colors.Default + '\n'); | |||
if(program.color) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we simplify this? Like
if (color === undefined) color = Console.Colors.Default;
if (!program.color) color = '';
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
SGTM. |
Thank you. |
This doesn't work - it just removes all coloring permanently. Line 70 Line 137 I suggest the following: Line 70 change to: Line 137 change to: This will have the desired effect of having no colors when calling wscat with --nocolor. |
I tested the master again, and |
Allows --no-color to be passed, which will prevent any color from being written to the terminal.