I just use my shell history, I never have to type in a full command more than once. I have zsh (presto) with fish shell completion. A lot simpler than any other approach.
With the latest tools.deps, is it possible to use -M
with --report stderr
? I’m trying clojure -M:kaocha --report stderr
, which used to work, and kaocha complains ‘Unknown option: “--report”’
That should work
What’s the :kaocha alias?
I mean that’s an option to clojure.main, not kaocha
The error looks like it’s coming from kaocha, I think
The alias is
{:kaocha {:extra-deps
{lambdaisland/kaocha {:mvn/version "1.0.641"}}
:main-opts ["-m" "kaocha.runner"]}}
kaocha shouldn’t be seeing the --report
iiuc
@hugod Everything after -m
gets passed to that -main
function.
If you want --report
to work, you need to invoke clojure.main
(and have it invoke the koacha.runner
)
:main-opts ["--report" "stderr" "-m" "kaocha.runner"]
— try that?
Um, that’s unfortunate. Also not what clj --help
implies.
Which part?
It seems like you should be able to chose a report option when running a main with -M.
I would expect: clj --report stderr -M:kaocha kaocha-args...
here: everything after -M gets passed to clojure.main / the subtask, everything before gets parsed by the clojure CLI (but this is not according to the help)
or is --report
an option to clojure.main as well?
oh I see, it is. yeah, I guess you can't really put stuff in between the main args in your deps.edn alias from the command line
You can also activate that property with a Java system prop, that might combine better here
-J-Dclojure.main.report=stderr
^ add to clj command line
clj -J-Dclojure.main.report=stderr -M:kaocha
ok, that looks like it works as a consistent way (over all possible invocation types) of specifying it. It would still be nice to be able to specify it somehow with --report though.
as this is probably a user preference, maybe it could be a setting in $HOME/.clojure/deps.edn
?
or you could make an alias with jvm opts and combine it -M:report:kaocha
?
not sure if jvm opts concatenate when you combine aliases, do they?
Yes, they do.
:main-opts
do not, most everything else does.