- log := &plainLogger{w: stderr}
- var buf []byte
- if *configFile == "-" {
- buf, err = ioutil.ReadAll(stdin)
- } else {
- buf, err = ioutil.ReadFile(*configFile)
- }
- if err != nil {
- return 1
- }
- withoutDepr, err := load(bytes.NewBuffer(buf), log, false)
+
+ // Load the config twice -- once without loading deprecated
+ // keys/files, once with -- and then compare the two resulting
+ // configs. This reveals whether the deprecated keys/files
+ // have any effect on the final configuration.
+ //
+ // If they do, show the operator how to update their config
+ // such that the deprecated keys/files are superfluous and can
+ // be deleted.
+ loader.SkipDeprecated = true
+ loader.SkipLegacy = true
+ withoutDepr, err := loader.Load()