Fork me on GitHub
#tools-deps
<
2023-02-08
>
respatialized15:02:23

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, https://github.com/babashka/cli might be of interest

respatialized15:02:13

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

borkdude16:02:39

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

borkdude16:02:16

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

borkdude16:02:26

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