Steve Moyer (smoyer64) opened
This tenet is stated as:
Expect the output of every program to become the input to another, as yet unknown, program. Don't clutter output with extraneous information. Avoid stringently columnar or binary input formats. Don't insist on interactive input.
This issue can includes four tasks:
- Make sure all output from packages other than
commandsis sent toStdErr. A perfect example of the correct way to inform a human user than an action has completed can be found at: https://github.com/MichaelMure/git-bug/blob/bc5f618eba812859bf87ce2c31b278bd518d4555/cache/repo_cache.go#L194. - Make sure that all output from the
commandspackage is properly split betweenStdErrandStdOutso that a human reader sees the full context of what has occurred but a program processing the output of the command is presented only with data that's easy for a machine to process. A great example of how this should be done can be found at: https://github.com/MichaelMure/git-bug/blob/bc5f618eba812859bf87ce2c31b278bd518d4555/commands/user_create.go#L73 - Add minimal tests for all CLI commands to verify the output text is correct.
- Make sure that all CLI commands that return errors also return a non-zero exit code. If a command is executed successfully, it should return a zero exit code.