go-supportscolor icon indicating copy to clipboard operation
go-supportscolor copied to clipboard

Does not recognize "-no-color"

Open asmaloney opened this issue 2 years ago • 2 comments

(Got here from gchalk - thanks for that!)

It looks like this only looks for "double-dash" options? i.e. --no-color

I would have expected it to support -no-color as well. Took me a while to figure out why it wasn't working.

(It would also be nice to have it support the proper spelling of colour throughout as well 😄 - waves from downtown YOW!)

asmaloney avatar Nov 21 '22 15:11 asmaloney

Chalk only supports --no-color, so I followed suit with gchalk. And, generally a single dash would be for a bunch of single options. For example, -no would be the same as -n -o (although I admit that's a Unix convention).

I'm happy to add --no-colour. I'm in YOW as well. :)

jwalton avatar Nov 21 '22 18:11 jwalton

And, generally a single dash would be for a bunch of single options.

Yes - for some cases & it's really just convention. (I'm very old-school, so --foo still feels strange 😆 ). Would be good to be more flexible IMHO.

I'm using gchalk in combination with urfave/cli which accepts both -no-color and --no-color as the same thing, but only --no-color actually works. So either I ignore it, or I need add some extra fiddling to check for the "one-dash" case and then call gchalk.SetLevel( gchalk.LevelNone ).

I'm in YOW as well

I saw that - Winter has come!

Thanks Jason - have a great week.

asmaloney avatar Nov 21 '22 18:11 asmaloney