just icon indicating copy to clipboard operation
just copied to clipboard

[feature request] Allow filtering of `--choose` options by groups

Open leviable opened this issue 6 months ago • 3 comments

It would be nifty if you could pre-filter the options passed to the chooser using group attributes.

For instance, suppose I create a build recipe that prompted the user to pick a more specific recipe from the build group:

test:
  echo "Testing"

deploy:
  echo "Deploying"

[group("build")]
frontend:
  echo "Building frontend"

[group("build")]
backend:
  echo "Building backend"

build:
  @just --choose --choose-from-group build 

And then when the user runs just build the chooser prompt would only show the options frontend and backend.

Love the project. Thank you for taking the time to read this.

leviable avatar Jun 11 '25 17:06 leviable

I think this is reasonable. I would call the flag --choose-group just to be slightly less verbose.

casey avatar Jun 24 '25 07:06 casey

Whoops, didn't mean to close!

casey avatar Jun 24 '25 07:06 casey

Should --choose-group only take one arguments or be able to take for example a comma seperated list of groups ? According this section of just book one can add more than one group to a recipe.

Should it then only show recipes which is a member of all the given groups.

Example:

test:
  echo "Testing"


[group("build")]
deploy:
  echo "Deploying"

[group("build")]
[group("frontend")]
manual_frontend:
  echo "Building basic frontend"

[group("build")]
[group("frontend")]
user_frontend:
  echo "Building fanzy frontend"

[group("build")]
backend:
  echo "Building backend"

build:
  @just --choose --choose-from-group build,frontend

Should it then only show the options user_frontend and manual_frontend because both are a member of the group "build" and "frontend".

BoolPurist avatar Oct 14 '25 20:10 BoolPurist