New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: remove --json-output flag from logs
command, fixes #962
#5695
fix: remove --json-output flag from logs
command, fixes #962
#5695
Conversation
Download the artifacts for this pull request:
See Testing a PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Run
ddev help logs
andddev logs -h
- the--json-output
flag shouldn't be shown as an option.
Tried these, the flag is hidden as described.
And I found another edge case, that doesn't really matter: --json-output
is still there when you pass a wrong flag to ddev logs
like this ddev logs --foobar
.
Oh! That's unexpected... I wonder where that's getting its output from. I presume that same thing is happening for custom commands as well then (presumably not for composer - I bet that's handled differently). I'll spend some time trying to figure out where that's coming from. |
24a513b
to
343765a
Compare
Turns out that's an entirely separate function called This doesn't need to be done for composer or for custom commands, because flag parsing isn't handled by cobra for those (everything is just passed straight through, it seems) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, a great study of Cobra's capabilities.
The Issue
ddev logs
doesn't support JSON formatted output, and there's no clear way to add that functionality given the way the logs are currently fetched and outputted.This is discussed in #962
How This PR Solves The Issue
We don't display the flag when running
ddev help logs
orddev logs -h
.This is the same way this is handled for the composer command (see composer.go) and custom commands (see commands.go)
Manual Testing Instructions
Run
ddev help logs
andddev logs -h
- the--json-output
flag shouldn't be shown as an option.Automated Testing Overview
No automated tests added - I couldn't find associated tests for composer or for custom commands so it didn't seem sensible to add them for this.
Related Issue Link(s)
#962
Release/Deployment Notes
Doesn't affect deployments.