From 5fabd0233d3bcec1a7b219978ff2d7758fc859f6 Mon Sep 17 00:00:00 2001 From: vx-clutch Date: Sun, 28 Dec 2025 16:38:40 -0500 Subject: [PATCH] fix: print usage to err instead of out --- main.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/main.go b/main.go index b54d3a7..5d993f9 100644 --- a/main.go +++ b/main.go @@ -34,13 +34,13 @@ func init() { func main() { flag.Usage = func() { fmt.Fprintf(flag.CommandLine.Output(), "Usage: %s [options] \n", os.Args[0]) - fmt.Println("Commands:") - fmt.Println(" new Create a new project") - fmt.Println(" doc Open documentation") - fmt.Println(" run Start the server") - fmt.Println("Options:") + fmt.Fprintf(os.Stderr, "Commands:") + fmt.Fprintf(os.Stderr, " new Create a new project") + fmt.Fprintf(os.Stderr, " doc Open documentation") + fmt.Fprintf(os.Stderr, " run Start the server") + fmt.Fprintf(os.Stderr, "Options:") flag.PrintDefaults() - fmt.Println("For bug reports, contact a developer and describe the issue. Provide the output of the `-V1` flag.") + fmt.Fprintf(os.Stderr, "For bug reports, contact a developer and describe the issue. Provide the output of the `-V1` flag.") } showVersion := flag.Bool("version", false, "Show version and exit")