Skip to content

Commit

Permalink
Refactor invalid flag handling to be more idiomatic.
Browse files Browse the repository at this point in the history
Remove os.Exit call from usage func.
  • Loading branch information
dmitshur committed Mar 9, 2015
1 parent 0d047bf commit 62c41d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions goe.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ func usage() {
fmt.Fprintln(os.Stderr, `Usage: goe [flags] [packages] [package.]function(parameters)
echo parameters | goe --stdin [flags] [packages] [package.]function`)
flag.PrintDefaults()
os.Exit(2)
}

var quietFlag = flag.Bool("quiet", false, "Do not dump the return values as a goon.")
Expand All @@ -60,7 +59,8 @@ func main() {
flag.Parse()

if flag.NArg() < 1 {
usage()
flag.Usage()
os.Exit(2)
return
}

Expand Down

0 comments on commit 62c41d7

Please sign in to comment.