Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I list all of my aliases in `iex`?

Tags:

elixir

Sometimes I forget what I've previously aliased via alias in an iex session.

I can check by simply entering the alias I want to use, e.g. iex(314)> SomeName, or the default for multi-part module names, but it'd be also be nice to see any other 'non-standard' aliases I've already setup.

like image 522
Kenny Evitt Avatar asked Jan 19 '26 03:01

Kenny Evitt


1 Answers

Run __ENV__.aliases:

iex(92)> __ENV__.aliases
[
  {Repo, SomeProject.Repo},
  {Customer, SomeProject.Customer},
  {Merchant, SomeProject.Merchant},
  {Util, SomeProject.Integration.Util}
]

More info:

  • Macro.Env — Elixir v1.9.2
like image 139
Kenny Evitt Avatar answered Jan 22 '26 20:01

Kenny Evitt



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!