Fork me on GitHub

@seancorfield nice. I went with the stdin approach given that JSON is going to be nye impossible to trust as a bash arg.


@cjsauer In bash’s defence, it should work fine when passing the arg as JSON to a -M -m invocation. The extra quoting required by the EDN parsing of -X is what makes this hard. In Clojure CLI’s defense, it can make other things easy ;-).


Perhaps the clojure CLI can have some convention to prevent the argument from being parsed as EDN. E.g.:

clojure -X foo/bar :foo 1 :bar @$(.. some json here ...)
An @ isn't valid in EDN anyway and it's just one character to check to see if the arg must be handled as a literal string instead.

Alex Miller (Clojure team)14:02:06

you know where to make requests... :)


Before making requests, hearing a firm :face_vomiting: , no, or such can save me time ;)


But a "hmm, not a bad idea, will consider, could you make an ask" will be enough for me to create one :)


I'll take your reply as the latter.


I would be super happy if this got addressed!


Yeah, like most folks, I too prefer to ping on Slack for a :face_vomiting: or facepalm reaction before investing time in crafting a more formal issue or request.


I may have found a nicer convention as the leading character:

$ clojure -X foo/bar :foo /dude :bar '"dude"' ;;=> (foo/bar {:foo "dude" :bar "dude"})
A leading slash. Normally this would result into an invalid symbol (or something else invalid) when reading EDN, so it would probably not be breaking anything. It's kind of irrelevant if we go with / or @ but since @ in command line args often denotes reading a file's contents, maybe it's better to reserve that one for later.


I'm going to try both on Windows, to see if it's going to behave correctly

Alex Miller (Clojure team)16:02:43

can you put suggestions on the ask question please?


Just experimenting, I will paste the outcome in the issue. After trying bash, cmd.exe and powershell, I found that / may work better than @ since @ seems to not play well in powershell.


Issue updated.