2012-03-08 8 views
12

ack(-grep)で使用できるすべての色の組み合わせなどのリストはどこにありますか?しかし私は、私が発見していない、ack-grepてログを渡すと、エラー、警告または特にカラー化と他のさまざまな条件を検出するには非常に役に立つことができることをなどを使用することができるどのようなコンボの権威リスト、出力、ログなどのカラー化のために、ack(-grep)にはどのようなカラーオプションがありますか?

tail -f development.log \ 
| ack-grep --flush --passthru --color --color-match=yellow "^.*warning.*" 

Iを見つけますなどredblueyellow、​​、

そして、私はあなたが"white on_green"

しかし、他に何を使用することができることを見てきた:?「などの標準的な色などのオプション見てきましたか

perldoc Term::ANSIColor 

はここで関連の抜粋です:あなたとあなたに利用可能であるかどうか確認することができるように

答えて

22

ACKは、PerlのTerm::ANSIColorモジュールを使用しています。

The recognized normal foreground color attributes (colors 0 to 7) are: 

    black red green yellow blue magenta cyan white 

    The corresponding bright foreground color attributes (colors 8 to 15) 
    are: 

    bright_black bright_red  bright_green bright_yellow 
    bright_blue bright_magenta bright_cyan bright_white 

    The recognized normal background color attributes (colors 0 to 7) are: 

    on_black on_red  on_green on_yellow 
    on_blue on_magenta on_cyan on_white 

    The recognized bright background color attributes (colors 8 to 15) are: 

    on_bright_black on_bright_red  on_bright_green on_bright_yellow 
    on_bright_blue on_bright_magenta on_bright_cyan on_bright_white 

    For any of the above listed attributes, case is not significant. 

--passthruを使用してあなたを見てうれしいです。以下のための白いコンソールの背景に読みやすい結果を得るには

--color 
--color-match=on_white 
--color-filename=red 
--color-lineno=magenta 

我々は行う別の興味深い点は次のようにデフォルトの設定を〜/ .ackrcを作成することですack-users mailing list

+0

https://github.com/petdance/ack2/issues/26 –

+3

Linux(Ubuntu 11.10)サーバーでは、「明るい」が表示されていますエラー: '無効な属性名bright_black /usr/share/perl5/App/Ack.pm行1155' - この時点でこれがメーリングリストに持ち越されるべきですか? – ylluminate

+0

これは本当にTerm :: ANSIColorの問題ですが、確かにそれをack-usersに持ち込んでください。 –

6

にあなたを歓迎したいですインスタンス。 (実際に私がこの質問と@ andy-lesterからの有用な回答を検索して見つけ始めた理由)。

関連する問題