just icon indicating copy to clipboard operation
just copied to clipboard

"just --list" should list fallback recipes

Open AngelEzquerra opened this issue 2 years ago • 5 comments

Now that fallback is stable, it seems that just --list should be aware and display fallback recipes, perhaps under a "fallback" section.

AngelEzquerra avatar Jan 12 '23 07:01 AngelEzquerra

Maybe just could show the fallback recipes it finds in “upper” justfiles as follows:

Available fallback recipes (../../justfile) task1 task2

Available fallback recipes (../../../../justfile) task3 task4

or perhaps the paths should be absolute?

AngelEzquerra avatar Jan 12 '23 18:01 AngelEzquerra

Would be great also in my use case. I have one main ~/projects/justfile containing some reusable recipes that are similar to most of my projects, like apply, plan etc. I have some projects that need additional recipes. For example in ~/projects/project-a/justfile contains build, deploy recipes and fallback param so I can call just apply for this project too. Sadly just --list does not show parent recipes so anybody that wants to know what recipes are available will get incomplete list.

piotrekkr avatar Aug 06 '24 08:08 piotrekkr

NOTE: we'll probably also need to:

  • update just --summary 🤔
  • update shell completers to list fallback recipes (and categorize them as such for shells that support this, like zsh)

bew avatar Dec 02 '24 01:12 bew

Maybe just could show the fallback recipes it finds in “upper” justfiles as follows:

Available fallback recipes (../../justfile) task1 task2 Available fallback recipes (../../../../justfile) task3 task4

or perhaps the paths should be absolute?

Perhaps a third option of the paths being relative to the root justfile (the one without fallback)

I'm thinking of examples like mono-repos where you might have a justfile in the root of the repo without fallback, and various sub-repo specific justfiles with fallback

cbrown1234 avatar Dec 19 '24 20:12 cbrown1234

Similarly, I think it could make sense for just --show recipe_from_parent_dir to succeed if recipe_from_parent_dir can be found via fallback. Currently the above gives the following:

error: Justfile does not contain recipe `recipe_from_parent_dir`.

jasha-hrp avatar Mar 24 '25 16:03 jasha-hrp