Repository navigation
-? prints the usage, and the first of -?, -h and -V is the whole command, as in Graphviz - #161
Open
closer-claudio wants to merge 1 commit into
Open
closer-claudio wants to merge 1 commit into
closer-claudio wants to merge 1 commit into
Conversation
…and, as in Graphviz Graphviz's dot takes -? for its help: usage on standard output, exit 0. The command called it an unknown flag. It now takes -? as it takes -h (which Graphviz's dot does not have, and which stays). Graphviz's dot acts on -? and -V where it meets them and reads nothing after: `dot -? -Tnope` and `dot -V -Tnope` exit 0, `dot -Tnope -?` exits 1, `dot -V -?` prints the version. The command read the whole line first, so a bad flag anywhere won over the help, and -h won over -V wherever each stood. parseArgs now returns at the first of them. TestTheFirstOfHelpAndVersionIsTheWholeCommand holds seven orderings, each also run against the native dot under DOT_ORACLE (all seven agree with 16.1.1); the contract table gains -? and the orderings with their streams, TestParseArgs the same at the parser. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: closer-claudio <claudio@farcloser.world>
closer-claudio
enabled auto-merge
November 23, 2026 06:31
Contributor
Author
|
Reviewed at 8f5a5a1 |
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.
-?is the help flag of Graphviz'sdot, and the command did not take it: it called it an unknown flag. It now prints the usage on standard output and exits 0, as-hdoes (which Graphviz'sdotdoes not have, and which stays).The order of the flags follows Graphviz's
dottoo. That command acts on-?and-Vwhere it meets them and reads nothing after. Measured beside Graphviz's dot 16.1.1:-?-? -Tnope-V -Tnope-V -?-Tnope -?The command read the whole line first, so a bad flag anywhere won over the help, and
-hwon over-Vwherever each stood.parseArgsnow returns at the first of-?,-h,--help,-V,--version.Tests:
TestTheFirstOfHelpAndVersionIsTheWholeCommandholds seven orderings, each also run against the nativedotwhenDOT_ORACLEnames one (all seven agree with 16.1.1); the contract table gains-?and the orderings with their streams, andTestParseArgsthe same at the parser.Not here:
-Vstill prints this command's module version on standard output. Graphviz'sdotprintsdot - graphviz version …on standard error; following it needs the engine to say which Graphviz it embeds (forkcloser/go-graphviz#253) and comes after it.