This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-08-02
Channels
- # announcements (11)
- # aws (3)
- # babashka (34)
- # beginners (20)
- # biff (2)
- # calva (3)
- # cherry (29)
- # cider (6)
- # cljs-dev (9)
- # clojure (124)
- # clojure-europe (12)
- # clojure-norway (5)
- # clojure-uk (2)
- # clojurescript (32)
- # conjure (11)
- # datalevin (1)
- # datomic (16)
- # deps-new (1)
- # etaoin (6)
- # holy-lambda (10)
- # honeysql (28)
- # hyperfiddle (21)
- # jackdaw (2)
- # jobs (2)
- # leiningen (15)
- # missionary (12)
- # off-topic (132)
- # other-languages (1)
- # pathom (13)
- # rdf (10)
- # re-frame (8)
- # reagent (5)
- # releases (1)
- # remote-jobs (4)
- # shadow-cljs (32)
- # tools-deps (6)
- # vim (15)
- # xtdb (24)
is there something in tools deps nowadays that can run a CLJ function from the command line, without it doing any argument parsing itself? -X
presumes the only argument is a EDN map and parses it as such. -M -m
only runs -main
? I want clj -? some.ns/some-fn foo
?
just remembered I opened a ticket for that for clojure.main
itself which would work I guess https://clojure.atlassian.net/browse/CLJ-2316
My opinion: introducing a new -f
flag seems too much overkill to me for such a simple tweak (and babashka uses -f
to indicate --file
...), but I think it would be good to have this. lein and bb do support -m foo/bar
@thheller What about doing this in user space (for now)?
(ns run-main)
(let [[main-fn & args] *command-line-args*]
(apply (requiring-resolve (symbol main-fn)) args))
$ clj -M /tmp/run_main.clj clojure.core/prn 1 2 3
"1" "2" "3"