Skip to content

Validate task args #3535

@bollwyvl

Description

@bollwyvl

Problem description

per #3533 (comment):

I would love if args also had a richer model to help projects write maintainable, self-documenting tasks:

[tasks.foo-one--]
cmd = "echo built {{ bar }} > bar/{{ bar }}.txt"
args = [
  { "arg" = "bar", default = "baz", description = "the foo to bar", enum=["baz", "boo"], regex="(baz|boo)" }
]

These would be lovely to see in a pixi task help foo, and give good feedback:

$> pixi r foo-one-- --bar poo

`foo-one--` argument `--bar` (the foo to bar) to was `poo`, but should be:
- one of `baz`, `boo`
- match the pattern `(baz|boo)`

Use `pixi task help foo-one--` to learn more.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions