cmd/bundle: More idiomatic flag.Usage.
The responsibility of flag.Usage is to print usage to stderr: > Usage prints to standard error a usage message documenting all > defined command-line flags. Calling os.Exit(2) is outside of its scope, flag package does that. Change-Id: I3eef2b796e5ddedff6d5927dbcdbfff3a6082270 Reviewed-on: https://go-review.googlesource.com/23788 Reviewed-by: Joseph Holsten <joseph@josephholsten.com> Reviewed-by: Alan Donovan <adonovan@google.com>
This commit is contained in:
parent
682b241254
commit
5b59ce8b5f
|
@ -129,7 +129,6 @@ func addImportMap(s string) {
|
|||
func usage() {
|
||||
fmt.Fprintf(os.Stderr, "Usage: bundle [options] <src>\n")
|
||||
flag.PrintDefaults()
|
||||
os.Exit(2)
|
||||
}
|
||||
|
||||
func main() {
|
||||
|
@ -141,6 +140,7 @@ func main() {
|
|||
args := flag.Args()
|
||||
if len(args) != 1 {
|
||||
usage()
|
||||
os.Exit(2)
|
||||
}
|
||||
|
||||
if *dstPath != "" {
|
||||
|
|
Loading…
Reference in New Issue