CLI: `<verb> --help` prints help but exits 1 (`help <verb>` exits 0)

Open Beginner friendly
#317 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
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
csharp
Domain
cli

Research direction

Start by locating the CLI handling for --help and the help <verb> command, then read the tests covering command help and exit codes. Reproduce the mismatch with motif apply --help and motif help apply; done means both forms exit 0 for every verb and a test confirms their exit codes match.

Written by the indexing model from the issue text.

Description

motif <verb> --help prints the help text but exits 1. motif help <verb> exits 0 for the same verb.

Seen on Motif 2b3292a41 (Linux) with motif apply --help. A build worker reported the same for baseline capture, assess, dry-run and trial. Agents and scripts probe a verb's capabilities with --help, for example to check that --no-background (#296) is offered before relying on it. Exit 1 reads as "this verb or flag does not exist", so a capability probe has to ignore the exit code and grep the text, or use the help <verb> form instead.

Expected: --help exits 0 when it prints help, as help <verb> does.

Next: make the --help path return 0 for every verb, and add a test that --help and help <verb> give the same exit code.

Evidence
  • bin/motif-2b3292a41/motif apply --help; echo $? → help text, then 1.
  • bin/motif-2b3292a41/motif help apply; echo $? → help text, then 0.
Dominant language
C#
Stars
1
Forks
0
Avg merge
4h 4m
Merged PRs (30d)
69

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

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 sillsdev/motif

All issues in sillsdev/motif

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.