linux-automation / usbsdmux

USB-SD-Mux Project - Driver and Documentation
GNU Lesser General Public License v2.1
66 stars 19 forks source link

Add JSON status output for all commands and errors #60

Closed SmithChart closed 11 months ago

SmithChart commented 11 months ago

This PR adds JSON output to all CLI commands, if the --json switch is set. If the command does not output anything: Return an empty message.

It also makes sure that error messages are output in JSON, if it is an Exception, that the CLI has already handled before. Thus the key error-message will be present if the return code is != 0.