Skip to content

Commit 16bc1fb

Browse files
dmullisdmullis
authored andcommitted
Bug #38: CLI does not complain about unexpected non-flag arguments
1 parent 9828fa7 commit 16bc1fb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

cmd/goat/main.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ func main() {
3838
See https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme
3939
`)
4040
flag.Parse()
41+
if flag.NArg() > 0 {
42+
log.Fatalf("Superfluous arguments found on command line: %v", flag.Args())
43+
}
4144

4245
input := os.Stdin
4346
if inputFilename != "" {

0 commit comments

Comments
 (0)