magefile / mage

a Make/rake-like dev tool using Go
https://magefile.org
Apache License 2.0
4.01k stars 250 forks source link

Output Aliases when running `mage -l` #456

Open daegalus opened 1 year ago

daegalus commented 1 year ago

We use mage for a few projects, and noticed a minor discovery problem of the aliases we setup for our targets. While yes you can run mage -h target to see aliases, that's not an obvious command to know about.

I have added the output of Aliases and to what targetname they point to in the mage -l output. That way it is more easily discoverable.

If there are no aliases setup, the Aliases section won't show up. I used an actual go if block instead of as a template one as it made err variable management a bit simpler. But I can make adjustments if it is preferred.

No new tests were added as a bunch of existing tests would fail if Aliases always showed up, and the ImportLists test fails if it doesn't show up.

I can add additional tests if requested though.