casey / casey/just

Feature request: attributes "[no-stderr]" and "[no-stdout]"

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

Description

## Problem

The syntax for piping an error to `/dev/null` and throwing a custom error is somewhat ugly at the moment:

```just
my-recipe:
run-my-command \
2>/dev/null || { echo "❌ Command failed - blah blah"; exit 1; }
```

## Solution

It would be super helpful if Just provided two new attributes, `[no-stderr]` and `[no-stdout]`, which could be used like this:

```just
# The string in the ("") is what gets thrown when there is an exit status (code 1)
[no-stderr("❌ Command failed - blah blah")]
my-recipe:
run-my-command
```

```just
# The string in the ("") is what gets thrown when there is an exit status (code 1)
[no-stdout("✅ Command worked - blah blah")]
my-recipe:
run-my-command
```

> [!NOTE]
> This attribute wouldn't ignore error codes. It would simply ignore the `stderr` output and throw another error instead.

Contributor guide

Open the contributing guide

Research direction

The issue names no files, tests, or entry points. Start by tracing how existing recipe attributes are handled; done means the proposed [no-stderr(...)] and [no-stdout(...)] forms support the documented output and failure behavior.

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.