casey / just

🤖 Just a command runner
https://just.systems
Creative Commons Zero v1.0 Universal
19.86k stars 447 forks source link

Suggestion: Listing of groups #2195

Open Spatenheinz opened 2 months ago

Spatenheinz commented 2 months ago

In v.1.29.1, I can do something like just --list <submodule_name> and see the recipes for a given submodule. It would be great if I could do something along the lines of just --list <group> to see all the available recipes for a certain group. The actual syntax should indeed be considered as simply stating a group could name-clash with submodule names.

I am unsure if the interface is stable, but I personally enjoy a git similar approch with just --group <group_name>, but to unify a common interface then I guess also submodules should be just --submodule <submodule_name>.

casey commented 2 months ago

just --group <group_name> is an option, although I think it would be unfortunate if we added another subcommand for listing recipes, and didn't reuse --list, since they would both be such similar commands. Some way of disambiguating would likely be awkward though, for example a prefix: just --list group:NAME / just --list @NAME.

I think it would probably be fine to just use just --list, and if there is a conflict between a group and a submodule, display one or the other, probably defaulting to the submodule. If users don't want that behavior, then it's easy enough to rename either the submodule or the group so that it's unambiguous.