nimbella / nimbella-cli

Your cloud. Beautiful.
https://nimbella.com
Apache License 2.0
10 stars 12 forks source link

Establish global --json flag, unify some uses #203

Closed joshuaauerbachwatson closed 2 years ago

joshuaauerbachwatson commented 2 years ago

The CLI is often used in scripts or in a dependent fashion (through the library interface) in which case a more structured form of output is desirable.

Some commands have a --json flag but one has to know which. With this change, there is a global --json flag so that flag will be accepted on every command.

Not all commands will respond to this flag by actually issuing JSON, so think of it as advisory. But, part of this PR is to make sure that all commands that do honor a --json flag are using the global one and are using the recommended method of NimLogger (logJSON`). There will be follow-on work to make more and more commands conform to the implied mandate of the flag.