Use `cot` as the binary name in usage text for project commands

Open Beginner friendly
#679 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
70/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
rust
Domain
cli

Research direction

Start by comparing how project commands build their usage text on argument errors with how --help displays the binary name; the issue does not name specific files or tests. Reproduce the example with a project binary named m4txblog and run cot collect-static without the required directory. Done when the error usage line says cot collect-static <dir> while help output remains correct.

Written by the indexing model from the issue text.

Description

bug C-cli good first issue

When a project command ran with cot command fails because of invalid arguments, the usage line shows the project's binary name instead of cot. For example, in a project whose binary is m4txblog:

❯ cot collect-static
error: the following required arguments were not provided:
  <dir>

Usage: m4txblog collect-static <dir>

For more information, try '--help'.

However, --help correctly shows cot:

❯ cot collect-static --help
Collects all static files into a static directory

Usage: cot collect-static <dir>

Arguments:
  <dir>  The directory to collect the static files into

Options:
  -h, --help  Print help

Ideally, the error output should also use cot as the binary name, since that is the command the user actually ran.

See https://github.com/cot-rs/cot/pull/666#issuecomment-5873535644 for more info

Dominant language
Rust
Stars
1.1k
Forks
57
Avg merge
17h 39m
Merged PRs (30d)
12

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cot-rs/cot

All issues in cot-rs/cot

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.