From 310e43ea40126d7ee88156bb9262e4d796c9698f Mon Sep 17 00:00:00 2001
From: Eva Schiffer <evas@ssec.wisc.edu>
Date: Mon, 11 Oct 2021 15:34:08 -0500
Subject: [PATCH] adding warning when we are ignoring variables requested on
 the command line because we have a config file

---
 pyglance/glance/compare.py          | 6 ++++++
 pyglance/glance/config_organizer.py | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/pyglance/glance/compare.py b/pyglance/glance/compare.py
index 64c58e8..1878fb7 100644
--- a/pyglance/glance/compare.py
+++ b/pyglance/glance/compare.py
@@ -1764,6 +1764,12 @@ def main():
         # organize our command line options
         tempOptions = config_organizer.convert_options_to_dict(options)
 
+        # if there are requested variables and a config file, warn the user that we're going to ignore their request
+        if len(variables) > 0 and tempOptions[OPTIONS_CONFIG_FILE_KEY] is not None :
+            LOG.warn("User requested specific variables (" + str(variables) + ") on the command line that will be "
+                     "overridden by the requested configuration file. Requested variables from the command line will be ignored. "
+                     "Please list your desired variables in your configuration file.")
+
         # if we have one file path, do either one or many inspect reports
         if len(files) <= 1 :
             a_file_path = files[0]
diff --git a/pyglance/glance/config_organizer.py b/pyglance/glance/config_organizer.py
index 9fd082d..ceff407 100644
--- a/pyglance/glance/config_organizer.py
+++ b/pyglance/glance/config_organizer.py
@@ -342,7 +342,7 @@ def _warn_for_stomped_commandline_options(optionSet) :
              optionSet[option_key] is not None and
              optionSet[option_key] != _STOMPABLE_OPTIONS[option_key] ) :
             LOG.warn("User provided input for the option \"" + option_key + "\" on the command line that "
-                     "will be overridden by the requested config file. "
+                     "will be overridden by the requested configuration file. "
                      "This part of the command line input will be ignored.")
             LOG.debug("User value for " + option_key + ": " + str(optionSet[option_key]))
 
-- 
GitLab