l3nz
1
Hello all,
I think I am getting lost in a glass of water. I used to run Clojure on the shell by using
clj -m module
Where said module has a -main
function. And it works. See eg cli-matic/toycalc.clj at master · l3nz/cli-matic · GitHub
But now I get a warning:
WARNING: Implicit use of clojure.main with options is deprecated, use -M
And I’m not finding the correct incantation to run the same command as before but without the warning printed.
1 Like
clj -M -m module
The -M
flag means "use clojure.main
" and then -m module
is consumed by clojure.main
, where -m
means “run -main
in this namespace”.
The -A
flag currently still runs clojure.main
but will stop doing that at some point and will just start a REPL.
The -X
flag means “execute this function”.
See Clojure - Deps and CLI Guide for more details.
4 Likes
l3nz
3
Thanks - I did look there but did not really understand how it was. Some days the brains just won’t connect.
jr0cket
4
I wrote an article on Clojure CLI execution options, -A -M -P -T -X, with examples, to help remember the for of each and when to use them
https://practical.li/blog/posts/clojure-which-execution-option-to-use/
6 Likes
system
Closed
5
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.