Skip to content

Instantly share code, notes, and snippets.

@satour
Created November 25, 2016 06:08
Show Gist options
  • Save satour/f0babb9f826045141af50f6cd6e3bf55 to your computer and use it in GitHub Desktop.
Save satour/f0babb9f826045141af50f6cd6e3bf55 to your computer and use it in GitHub Desktop.
jq の引数の順番を入れ替えただけ(好みの問題)
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