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

how to hightlight multiple strings like "foo" & "bar" at the same time #77

Closed
mintisan opened this Issue Sep 12, 2015 · 7 comments

Comments

Projects
None yet
3 participants
@mintisan

mintisan commented Sep 12, 2015

I use,...

colout "foo"  red "bar" yellow

but it doesn't work.

how do I set commond?

@while0pass

This comment has been minimized.

Contributor

while0pass commented Sep 12, 2015

Pipe your output through colout as many times as the number of highlighting patterns you have.
somecommand_with_output_to_highlight | colout "foo" red | colout "bar" yellow

@mintisan

This comment has been minimized.

mintisan commented Sep 12, 2015

@while0pass

oh, thank you, I forget "|" ....

@nojhan

This comment has been minimized.

Owner

nojhan commented Sep 12, 2015

Passing through two pipes will take more CPU.
Thanks to regex groups, you can do it in one pass:
colout "(foo).*(bar)" red,yellow

Le Sam 12 Sep 2015 14:38, Ted Lin notifications@github.com a écrit :

@while0pass https://github.com/while0pass

oh, thank you, I forget "|" ....


Reply to this email directly or view it on GitHub
#77 (comment).

@mintisan

This comment has been minimized.

mintisan commented Sep 12, 2015

@nojhan
3q for your geek way to do it.

And I think I should learn regex for doing my work in efficient way.

@nojhan

This comment has been minimized.

Owner

nojhan commented Sep 12, 2015

Groups are really interesting for colout when you start playing with
colormaps (see the examples at the end of the readme).

Le Sam 12 Sep 2015 14:47, nojhan nojhan@nojhan.net a écrit :

Passing through two pipes will take more CPU.
Thanks to regex groups, you can do it in one pass:
colout "(foo).*(bar)" red,yellow

Le Sam 12 Sep 2015 14:38, Ted Lin notifications@github.com a écrit :

@while0pass https://github.com/while0pass

oh, thank you, I forget "|" ....


Reply to this email directly or view it on GitHub
#77 (comment).

@while0pass

This comment has been minimized.

Contributor

while0pass commented Sep 12, 2015

@nojhan I really like the way colout uses regex groups and colormaps, but your example colout "(foo).*(bar)" red,yellow is not very good when you need highlight totally unrelated patterns with different color or style throughout the output. The only way to do this I'm aware of is through chaning multiple colout invocations with pipes.

@nojhan

This comment has been minimized.

Owner

nojhan commented Sep 12, 2015

Indeed.

Le Sam 12 Sep 2015 15:22, while0pass notifications@github.com a écrit :

@nojhan https://github.com/nojhan I really like the way colout uses
regex groups and colormaps, but your example colout "(foo).*(bar)"
red,yellow is not very good when you need highlight totally unrelated
patterns with different color or style throughout the output. The only way
I'm aware of to do this is through chaning multiple colout invocations with
pipes.


Reply to this email directly or view it on GitHub
#77 (comment).

@mintisan mintisan closed this Jan 5, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment