Repository navigation
-V prints Graphviz's line, on standard error: "dot - graphviz version 16.1.1 (…)" - #163
Open
closer-claudio wants to merge 2 commits into
Open
closer-claudio wants to merge 2 commits into
closer-claudio wants to merge 2 commits 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>
… 16.1.1 (…)"
Graphviz's dot answers -V with one line on standard error and exits 0:
"dot - graphviz version 16.1.1 (20261108.1752)" is Homebrew's. The
command printed its own version alone on standard output ("v1.5.0", or
"(devel)"), so what reads the Graphviz release out of `dot -V`, as build
scripts and editors' plugins do, read nothing from it.
-V now prints that line, in that shape and on that stream: the Graphviz
release is the one the engine embeds, asked of the engine
(graphviz.Version, which go-graphviz has from adc5c5a, the version go.mod
now requires), and the parenthesis holds this command's version where
Graphviz's dot has its build date: "(forkcloser/dot v1.5.0)", "devel" for
a build with no version. Standard output has nothing. A version the
engine cannot give is an error and exit 1.
This breaks a caller that read the command's own version from standard
output.
TestVersionIsGraphvizsLine holds the line's shape, the stream and the
exit, that the release is the one the engine is pinned to, and, under
DOT_ORACLE, that the native dot's line has the same shape and the same
major and minor release. The contract table's -V rows expect the line on
standard error and nothing on standard output.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: closer-claudio <claudio@farcloser.world>
Contributor
Author
|
Reviewed at 861f381 |
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.
Graphviz's
dotanswers-Vwith one line on standard error and exits 0:dot - graphviz version 16.1.1 (20261108.1752)is Homebrew's. This command printed its own version alone on standard output (v1.5.0, or(devel)), so what reads the Graphviz release out ofdot -V, as build scripts and editors' plugins do, read nothing from it.-Vnow prints that line, in that shape and on that stream:The Graphviz release is the one the engine embeds, asked of the engine (
graphviz.Version, which go-graphviz has since forkcloser/go-graphviz#253;go.modrequires that commit). The parenthesis holds this command's version where Graphviz'sdothas its build date,develfor a build with no version. Standard output has nothing. A version the engine cannot give is an error and exit 1.Breaking: a caller that read the command's own version from standard output now finds it in the parenthesis of the line on standard error.
Tests:
TestVersionIsGraphvizsLineholds the line's shape, the stream and the exit, that the release is the one the engine is pinned to, and, underDOT_ORACLE, that the nativedot's line has the same shape and the same major and minor release. The contract table's-Vrows expect the line on standard error and nothing on standard output.Stacked on #161, whose commit this page shows until that one merges.