Deps.edn alias works with clj -A, but boot deps -A throws errors

boot

#1

I have fairly simple deps.edn that includes an alias for rebel readline

deps.edn:

    {...
     :aliases {:rebel  {:extra-deps {com.bhauman/rebel-readline {:mvn/version "0.1.4"}}
               :main-opts ["-m" "rebel-readline.main"]}}

from the comandline:
$ clj -A:rebel #works! rebel starts up!

but when using the boot-tools-deps library:

$ boot deps -A:rebel
    ...
    ...blah blah lots of pain, nashing of teeth...
    ...
    clojure.lang.ExceptionInfo: Specified aliases are undeclared: [:pod/rebel]
    line: 27

I’m clearly misunderstanding how boot.tools.deps works. Apologies in advance.


#2

Ok. I think I got this:

$ boot deps -A rebel -x #works! rebel launches!

-A = include the alias named by the next argument (no keywords required?)

-x = execute any main-opts passed in


#3

Yes, you need to a) use Boot-style command-line arguments (which means -A alias1 -A alias2 rather than the clj-style of -A:alias1:alias2) and b) you have to explicitly tell boot-tools-deps that you really want to run the :main-opts rather than let Boot do its usual default runtime.

The latter makes it easier to work with aliases that both add dependencies and run code for clj, since you’ll often want to get the dependencies but still let Boot run code its own way.