Welcome! Please see the About page for a little more info on how this works.

0 votes
in tools.tools by

Currently, :tools/usage supports :ns-default and :ns-aliases but there's no way to provide a default function to be executed -- even though -X and deps.edn do support a default function.

This would allow tool authors to either provide help as a default when someone runs a tool like this:

clojure -Tsome-tool

or to default to the most common operation, for example deps-new could default to create so that it could be omitted from commands that use templates:

clojure -Sdeps '{:deps {io.github.cryogen-project/cryogen {:git/tag "0.6.6" :git/sha "fcb2833"}}}' -Tnew :template org.cryogenweb/new :name myname/myblog

(this is an example from Cryogen's README -- and it is currently incorrect usage because create is missing but given a :template, the only function it makes sense to call is create in this case).

1 Answer

+1 vote
by
selected by
 
Best answer

We have decided not to support this for now and have some regrets about making it a feature of -X.

Not necessarily a forever decision but something we are still thinking about.

by
Fair enough, but definitely interesting about -X -- could you share more details about the discussions and regrets around :exec-fn?
by
Making the feature optional/provided is maybe too implicit and complected (and also makes more ambiguity/complexity in parsing the -X args). There are cases for one-fn tool usage but maybe that's a separate thing over the top, or different syntax, or something else that bundles a command with what it is.
by
Thanks. Yeah, given that, I can see how :exec-fn might be a wrong move now. Design is an interesting process.
...