Consider an absent `:prog` for command help
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 74/100
Research direction
Start with the cli/dispatch path that formats help output when no :prog option is supplied, using the reproduction in the issue. Check the generated Usage and Run lines, then add regression coverage for the absent-program case. Done means both lines omit the unwanted extra space while the existing command help remains unchanged.
Written by the indexing model from the issue text.
Description
Scenario
Sometimes a program does not have a clear usage name.
For example, a program might be invoked via clojure -M:cli <some-command> [some-options].
In these cases, I don't specify :prog as a dispatch option.
bb cli lets me do this, but it results in an (admittedly nitpicky) output formatting issue.
Repro
For example:
(require '[babashka.cli :as cli])
(cli/dispatch {:cmd {"foo" {:fn identity
:doc "foo command help"}}}
["--help"]
{:help true})
Outputs:
Usage: [options] <command>
Commands:
foo foo command help
Options:
-h, --help Show this help
Run " <command> --help" for more information on a command.
It's a minor quibble, but notice the extra space before [options] in Usage: [options].
And after Run " on the last line.
Proposal
If :prog is not specified, don't display an extra space character in formatted outputs.
Next
Happy to do up a PR if this seems interesting to you.
- Dominant language
- Clojure
- Stars
- 293
- Forks
- 22
- Avg merge
- 13m
- Merged PRs (30d)
- 11
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
-
.Team/Metabot Priority:P3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
needs triage
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
scalar-labs/scalar-jepsen#222 · 1 comment ·