feat(cmd): -v and --version, the spellings people type - #14
Merged
Merged
Conversation
`ditto version` shipped in 0.8.0 and answers only its long forms. Nothing new is reported here; the point is that a tool which makes you look up how to ask its simplest question has not really answered it. Safe at this level rather than lucky: subcommands parse their flags with their own FlagSet, and Go's flag package does no prefix matching, so `ditto run -v` never resolved to -verbose and still does not -- it reports an undefined flag, exactly as before. Checked by running the binary, not only the suite.
|
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.



ditto versionshipped in 0.8.0 and answers onlyversion,-versionand--version. This adds-v.Nothing new is reported. The point is that a tool which makes you look up how to
ask its simplest question has not really answered it.
Why it does not collide with
-verboseSubcommands parse their flags with their own
FlagSet, and Go'sflagpackagedoes no prefix matching, so
-vnever resolved to-verbose. Verified byrunning the binary:
Both behaviours are the ones that were there before; only the top-level dispatch
gained a case.
Checks
TestVersion, and the binary built and run foreach of them.
livetreecounters, lint0 issues.mutantsPerReleaseOnThisRepositoryunchanged at 785: aswitchcase adds nomutable expression.