-A / -M alias ordering is not respected for :main-opts

Description

See https://github.com/clojure/clojure-site/issues/306 for some of the background information.

Because the clojure shell script groups all -A options together before any -M options, if you say -Mfoo -Abar it is actually treated as -Abar -Mfoo and any :main-opts from bar will be ignored (assuming foo has :main-opts). The shell script should expand -A options on the fly (and not use all_aliases).

tools.deps needs to be checked for how it handles this as well to ensure it respects ordering.

Environment

None

Activity

Show:
Alex Miller
September 28, 2020, 5:23 PM

-M is now always expected to be after -A (and ideally won't use -A at all) which resolves the ambiguity here. moving to won't fix.

Sean Corfield
September 28, 2020, 6:22 PM

I read over the CLI/deps reference page and it references clj-opt to show those must come before -M or -X but clj-opt is never actually defined. I think that should be explicitly defined somewhere on the reference page as being -A, -J, and/or -S… (those are the only other official options now).

Also, the output of clojure -h indicates (incorrectly) that -A is an exec-option:

Won't Fix

Assignee

Alex Miller

Reporter

Sean Corfield

Labels

None

Approval

None

Patch

None

Priority

Major