Skip to content

sg: better output when using 'sg live' wrong

Warren Gifford requested to merge mrn/sg-live-qol into main

Created by: mrnugget

Before this change sg live would print the helptext for sg on error. That output is not only super long and hides the error, but it also doesn't tell you anything about sg live.

So I changed the error handler to print the helptext for subcommands, which is what we want in 99% of cases, I think, since sg itself is not a useful command, only its subcommands.

I also changed the error output of sg live to be a bit more consistent and more helpful.

Before

screenshot_2022-05-23_14 31 20@2x

After

screenshot_2022-05-23_14 32 07@2x

Test plan

  • Tested locally with go run . live cloud and go run . live dotcom

Merge request reports

Loading