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.
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 ofNimLogger (
logJSON`). There will be follow-on work to make more and more commands conform to the implied mandate of the flag.