Merge pull request #119 from github/silence-errors

ghcs: don't double-print errors
This commit is contained in:
Alan Donovan 2021-09-07 07:12:57 -04:00 committed by GitHub
commit 07300aeb38

View file

@ -19,8 +19,9 @@ func main() {
var version = "DEV"
var rootCmd = &cobra.Command{
Use: "ghcs",
SilenceUsage: true, // don't print usage message after each error (see #80)
Use: "ghcs",
SilenceUsage: true, // don't print usage message after each error (see #80)
SilenceErrors: false, // print errors automatically so that main need not
Long: `Unofficial CLI tool to manage GitHub Codespaces.
Running commands requires the GITHUB_TOKEN environment variable to be set to a
@ -43,5 +44,4 @@ func explainError(w io.Writer, err error) {
fmt.Fprintln(w, "Make sure to enable SSO for your organizations after creating the token.")
return
}
fmt.Fprintf(w, "%v\n", err)
}