vpd-tool --mfgClean implementation

vpd-tool supports a new option --mfgClean, which cleans specific
keywords in system backplane VPD and restore it with their default
value.

This option will be used to ensure that the VPD is properly defaulted
in the FRU stock.

The FAB test will make use this option to reset system
backplane VPD keywords to its defaults.

vpd-tool --mfgClean --yes

====================
Test:

./vpd-tool --mfgClean

This option resets some of the critical keywords in System Backplane VPD
to its default value. Do you really wish to proceed further?[yes/no]: yes

 The critical keywords from system backplane VPD has been reset successfully.

./vpd-tool --mfgClean --yes

 The critical keywords from system backplane VPD has been reset successfully.

Verified that the critical keywords have been reset to defaults.

Signed-off-by: Priyanga Ramasamy <priyanga24@in.ibm.com>
Change-Id: Ia53498d222f2828d07a7d170291e641b7f69f9ac
diff --git a/vpd_tool.cpp b/vpd_tool.cpp
index a0699bb..61518bd 100644
--- a/vpd_tool.cpp
+++ b/vpd_tool.cpp
@@ -84,6 +84,14 @@
         "--fixSystemVPD", "Use this option to interactively fix critical "
                           "system VPD keywords {vpd-tool-exe --fixSystemVPD}");
 
+    auto mfgClean =
+        app.add_flag("--mfgClean", "Flag to clean and reset specific keywords "
+                                   "on system VPD to its default value.");
+
+    auto confirm =
+        app.add_flag("--yes", "Using this flag with --mfgClean option, assumes "
+                              "yes to proceed without confirmation.");
+
     CLI11_PARSE(app, argc, argv);
 
     ifstream inventoryJson(INVENTORY_JSON_SYM_LINK);
@@ -164,6 +172,24 @@
             VpdTool vpdToolObj;
             rc = vpdToolObj.fixSystemVPD();
         }
+        else if (*mfgClean)
+        {
+            if (!*confirm)
+            {
+                std::string confirmation{};
+                std::cout << "\nThis option resets some of the system VPD "
+                             "keywords to their default values. Do you really "
+                             "wish to proceed further?[yes/no]: ";
+                std::cin >> confirmation;
+
+                if (confirmation != "yes")
+                {
+                    return 0;
+                }
+            }
+            VpdTool vpdToolObj;
+            rc = vpdToolObj.cleanSystemVPD();
+        }
         else
         {
             throw runtime_error("One of the valid options is required. Refer "