Default to --nocolor when piping output from ansible-lint #3882
Unanswered
unikitty37
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The issue tracker requires pasting the output from
ansible-lint --version
into the template. As macOS has thepbcopy
command, which copies piped input to the pasteboard, I naturally triedansible-lint --version | pbcopy
, but I got this:ansible-lint �[1;36m6.21.1�[0m using�[2m ansible-core:�[0m�[1;2;36m2.15.5�[0m�[2m ansible-compat:�[0m�[1;2;36m4.1.10�[0m�[2m ruamel-yaml:�[0m�[1;2;36m0.17.39�[0m�[2m ruamel-yaml-clib:�[0m�[1;2;36m0.2.8�[0m
I figured the devs wouldn't particularly appreciate that 😁 so ended up using
ansible-lint --version
and copying the output with the mouse, like an animal. I later discovered the--nocolor
flag.However, it would be much more helpful if the default behaviour with no colour flags or variables set was to have colour on, except when the output is being piped.
(Actually, I'm not sure if this is a bug — the presence of the
--force-color
flag implies that this might be the intended behaviour…)Beta Was this translation helpful? Give feedback.
All reactions