From 268ea09f3d9c2d07a8377b2054a7216acf5d0dc8 Mon Sep 17 00:00:00 2001 From: Ryan Volz Date: Tue, 30 May 2017 12:20:03 -0400 Subject: [PATCH] Add no-color, fix #15 --- bin/wscat | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/wscat b/bin/wscat index 8b23ae6..86ef345 100755 --- a/bin/wscat +++ b/bin/wscat @@ -67,6 +67,7 @@ Console.prototype.print = function print(type, msg, color) { if (tty.isatty(1)) { this.clear(); color = color || Console.Colors.Default; + if (!program.color) color = ''; this.stdout.write(color + type + msg + Console.Colors.Default + '\n'); this.prompt(); } else if (type === Console.Types.Incoming) { @@ -133,6 +134,7 @@ program .option('--cert ', 'Specify a Client SSL Certificate (--connect only)') .option('--key ', 'Specify a Client SSL Certificate\'s key (--connect only)') .option('--passphrase [passphrase]', 'Specify a Client SSL Certificate Key\'s passphrase (--connect only). If you don\'t provide a value, it will be prompted for.') + .option('--no-color', 'Run without color') .parse(process.argv); if (program.listen && program.connect) {