Skip to content

Support positional variadic task arguments. - #19

Merged
samuel-williams-shopify merged 1 commit into
mainfrom
feature/positional-variadic-arguments
Oct 5, 2026
Merged

samuel-williams-shopify merged 1 commit into
mainfrom
feature/positional-variadic-arguments

Conversation

@samuel-williams-shopify

Copy link
Copy Markdown
Contributor

Allow task authors to define a Vec<T> as an unbounded positional argument list. This lets project commands accept natural argument lists such as cargo bake markdown:normalize **/*.md.

Previously, Vec<T> parameters were only available as repeatable named options. The new #[bake(positional)] annotation makes bare values fill a Vec<T> through the end of that task invocation. Since the parser cannot infer whether a later bare value is another task or another list item, callers use :: to start the next task. Named options remain usable alongside the positional list.

The macro validates the annotation and requires the variadic parameter to be the final positional parameter. Task help and author documentation describe the new syntax and chaining rule.

@samuel-williams-shopify
samuel-williams-shopify merged commit 922b98d into main Oct 5, 2026
6 checks passed
@samuel-williams-shopify
samuel-williams-shopify deleted the feature/positional-variadic-arguments branch October 5, 2026 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant