Fork me on GitHub

Is there any way to invoke a function that takes positional args under an alias using clojure -X ? It seems like :exec-args is only designed for maps; is there something I missed in the docs and examples?

Alex Miller (Clojure team)15:02:18

-X/-T only support functions that take a map

Alex Miller (Clojure team)15:02:48

depending on your goals, might be of interest


I’m just writing a wrapper fn for the time being; another dep is probably not necessary for my use case.


babashka.cli also only invokes functions that take maps

Alex Miller (Clojure team)16:02:42

ah, sorry - I thought the focus was on the cli calling, not the function to call


the focus is on making functions that take maps (similar to -X) invokable as unix-like CLIs (like you're used to from tools.cli) using some light metadata annotation


at least, that's one of the things that it does. you can also just parse args yourself (like with tools.cli) and then invoke any function you want