Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Commit

Permalink
clarify usage; don't silently discard extra args
Browse files Browse the repository at this point in the history
The usage tripped me up - I thought I could omit `-run` even when altering the command to execute. 
Because the extra args were silently discarded, it took me a while to realize what was happening.
  • Loading branch information
mark-pictor-csec authored and mvdan committed May 25, 2022
1 parent 9763df9 commit 930bfd6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ To catch a run-time error/crash entering main:
To catch a build error/crash with custom build flags:
goreduce -match 'internal compiler error' . 'go build -gcflags "-c=2"'
goreduce -match 'internal compiler error' -run 'go build -gcflags "-c=2"' .
Note that you may also call a script or any other program.
`)
Expand All @@ -51,7 +51,7 @@ Note that you may also call a script or any other program.
func main() {
flag.Parse()
args := flag.Args()
if len(args) < 1 || *matchStr == "" {
if len(args) != 1 || *matchStr == "" {
flag.Usage()
os.Exit(2)
}
Expand Down

0 comments on commit 930bfd6

Please sign in to comment.