casey / casey/just

Ordering of tasks from main Justfile and from imports.

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

Description

Originally posted by **gl-yziquel** May 26, 2024
Hi.

I've got a use case that seems to go counter to current Just behavious, and, as suggested on a bug report discussion, I (or we) would welcome user feedback. So please share your thoughts.

Original bug report: https://github.com/casey/just/issues/2076

I want to be able to control the listing of tasks, with `just --list --unsorted`. And would like to be able to do the following:

```just
import "task1.just"

task2:
echo Task 2

import "task3.just"

task3:
echo Task 4

[private]
@help:
just --list --unsorted --justfile "{{ justfile() }}"
```

I would like the output of `just help` to be as follows:

```console
Available recipes:
task1
task2
task3
task4
```

That would allow me to control precisely the ordering of the display of just recipes.

Currently, the behaviour of Just is to render the recipes of the current Justfile first, and the imports later. Like that

```console
Available recipes:
task1
task3
task2
task4
```

As my use case would require a "breaking" change of current behaviour, user feedback would be appreciated.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.