Ability to filter projects by target from the command line
Is your feature request related to a problem? Please describe
targets are a useful way to define named groups of projects, for example all projects with a certain set of tags. However, I believe that currently those targets can only be referenced "statically" in the Mani config for a task, to control which projects that task applies to.
It would be useful to be able to select the projects to operate on from the command line when executing mani, referencing the targets defined in the Mani config.
Describe the solution you'd like
In much the same way that mani currently supports selecting the projects to operate on via the --projects, --paths and --tags command line arguments, it could have a --targets option to reference the targets declared in the config and run the specified tasks/commands on those projects, eg when using the run or exec command.
Additional context
A similar case could be made for specs, which are named groups of config that alter task execution and output. It would be handy to have a --spec command line argument for mani, to select which spec to apply.
Great idea, it's available in sake as well. I don't have time to implement this now, but feel free to open up a pull request, it shouldn't be too hard to implement it.
Relevant code:
https://github.com/alajmo/mani/blob/main/cmd/run.go#L112C1-L121C24 https://github.com/alajmo/mani/blob/main/core/dao/task.go#L276 https://github.com/alajmo/mani/blob/main/core/dao/project.go#L292
Hi @alajmo - thanks for getting back to me and providing the starting context. If I get some time I'll take a look at this, cheers 👍
It's added now as of 0.30.0