Open pkoppstein opened 9 years ago
Yea. It makes sense to provide a way to override the executable in the PATH.
I will add an option, -jq.
jqsh -jq=/opt/bin/jq
>
Thanks. Might I suggest --jq ...; it is customary to use -jq as a contraction of -j -q
I'll think about it. I know most people would expect that...
I'm just using the Go stdlib for flag parsing at the moment. It doesn't have the notion as 'short options' and the contracted form.
I never looked for a good getopt package because I don't care much for short form options. To your example, -jq
could also reasonably be interpreted as the flag -j
with the value "q". It's application dependent.
I am not advocating the compression of short options. Anyway, I think your point about "-jq" confirms the wisdom of not using "-jq X" to mean "--jq X". That is, the latter under most schemes only has the minor ambiguity as to whether or not X is an argument of the option.
I normally have jq defined as a script that invokes /usr/local/bin/jq in a specific way, and so jqsh fails when it attempts to invoke jq, e.g.
One way to allow jqsh to coexist with such a script would be to provide a command-line option specifying the pathname of the "jq" to be used.
Thank you.