casey / casey/just

Running multiple recipes with default arguments

Open
#1,556 19 comments 4 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
35.8k
Forks
846
Avg merge
27m
Merged PRs (30d)
3

Description

When invoking multiple receipts (which is **not a documented feature in the Readme**), the commands and arguments are ambiguous. Given this justfile:

```just
backup file="default":
@echo backup {{file}}
exit 0

restore file="default":
@echo restore {{file}}
exit 0

test:
@echo testing
exit 0
```

The following behavior can be observed:

```bash
$ just backup
backup default
exit 0

$ just test backup
testing
exit 0
backup default
exit 0

$ just backup test
backup test
exit 0
```

I would _like_ the last invocation to call the `backup` receipt with its default parameter and then (when successful) the `testing` receipt.

Instead, the second argument is interpreted as the parameter to the `backup` task. A solution for this _inside the justfile_ is documented in the Readme: https://github.com/casey/just#recipe-parameters

> To pass arguments to a dependency, put the dependency in parentheses along with the arguments:

Is there something similar for the invocation via the CLI?

Contributor guide

Open the contributing guide

Research direction

The issue points to the README's recipe-parameters section and to invoking multiple recipes through the CLI. Start by tracing how positional arguments are assigned when multiple recipe names are supplied; done means the intended default-argument behavior is defined, implemented, and documented with CLI coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.