-
Notifications
You must be signed in to change notification settings - Fork 19
Add JSON format for account show and rofl machine show
#677
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
Conversation
✅ Deploy Preview for oasisprotocol-cli ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
1d0ac28 to
caa5bd3
Compare
oasis account showaccount show and rofl machine show
| cobra.CheckErr("Machine instance not found.\nTip: This often happens when instances expire. Run `oasis rofl deploy --replace-machine` to rent a new one.") | ||
| switch common.OutputFormat() { | ||
| case common.FormatJSON: | ||
| fmt.Printf("{ \"error\": \"%s\" }\n", err) |
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.
cobra.CheckErr in the other case also exits the program, while this one doesn't?
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.
It exits later in L74. Here it only prints the error to stdout in JSON, so you can capture and process it.
6a6f8a5 to
65a8648
Compare
65a8648 to
5490548
Compare
This makes it possible to use the Oasis CLI for automation.