Fork me on GitHub
Darrick Wiebe18:07:25

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.

👍 1
Darrick Wiebe18:07:18

Example usage:

aliases -s test
Filtering by substring:  test

Global keys:


Local keys:



That's cool. Perhaps it can also let you invoke the alias. Like:

aliases run :test/watch

Darrick Wiebe18:07:37

Yeah, there are lots of directions it could go. If people have ideas, it's a perfect beginner project.

Darrick Wiebe18:07:18

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 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

👍 1
Alex Miller (Clojure team)18:07:59

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


nice, didn't know that one yet

Darrick Wiebe18:07:34

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:
:test - Run tests

👍 1
Darrick Wiebe18:07:44

For that to be most useful, @U064X3EF3's tool would encourage such good behaviours! 😉

Alex Miller (Clojure team)19:07:57

if you want to file the suggestion at https;<//> 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