I want to add collections of common args to deps.edn to be specified for use with a tool, but clj complains that "Specified aliases are undeclared and are not being used: [...]".
deps.edn:
:tools/usage {:ns-default example.cli}
:aliases {:args/foo {:exec-args {:data-source-fn example-sources/foo, :data-source-args {:filename "foo-data"}}}
:args/bar {:exec-args {:data-source-fn example-sources/bar, :data-source-args {:filename "bar-data"}}}}
after installing the tool, I assumed I could do either of the following:
$ clj -A:args/foo -Texample do-something
$ clj -A:args/bar -Texample do-something
... and example.cli/do-something would be called with a map containing the keys :data-source-fn and :data-source-args, but clj whines about :args/foo and :args/bar. the following, however, work (with appropriate quoting, I'm typing these from memory):
$ clj -Texample do-something :data-source-fn example-sources/foo :data-source-args {:filename "foo-data"}
$ clj -Texample do-something :data-source-fn example-sources/bar :data-source-args {:filename "bar-data"}
shouldn't the -A option cause the map from :exec-args to be merged? am I misunderstanding -A/`:exec-args`?What does clj -version say?
sean@sean-win11-desk:~/clojure$ clj -A:a/b -T:c/d
{:a 1, :b 2}
sean@sean-win11-desk:~/clojure$ fgrep :exec deps.edn
:a/b {:exec-args {:a 1 :b 2}}
:c/d {:exec-fn clojure.core/println}I agree with your expectation that this should work, not sure if something misaligned or bug
can you clarify what this means "clj whines about :args/foo and :args/bar "?
@mbarillier said Specified aliases are undeclared and are not being used: [...]".
So running clojure -X:deps aliases would probably help diagnose here too...
version is 1.11.3 "should work" is different than "it doesn't work that way" or that one specific bit is obviously wrong, I've got something borked. will fix, thx ...
If it says the aliases are not declared then maybe you're not running the clj command in the folder containing that deps.edn file?
(aliases are not transitive, BTW, so if they are in the tool's deps.edn file rather than yours, the CLI will not see them -- aliases come from just three places: the root, built into the CLI, the user, and the project)