kastiglione updated this revision to Diff 428481. kastiglione added a comment.
add to TestHelp.py Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125154/new/ https://reviews.llvm.org/D125154 Files: lldb/source/Commands/CommandObjectTarget.cpp lldb/test/API/commands/help/TestHelp.py Index: lldb/test/API/commands/help/TestHelp.py =================================================================== --- lldb/test/API/commands/help/TestHelp.py +++ lldb/test/API/commands/help/TestHelp.py @@ -104,6 +104,13 @@ self.expect("help image du line", substrs=[ 'Dump the line table for one or more compilation units']) + @no_debug_info_test + def test_help_image_list_shows_positional_args(self): + """Command 'help image list' should describe positional args.""" + # 'image' is an alias for 'target modules'. + self.expect("help image list", substrs=[ + '<shlib-name> [...]']) + @no_debug_info_test def test_help_target_variable_syntax(self): """Command 'help target variable' should display <variable-name> ...""" Index: lldb/source/Commands/CommandObjectTarget.cpp =================================================================== --- lldb/source/Commands/CommandObjectTarget.cpp +++ lldb/source/Commands/CommandObjectTarget.cpp @@ -50,6 +50,7 @@ #include "lldb/Utility/LLDBLog.h" #include "lldb/Utility/State.h" #include "lldb/Utility/Timer.h" +#include "lldb/lldb-enumerations.h" #include "lldb/lldb-private-enumerations.h" #include "llvm/ADT/ScopeExit.h" @@ -2882,8 +2883,10 @@ CommandObjectTargetModulesList(CommandInterpreter &interpreter) : CommandObjectParsed( interpreter, "target modules list", - "List current executable and dependent shared library images.", - "target modules list [<cmd-options>]") {} + "List current executable and dependent shared library images.") { + CommandArgumentData module_arg{eArgTypeShlibName, eArgRepeatStar}; + m_arguments.push_back({module_arg}); + } ~CommandObjectTargetModulesList() override = default;
Index: lldb/test/API/commands/help/TestHelp.py =================================================================== --- lldb/test/API/commands/help/TestHelp.py +++ lldb/test/API/commands/help/TestHelp.py @@ -104,6 +104,13 @@ self.expect("help image du line", substrs=[ 'Dump the line table for one or more compilation units']) + @no_debug_info_test + def test_help_image_list_shows_positional_args(self): + """Command 'help image list' should describe positional args.""" + # 'image' is an alias for 'target modules'. + self.expect("help image list", substrs=[ + '<shlib-name> [...]']) + @no_debug_info_test def test_help_target_variable_syntax(self): """Command 'help target variable' should display <variable-name> ...""" Index: lldb/source/Commands/CommandObjectTarget.cpp =================================================================== --- lldb/source/Commands/CommandObjectTarget.cpp +++ lldb/source/Commands/CommandObjectTarget.cpp @@ -50,6 +50,7 @@ #include "lldb/Utility/LLDBLog.h" #include "lldb/Utility/State.h" #include "lldb/Utility/Timer.h" +#include "lldb/lldb-enumerations.h" #include "lldb/lldb-private-enumerations.h" #include "llvm/ADT/ScopeExit.h" @@ -2882,8 +2883,10 @@ CommandObjectTargetModulesList(CommandInterpreter &interpreter) : CommandObjectParsed( interpreter, "target modules list", - "List current executable and dependent shared library images.", - "target modules list [<cmd-options>]") {} + "List current executable and dependent shared library images.") { + CommandArgumentData module_arg{eArgTypeShlibName, eArgRepeatStar}; + m_arguments.push_back({module_arg}); + } ~CommandObjectTargetModulesList() override = default;
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits