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

Long options with '=' are not parsed #89

Closed
bnii opened this issue Apr 23, 2021 · 7 comments
Closed

Long options with '=' are not parsed #89

bnii opened this issue Apr 23, 2021 · 7 comments

Comments

@bnii
Copy link

bnii commented Apr 23, 2021

It seems the long-form command-line options don't work in the --option=value way, only as --option value.

Thanks for this tool!

$ echo '{"a": 1}' | jet --from json
{"a" 1}
$ echo '{"a": 1}' | jet --from=json
Exception in thread "main" clojure.lang.EdnReader$ReaderException: java.lang.RuntimeException: Invalid token: :
        at clojure.lang.EdnReader.read(EdnReader.java:180)
        at clojure.lang.EdnReader.read(EdnReader.java:111)
        at clojure.edn$read.invokeStatic(edn.clj:35)
        at jet.formats$parse_edn.invokeStatic(formats.clj:29)
        at jet.main$_main$fn__10629.invoke(main.clj:114)
        at jet.main$_main.invokeStatic(main.clj:121)
        at jet.main$_main.doInvoke(main.clj:97)
        at clojure.lang.RestFn.applyTo(RestFn.java:137)
        at jet.main.main(Unknown Source)
Caused by: java.lang.RuntimeException: Invalid token: :
        at clojure.lang.Util.runtimeException(Util.java:221)
        at clojure.lang.EdnReader.interpretToken(EdnReader.java:285)
        at clojure.lang.EdnReader.read(EdnReader.java:171)
        at clojure.lang.EdnReader.readDelimitedList(EdnReader.java:766)
        at clojure.lang.EdnReader$MapReader.invoke(EdnReader.java:680)
        at clojure.lang.EdnReader.read(EdnReader.java:145)
        ... 8 more
@borkdude
Copy link
Owner

Perhaps we should just use clojure.tools.cli which will enable this. @dotemacs perhaps you are interested in looking at this?

@dotemacs
Copy link
Contributor

Thanks for the honourable mention :) but I'm more of a fan of the short command line options.

Let me think on it.

Thanks

@borkdude
Copy link
Owner

I don't necessarily think we should support this unless there is some strong push from the community.

@dotemacs
Copy link
Contributor

I don't necessarily think we should support this unless there is some strong push from the community.

I agree with this.

@bnii
Copy link
Author

bnii commented Apr 23, 2021

I don't necessarily think we should support this

you mean it would be just a marginal improvement or it is actually not right for some reason?

@borkdude
Copy link
Owner

Marginal improvement. Personally I've never felt the need for this.

@borkdude
Copy link
Owner

Babashka CLI now support parsing this style of invocation:

https://github.com/babashka/cli

We could try to switch to that (and hope nothing else breaks).

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

No branches or pull requests

3 participants