Skip to content

Document and enforce that just recipe arguments are positional - #442

Merged
ciaranra merged 2 commits into
devfrom
docs/just-positional-args
Aug 6, 2026
Merged

Document and enforce that just recipe arguments are positional#442
ciaranra merged 2 commits into
devfrom
docs/just-positional-args

Conversation

@ciaranra

@ciaranra ciaranra commented Aug 5, 2026

Copy link
Copy Markdown
Member

just --list prints each recipe as a signature (build profile="debug"), which reads like call syntax. Typing just build profile=release therefore passes the literal string profile=release as the positional argument.

Verified behavior against just 1.45.0 with a scratch justfile:

command result
just say release word=[release]
just say word=release word=[word=release] (positional, not an override)
just word=release say error: Variable \word` overridden on the command line but not present in justfile`
just greeting=yo say greeting=[yo] (real override, before the recipe name)
just say greeting=yo word=[greeting=yo] (even a real variable name is consumed positionally)

Documentation

  • Three-line note in the default recipe output, immediately above the recipe list where the signatures appear.
  • New "Passing arguments to a recipe" section in docs/development/dev-tools.md, next to its existing just build release example.

Diagnostic fixes

  • python-ci-core and python-ci-smoke delegated profile validation to their build dependency, so a bad profile recommended the dependency's name (just python-ci-build-test release) instead of the recipe the user invoked. Both now validate directly.
  • bench checked each slot only against its own parameter name, so just bench release pattern=foo bound pattern=foo to features and reached cargo as --features pattern=foo. Each slot now rejects every parameter name.

All cases exercised:

$ just bench release pattern=foo
Invalid features argument: pattern=foo
Just recipe parameters are positional. Use: just bench release '' 'foo'

$ just bench release '' features=simd
Invalid pattern argument: features=simd
Just recipe parameters are positional. Use: just bench release 'simd'

$ just python-ci-core profile=release
Invalid profile argument: profile=release
Just recipe parameters are positional. Use: just python-ci-core release

Not changed: just julia-build rustflags="-C ..." puts rustflags=... in the profile slot, which already fails loud with Unknown profile: rustflags=-C .... No silently-wrong behavior there.

@ciaranra ciaranra changed the title Document that just recipe arguments are positional Document and enforce that just recipe arguments are positional Aug 5, 2026
@ciaranra
ciaranra merged commit e0f544c into dev Aug 6, 2026
33 checks passed
@ciaranra
ciaranra deleted the docs/just-positional-args branch August 6, 2026 02:41
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