This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
Hey, I like the idea of having a library of stuff available to me in my ~/.clojure/deps.edn
file, but I never remember the (ever-changing) aliases there. So I made this handy little bb script. Perhaps it'll be useful to some one else too. https://gist.github.com/pangloss/ca648ea996755347c6e86bd495f9d644
Example usage:
aliases -s test
Filtering by substring: test
Global keys:
:env/test
:lib/spec-test
:test/cljs
:test/cloverage
:test/cognitect
:test/kaocha
:test/kaocha-cljs
:test/kaocha-global
:test/kaocha-watch
:test/midje
:test/run
:test/watch
Local keys:
:test
That's cool. Perhaps it can also let you invoke the alias. Like:
aliases run :test/watch
Yeah, there are lots of directions it could go. If people have ideas, it's a perfect beginner project.
Anyone wants to adopt it and turn it into a project, please do so, just let me know so I can use it!
There's also https://github.com/babashka/cli which lets you turn arguments like --foo --dude 123
into {:foo true :dude 123}
automatically - perhaps useful when you want to build a nice shim over the -X stuff
btw, there is now clj -X:deps aliases
that will list all your aliases and where they're from, adding search there would be easy to do
It'd definitely be nice for that to be baked in and for this to be redundant.
Another idea. Darrick's script could also print a docstring provided by the user:
:aliases {:test {:doc "Run tests" ...}}
So the output would read:
Aliases:
:test - Run tests
For that to be most useful, @U064X3EF3's tool would encourage such good behaviours! 😉
if you want to file the suggestion at https;<//ask.clojure.org> that would be helpful to remember. I'd probably want a qualifier though. I am thinking about various self-documentation/help aspects of all this stuff when I have time for work on it