technomancy / leiningen

Moved to Codeberg; this is a convenience mirror
https://codeberg.org/leiningen/leiningen
Other
7.29k stars 1.61k forks source link

lein aliases shadow help entirely #2197

Open timvisher opened 8 years ago

timvisher commented 8 years ago

I believe there's no way to get help for a task once you've aliased its name. This could be considered bad practice but it's also quite useful. Could there be a way for help maybe to print both the aliases and the usage? Or maybe provide a second lein alias sub-command akin to alias in bash?

https://gist.github.com/timvisher/36a5ddfcb9f903cdc408a739d99a46fe

hypirion commented 8 years ago

I like the idea of having the alias help first, then information telling you that it shadows a proper task, along with its docstring. That should probably also work when you do lein help without any arguments.

e.g.

...

These aliases are available:
repl: Start a REPL with some extra useful dependencies added.
  This alias shadows the repl task:
  repl        Start a repl session either with the current project or standalone.
eval: Evaluate a Clojure string with clojure.main/main.

...

Happy to take a patch for this

firesofmay commented 7 years ago

@hyPiRion Isn't this done already? I tried it with Leiningen 2.7.1 on a sample project which has the following alias :aliases {"test-all" ["test"]}

$ lein help test-all
test-all is an alias, expands to ["test"]

It looks like its already patched. Can you confirm? If done can you close this issue? Thanks.

danielcompton commented 7 years ago

@firesofmay, I think what is being described is that if someone aliases test, there is no longer a way to get help on the original built-in test command with lein help test.

timvisher commented 7 years ago

@danielcompton correct.

firesofmay commented 7 years ago

@danielcompton Ah I see. How would I go about fixing this? Can you guide me to the namespaces I should look at?