mirror of
https://github.com/yannh/kubeconform.git
synced 2026-04-12 07:44:17 +00:00
Improve handling of cmdline errors (#91)
Improve handling of cmdline errors
This commit is contained in:
parent
607c90a0a9
commit
85b30f8c2a
2 changed files with 16 additions and 11 deletions
|
|
@ -4,7 +4,6 @@ import (
|
|||
"bytes"
|
||||
"flag"
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
)
|
||||
|
||||
|
|
@ -82,9 +81,7 @@ func FromFlags(progName string, args []string) (Config, string, error) {
|
|||
flags.BoolVar(&c.Help, "h", false, "show help information")
|
||||
flags.BoolVar(&c.Version, "v", false, "show version information")
|
||||
flags.Usage = func() {
|
||||
fmt.Fprintf(os.Stderr, "Usage: %s [OPTION]... [FILE OR FOLDER]...\n", progName)
|
||||
|
||||
flags.SetOutput(os.Stderr)
|
||||
fmt.Fprintf(&buf, "Usage: %s [OPTION]... [FILE OR FOLDER]...\n", progName)
|
||||
flags.PrintDefaults()
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue