Created
November 25, 2016 06:08
-
-
Save satour/f0babb9f826045141af50f6cd6e3bf55 to your computer and use it in GitHub Desktop.
jq の引数の順番を入れ替えただけ(好みの問題)
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
| case ARGV.size | |
| when 1 | |
| file, filter, option = ARGV[0], ".", "" | |
| when 2 | |
| if ARGV[1][0] == "-" | |
| file, filter, option = ARGV[0], ".", ARGV[1] | |
| else | |
| file, filter, option = ARGV[0], ARGV[1], "" | |
| end | |
| else | |
| file, filter, option = ARGV[0], ARGV[1], ARGV[2] | |
| end | |
| system("jq " + filter + " " + file + " " + option) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment