Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jqsh fails if jq is a script #26

Open
pkoppstein opened this issue Feb 16, 2015 · 4 comments
Open

jqsh fails if jq is a script #26

pkoppstein opened this issue Feb 16, 2015 · 4 comments

Comments

@pkoppstein
Copy link

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.

$ jqsh -version=false
fork/exec /Users/user/bin/jq: exec format error

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.

@bmatsuo
Copy link
Owner

bmatsuo commented Feb 18, 2015

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
>

@pkoppstein
Copy link
Author

Thanks. Might I suggest --jq ...; it is customary to use -jq as a contraction of -j -q

@bmatsuo
Copy link
Owner

bmatsuo commented Feb 18, 2015

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.

@pkoppstein
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants