Repository navigation
Let ccrawl version render as data - #151
Merged
Merged
Conversation
The handler wrote to stdout directly and never touched the renderer, so -o did nothing and a CI job that wanted the commit had to write a regular expression against a line whose format is documented nowhere. ccrawl version -o json | jq -r .commit auto keeps the sentence, in a pipe as well as on a terminal. Every other command switches to JSON Lines when piped; this one does not, because that line is what ccrawl version has always printed and asking for a format is how you say you want data instead. --short is untouched.
34 tasks done
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.
Closes #150.
versionwrote its line to stdout directly and never touched the renderer, so-odid nothing:Six facts in a sentence, and a CI job that wants one of them has to write a regular expression against a format documented nowhere.
After
What deliberately did not change
-o auto, the default, keeps the sentence, and keeps it in a pipe as well as on a terminal. Everywhere else auto means a table for a person and JSON Lines for a pipe, and following that here would turnccrawl version | grepinto a different string for everyone who already has it in a script. Asking for a format is how you say you want data. The test pins this, and a test run is a pipe, so it is the case that would have broken.--shortis untouched.Why the other bare-value commands were left alone
This turned up in a sweep of the local commands after #140, so it is worth saying what else the sweep found and why nothing else moved.
cache dir,library path, andconfig geteach print one string. Wrapping one string in a JSON object helps nobody and would breakcd "$(ccrawl cache dir)".versionis different because it is a record wearing a sentence.Checks
gofmt,go vet,go test ./...,docs-drift.sh,coverage.sh,golangci-lint run ./...versionand--shortunchangeddocs/content/reference/cli.mdgains aversionsection, which it did not have beyond a row in the command table.