docs(cli): make command descriptions state what the command does - #61
Merged
Merged
Conversation
The help text had drifted into explaining itself. profile's description
was the clearest case -- it recited which kinds it queries and then
argued why it doesn't behave like find, which is the reasoning behind
the command rather than a description of it.
Rewritten flatter throughout, closer to how docker's CLI reads: say what
the command does, state the rules a caller can't guess ("--targets
cannot be combined with --relays"), and drop the rationale. Short lines
lose their parentheticals and "(s)" plurals.
Also fixes the error that prompted this. "ncli relay" with no config
printed three alternatives crammed into one line and nothing else:
Error: no relay config found -- pass --config, run "ncli relay context
use <name>", or add ncli.yaml/relay.yaml here
It now prints a short error and then the command's own help, so the
flags and examples are right there, and the config search order moved
into the description where it belongs. The admin subcommands missing
nip11.privkey get the same treatment. Exit code and --json output are
unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The help text had drifted into explaining itself rather than describing the command.
profilewas the clearest case — it recited which kinds it queries, then argued why it doesn't behave likefind. That's the reasoning behind the command, not a description of it.Rewritten flatter throughout, closer to how docker's CLI reads: say what the command does, state the rules a caller can't guess, drop the rationale.
Before
After
The same pass across all 37
Longblocks and everyShort:--targetscannot be combined with--relaysor the inline filter flags" rather than "pick one, not both".Shortlines lose parentheticals and(s)plurals: "Upload one or more files to your Blossom server(s)" → "Upload files to your Blossom servers"; "List recently resolved requests (approved/rejected/expired)" → "List recently resolved signing requests".The error that prompted this
ncli relaywith no config printed three alternatives crammed into one line, and nothing else:Now:
The error is short, the help carries the how, and the config search order moved into the description where it belongs. The
relayadmin subcommands missingnip11.privkeyget the same treatment.Exit code and
--jsonare unchanged — still exit 2 /{"code":"usage"}with no help dump, verified.Verification
gofmt,go build ./...,go vet ./...,go test -short -race ./..., golangci-lint v2.13.2 → 0 issues. No test asserts onShort/Longtext, and the help output was spot-checked per command.