[Lldb-commits] [lldb] 103ad3f - [lldb/Commands] Fix short option collision for `process launch`

Med Ismail Bennani via lldb-commits lldb-commits at lists.llvm.org
Mon Mar 1 12:14:26 PST 2021


Author: Med Ismail Bennani
Date: 2021-03-01T21:13:31+01:00
New Revision: 103ad3f90708eceddd9fea484ce82354e5a9d62d

URL: https://github.com/llvm/llvm-project/commit/103ad3f90708eceddd9fea484ce82354e5a9d62d
DIFF: https://github.com/llvm/llvm-project/commit/103ad3f90708eceddd9fea484ce82354e5a9d62d.diff

LOG: [lldb/Commands] Fix short option collision for `process launch`

This patch changes the short option used in `CommandOptionsProcessLaunch`
for the `-v|--environment` command option to `-E|--environment`.

The reason for that is, that it collides with the `-v|--structured-data-value`
command option generated by `OptionGroupPythonClassWithDict` that
I'm using in an upcoming patch for the `process launch` command.

The long option `--environment` remains the same.

Differential Review: https://reviews.llvm.org/D95100

Signed-off-by: Med Ismail Bennani <medismail.bennani at gmail.com>

Added: 
    

Modified: 
    lldb/docs/use/map.rst
    lldb/source/Commands/CommandOptionsProcessLaunch.cpp
    lldb/source/Commands/Options.td

Removed: 
    


################################################################################
diff  --git a/lldb/docs/use/map.rst b/lldb/docs/use/map.rst
index 0a785f2c0d9d..569649a0b2a5 100644
--- a/lldb/docs/use/map.rst
+++ b/lldb/docs/use/map.rst
@@ -199,7 +199,7 @@ Execution Commands
                <td class="content">
                </td>
                <td class="content">
-                  <b>(lldb)</b> process launch -v DEBUG=1
+                  <b>(lldb)</b> process launch -E DEBUG=1
                   <br>
                </td>
          </tr>

diff  --git a/lldb/source/Commands/CommandOptionsProcessLaunch.cpp b/lldb/source/Commands/CommandOptionsProcessLaunch.cpp
index 4445457ca852..dfc4887fec26 100644
--- a/lldb/source/Commands/CommandOptionsProcessLaunch.cpp
+++ b/lldb/source/Commands/CommandOptionsProcessLaunch.cpp
@@ -130,7 +130,7 @@ Status CommandOptionsProcessLaunch::SetOptionValue(
       launch_info.SetShell(HostInfo::GetDefaultShell());
     break;
 
-  case 'v':
+  case 'E':
     launch_info.GetEnvironment().insert(option_arg);
     break;
 

diff  --git a/lldb/source/Commands/Options.td b/lldb/source/Commands/Options.td
index 5dc451b8df6c..c19874f73120 100644
--- a/lldb/source/Commands/Options.td
+++ b/lldb/source/Commands/Options.td
@@ -655,7 +655,7 @@ let Command = "process launch" in {
     Desc<"Set the current working directory to <path> when running the inferior.">;
   def process_launch_arch : Option<"arch", "a">, Arg<"Architecture">,
     Desc<"Set the architecture for the process to launch when ambiguous.">;
-  def process_launch_environment : Option<"environment", "v">,
+  def process_launch_environment : Option<"environment", "E">,
     Arg<"None">, Desc<"Specify an environment variable name/value string "
     "(--environment NAME=VALUE). Can be specified multiple times for subsequent "
     "environment entries.">;


        


More information about the lldb-commits mailing list