Skip to content

Commit

Permalink
Pull request 388: fix-non-flag-args
Browse files Browse the repository at this point in the history
Merge in GO/dnsproxy from fix-non-flag-args to master

Squashed commit of the following:

commit 83586f3
Author: Stanislav Chzhen <[email protected]>
Date:   Tue Jan 14 20:15:34 2025 +0300

    cmd: imp err msg

commit 0d7a065
Author: Stanislav Chzhen <[email protected]>
Date:   Tue Jan 14 19:58:03 2025 +0300

    cmd: fix non-flag args
  • Loading branch information
schzhn committed Jan 14, 2025
1 parent 712d38b commit 429c98c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/cmd/args.go
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,12 @@ func parseCmdLineOptions(conf *configuration) (err error) {
return err
}

nonFlags := flags.Args()
if len(nonFlags) > 0 {
return fmt.Errorf("positional arguments are not allowed, please check your command line "+
"arguments; detected positional arguments: %s", nonFlags)
}

return nil
}

Expand Down

0 comments on commit 429c98c

Please sign in to comment.