block / block/buzz

global --format after a subcommand fails with an unhelpful clap error

Open
#6,391 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
32.7k
Forks
4.3k
Avg merge
1d 13h
Merged PRs (30d)
253

Description

## Repro (stock CLI v0.5.2)

`buzz --help` documents global `--format json|compact`.

This works:

```
buzz --format json messages get --channel --limit 1
```

This fails:

```
buzz messages get --format json --channel --limit 1
```

Error:

```
error: unexpected argument '--format' found
Usage: buzz messages get [OPTIONS] --channel
```

The failure is wrapped as JSON `user_error` and still exits 0.

## Expected

Either accept `--format` after the subcommand, or say it is a global flag that must precede the subcommand (and exit nonzero).

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.