[Lldb-commits] [lldb] [lldb][NFCI] Remove CommandObjectProcessHandle::VerifyCommandOptionValue (PR #79901)

Alex Langford via lldb-commits lldb-commits at lists.llvm.org
Tue Feb 13 15:38:53 PST 2024


================
@@ -1666,33 +1646,52 @@ class CommandObjectProcessHandle : public CommandObjectParsed {
     // the user's options.
     ProcessSP process_sp = target.GetProcessSP();
 
-    int stop_action = -1;   // -1 means leave the current setting alone
-    int pass_action = -1;   // -1 means leave the current setting alone
-    int notify_action = -1; // -1 means leave the current setting alone
+    std::optional<bool> stop_action = {};
+    std::optional<bool> pass_action = {};
+    std::optional<bool> notify_action = {};
 
-    if (!m_options.stop.empty() &&
-        !VerifyCommandOptionValue(m_options.stop, stop_action)) {
-      result.AppendError("Invalid argument for command option --stop; must be "
-                         "true or false.\n");
-      return;
+    if (!m_options.stop.empty()) {
+      bool success = false;
+      bool value = OptionArgParser::ToBoolean(m_options.stop, false, &success);
----------------
bulbazord wrote:

My plan (that I wrote up 2 weeks ago) was to remove `VerifyCommandOptionValue` entirely in this commit and then refactor `ToBoolean` the way you suggested as a follow-up to this change. Does that sound good to you?

https://github.com/llvm/llvm-project/pull/79901


More information about the lldb-commits mailing list