使用模式将命令输出着色。
rainbow的Python项目详细描述
使用模式轻松地将命令输出着色。
rainbow [ --COLOR=PATTERN ... | --conf CONF ] COMMAND
示例
使用命令行
将rainbow与--COLOR=PATTERN关联前置到 命令,例如:
用包含红色ERROR的行来跟踪一些日志文件:
rainbow --red=ERROR tail -f /var/log/my.log
您还可以将命令输出管道到rainbow:
tail -f /var/log/my.log | rainbow --red=ERROR
使用配置
rainbow可以从文件中加载每个命令的配置,这是最方便的使用方法。运行rainbow mycommand时,rainbow将在~/.config/rainbow、~/.rainbow、/etc/rainbow或内置配置中自动查找名为mycommand.cfg的配置:
使用内置配置将diff命令输出着色:
rainbow diff file1 file2
使用~/.rainbow/mycommand.cfg:
启动我的自定义命令rainbow mycommand
编写配置的语法很简单,请参阅 builtin configs 举个例子。另请参见commands support table。
安装
使用软件包
System | Installation instructions |
---|---|
Debian / Ubuntu | rainbow repository |
Fedora / CentOS / RHEL / Scientific Linux | rainbow repository |
OpenSUSE / SLE | rainbow repository |
Arch Linux | AUR/rainbow / AUR/rainbow-git |
pip / easy_install | PyPI: rainbow |
来源建筑
您可以通过以下方式从源代码构建:
git clone git://github.com/nicoulaj/rainbow.git cd rainbow python setup.py build install --user
贡献
欢迎投稿,请看CONTRIBUTING。
许可证
这个项目是Linibou’s colorex的分支。 它是根据GNU General Public License的条款发布的。参见COPYING了解 细节。