-
Notifications
You must be signed in to change notification settings - Fork 29
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
MNT/DOC: parse valid json db, improve docstring #320
Conversation
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.
I think this looks correct to me. Is there any obvious way we can unit test this behavior?
I'll give unit tests a quick shot, surely there's some stdin mocking in click |
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.
this works great for me, thanks so much @tangkong
@tangkong consider using |
I think the test looks good, it would have caught this regression |
Description
happi update
command to handle json formatted similar to a valid json database.happi update
docstring (and by proxy help text) to better describe the use caseNow
happi update
can take JSON input that looks like a working json backend:Details
or a list of items in json form (original functionality):
Details
Usage is now described in the subcommand. One can either pipe input and tell happi to look at stdin:
cat my.json | happi update -
or use command substitution
happi update $(cat my.json)
Motivation and Context
#319
Click does not inherently read from stdin, we must explicitly tell it to. If we do this, piping output will work
How Has This Been Tested?
interactively
Where Has This Been Documented?
This PR
Pre-merge checklist
docs/pre-release-notes.sh
and created a pre-release documentation page