This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-05-03
Channels
- # announcements (21)
- # aws (6)
- # babashka (28)
- # beginners (39)
- # biff (1)
- # calva (23)
- # cider (5)
- # clj-kondo (108)
- # clojure (11)
- # clojure-europe (17)
- # clojure-nl (2)
- # clojure-nlp (10)
- # clojure-uk (8)
- # clojurescript (29)
- # community-development (4)
- # conjure (20)
- # css (3)
- # datalevin (9)
- # datomic (3)
- # events (2)
- # figwheel-main (11)
- # fulcro (36)
- # honeysql (7)
- # humbleui (5)
- # interceptors (4)
- # introduce-yourself (3)
- # jobs (1)
- # lsp (51)
- # malli (1)
- # meander (71)
- # minecraft (8)
- # other-languages (18)
- # pathom (15)
- # polylith (25)
- # portal (10)
- # re-frame (5)
- # reitit (15)
- # releases (1)
- # remote-jobs (1)
- # shadow-cljs (11)
- # tools-deps (27)
Is there any way to make clojure -A:aliases
not execute clojure.main with :main-opts
in case they are defined in one of the aliases?
; clojure -Sdeps '{:aliases {:foo {:main-opts ["-e" ":hello"]}}}' -A:foo
WARNING: Use of :main-opts with -A is deprecated. Use -M instead.
:hello
I'd like to force this command to bring up a repl instead, are there any switches that can do that for me?
I'd like to do this without having to alter the alias. Say, there's an alias in a project that's usually used with -M
to execute something, but I want to repl into the environment set up by that alias instead
I think this will be the behavior in the future, as -A with main opts has been long deprecated. @U064X3EF3 mentioned that this might happen with the switch to 1.11 but it didn't
I'm guessing this didn't happen due to not wanting to break users, there might still be many of them around
Alternatively, avoid using -A
execution flag at all.
I use Rebel Readline as my terminal REPL, which uses a :main-opts
to start the REPL process and terminal UI, so I can chain any aliases before the rebel alias and only the :main-opts
from rebel is used.
I get a much richer REPL UI experience too..
For example I can run rebel with kaocha to include the library and skip its :main-opts and just use the main-opts from :repl/rebel
clojure -M:env/dev:test/kaocha:repl/rebel
Aliases are defined in https://github.com/practicalli/clojure-deps-ednI have been prepping a list of deprecations to remove, and that will happen in stages, but haven't started yet. The above will be one of the last things to change.
Would you consider an option to add something along the lines of a strict mode cli switch beforehand so as to provide a way to test whether stuff will continue working after deprecations?
I'll think about it, but I am loathe to add options
@U08BJGV6E I've mostly taken to separating :main-opts
into additional aliases, so I have clojure -M:test:runner
for example but clj -A:test
to start a REPL.
(although, at this point, I've moved nearly all my actual test running into build.clj
so clojure -T:build test
tends to be how I run a test suite now)
Aliases are designed to be composable so having a separation of concerns and the ability to combine them as needed is more idiomatic (you could argue this is a "feature").
Thanks for the tip, Sean. I also started doing that and perhaps this will nudge me to do more. It would help though if one could create an alias which is the merging of other aliases for brevity at the command line and to try and not break others' workflows
I've been thinking about this area a lot recently
so maybe an area of enhancement soon
@U08BJGV6E Go vote for https://ask.clojure.org/index.php/10564/specify-an-alias-that-is-a-set-of-other-aliases if you haven't already 🙂