casey / casey/just

FEAT: Make printing recipe listing include recipe arguments as well

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

Description

Feature Request:
- Make recipe listing include ARG options as well...
- Format ARG options display to match recipe doc style

```justfile
# Do some test stuff
[arg("MYVAR",short="f",value="booya",help="somehelp")]
test MYVAR:
echo {{ if "foo" == MYVAR { "yeah" } else { "nope" } }}
echo {{ MYVAR }}
```

Currently, assuming `set default-list := true` (or someone did `just --list`)

```sh
# just
Available recipes:
test [OPTIONS] # Do some test stuff
#
# just --usage test
Usage: just test [OPTIONS]
Options:
-f somehelp
```

What I'm suggesting is to print the options together with the list:

```sh
# just
Available recipes:
test [OPTIONS] # Do some test stuff
-f somehelp
```

Also, the options doc message should be styled the same way as the recipe's.. There should be a `#` before the ARG help message right?

```sh
Options:
-f # somehelp
```

in the same style as:

```sh
test [OPTIONS] # Do some test stuff
```

Yes, adding the options to the listing could become very long, but I would argue that's the same as someone doing `just --help`. In this way, `set default-list := true` or `just --list` provides users with most everything they need to know in one single command/option, like `just --help`. `just --usage` can remain for people who need to know more about the usage of a specific recipe they are targeting.

Just an idea.. ^_^

Ref orig discussion: https://github.com/casey/just/issues/3510

Contributor guide

Open the contributing guide

Research direction

Start with the recipe-listing path used by `set default-list := true` and `just --list`, then compare its output with the `--usage` path for recipe arguments. The work is done when ARG options appear beneath each listed recipe with matching formatting, including the proposed `#` before help text, while `just --usage` retains its specific-recipe role.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
66/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.