Given the new tools.deps CLI capabilities it would be very convenient to have a clojure.main -m option that optionally allows calling specific function, not just -main.
Creating utilities for use with the clojure tool otherwise requires creating a new namespace for each "task" (or resorting to -e or script.clj files).
Leiningen supports the lein run -m some.util/task ... notation. shadow-cljs does as well.
I think it would be better to instead add a new flag that supports this (-f or something) rather than push new functionality onto -m.
An alternative to consider: Imitate the existing facility in ClojureScript, which has a main-cli-fn:
As an example use, with foo.cljs:
One place where this can really be advantageous over -m or even a -f approach is if you make a shebang script and you want to have command-line arguments passed, it would be nice to start that script simply with
and then let the main-cli-fn mechanism ensure command-line-args is routed to that function, without having to put -f some-qualified/function in the shebang line where on Linux not possible to specify interpreter arguments in the shebang line.
Bleh, that sounds gross. I have some new aliasing stuff in clj that will help some of this in work.
Patch implements the suggested -f argument rather than changing the existing -m.