aboutsummaryrefslogtreecommitdiff
path: root/coremain
diff options
context:
space:
mode:
authorGravatar Miek Gieben <miek@miek.nl> 2017-06-20 12:01:10 -0700
committerGravatar GitHub <noreply@github.com> 2017-06-20 12:01:10 -0700
commit9e463e0bca3f7c4275150dd36d1d4a020293ff90 (patch)
tree11b6c1acb85c42ba61a54e251e8ec000cda706f1 /coremain
parent3c6964ac9d310241f892e606427d57c41591d668 (diff)
downloadcoredns-9e463e0bca3f7c4275150dd36d1d4a020293ff90.tar.gz
coredns-9e463e0bca3f7c4275150dd36d1d4a020293ff90.tar.zst
coredns-9e463e0bca3f7c4275150dd36d1d4a020293ff90.zip
core: errors on junk in the command line (#744)
We would silently ignore anything that we couldn't parse on the command line, this change make this an error. Fixes #743
Diffstat (limited to 'coremain')
-rw-r--r--coremain/run.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/coremain/run.go b/coremain/run.go
index 85024efcc..837a51c77 100644
--- a/coremain/run.go
+++ b/coremain/run.go
@@ -60,6 +60,10 @@ func Run() {
flag.Parse()
+ if len(flag.Args()) > 0 {
+ mustLogFatal(fmt.Errorf("extra command line arguments: %s", flag.Args()))
+ }
+
// Set up process log before anything bad happens
if logfile {
log.SetOutput(os.Stdout)