Skip to content

Add functionality to disable coloured output #54

@madAndroid

Description

@madAndroid

The coloured output is really helpful, but in some situations it makes it difficult to integrate the tool in scripts.. for example we run this during instance startup in AWS:

sensu-cli client history $(facter fqdn) | grep last_status | \
  sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g" | awk '{print $2}' | egrep '(1|2|3)'

That nasty sed is there to parse the coloured output ASCII codes, otherwise we can't properly grep for last_status codes

Is there a simpler way to do this within the shell output?
Alternatively, would you consider adding an option which allows --nocolour ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions