Last active
December 2, 2016 13:50
-
-
Save satour/8f8c2c61531960e846df117ebbadacaf to your computer and use it in GitHub Desktop.
jq コマンドの出力結果を色つきでlessとして表示するやつ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if STDIN.tty? | |
| file = ARGV[0] | |
| filter = ARGV[1] || "." | |
| system("cat " + file + "|jq " + filter + " -C |less") | |
| else | |
| filter = ARGV[0] || "." | |
| system("jq " + filter + " -C |less") | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment