Skip to content

Commit 5689ccc

Browse files
authored
[lldb] Rename scripting template to scripting extension (NFC) (#101935)
This patch renames the `scripting template` subcommand to be `scripting extension` instead since that would make more sense for upcoming commands. Signed-off-by: Med Ismail Bennani <[email protected]>
1 parent 72c9e24 commit 5689ccc

File tree

3 files changed

+23
-23
lines changed

3 files changed

+23
-23
lines changed

lldb/source/Commands/CommandObjectScripting.cpp

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -129,18 +129,18 @@ class CommandObjectScriptingRun : public CommandObjectRaw {
129129
CommandOptions m_options;
130130
};
131131

132-
#define LLDB_OPTIONS_scripting_template_list
132+
#define LLDB_OPTIONS_scripting_extension_list
133133
#include "CommandOptions.inc"
134134

135-
class CommandObjectScriptingTemplateList : public CommandObjectParsed {
135+
class CommandObjectScriptingExtensionList : public CommandObjectParsed {
136136
public:
137-
CommandObjectScriptingTemplateList(CommandInterpreter &interpreter)
137+
CommandObjectScriptingExtensionList(CommandInterpreter &interpreter)
138138
: CommandObjectParsed(
139-
interpreter, "scripting template list",
139+
interpreter, "scripting extension list",
140140
"List all the available scripting extension templates. ",
141141
"scripting template list [--language <scripting-language> --]") {}
142142

143-
~CommandObjectScriptingTemplateList() override = default;
143+
~CommandObjectScriptingExtensionList() override = default;
144144

145145
Options *GetOptions() override { return &m_options; }
146146

@@ -174,7 +174,7 @@ class CommandObjectScriptingTemplateList : public CommandObjectParsed {
174174
}
175175

176176
llvm::ArrayRef<OptionDefinition> GetDefinitions() override {
177-
return llvm::ArrayRef(g_scripting_template_list_options);
177+
return llvm::ArrayRef(g_scripting_extension_list_options);
178178
}
179179

180180
lldb::ScriptLanguage m_language = lldb::eScriptLanguageDefault;
@@ -195,8 +195,8 @@ class CommandObjectScriptingTemplateList : public CommandObjectParsed {
195195
};
196196

197197
size_t num_listed_interface = 0;
198-
size_t num_templates = PluginManager::GetNumScriptedInterfaces();
199-
for (size_t i = 0; i < num_templates; i++) {
198+
size_t num_extensions = PluginManager::GetNumScriptedInterfaces();
199+
for (size_t i = 0; i < num_extensions; i++) {
200200
llvm::StringRef plugin_name =
201201
PluginManager::GetScriptedInterfaceNameAtIndex(i);
202202
if (plugin_name.empty())
@@ -223,7 +223,7 @@ class CommandObjectScriptingTemplateList : public CommandObjectParsed {
223223
usages.Dump(s, ScriptedInterfaceUsages::UsageKind::API);
224224
usages.Dump(s, ScriptedInterfaceUsages::UsageKind::CommandInterpreter);
225225

226-
if (i != num_templates - 1)
226+
if (i != num_extensions - 1)
227227
s.EOL();
228228
}
229229

@@ -235,19 +235,19 @@ class CommandObjectScriptingTemplateList : public CommandObjectParsed {
235235
CommandOptions m_options;
236236
};
237237

238-
class CommandObjectMultiwordScriptingTemplate : public CommandObjectMultiword {
238+
class CommandObjectMultiwordScriptingExtension : public CommandObjectMultiword {
239239
public:
240-
CommandObjectMultiwordScriptingTemplate(CommandInterpreter &interpreter)
240+
CommandObjectMultiwordScriptingExtension(CommandInterpreter &interpreter)
241241
: CommandObjectMultiword(
242-
interpreter, "scripting template",
243-
"Commands for operating on the scripting templates.",
244-
"scripting template [<subcommand-options>]") {
242+
interpreter, "scripting extension",
243+
"Commands for operating on the scripting extensions.",
244+
"scripting extension [<subcommand-options>]") {
245245
LoadSubCommand(
246246
"list",
247-
CommandObjectSP(new CommandObjectScriptingTemplateList(interpreter)));
247+
CommandObjectSP(new CommandObjectScriptingExtensionList(interpreter)));
248248
}
249249

250-
~CommandObjectMultiwordScriptingTemplate() override = default;
250+
~CommandObjectMultiwordScriptingExtension() override = default;
251251
};
252252

253253
CommandObjectMultiwordScripting::CommandObjectMultiwordScripting(
@@ -258,9 +258,9 @@ CommandObjectMultiwordScripting::CommandObjectMultiwordScripting(
258258
"scripting <subcommand> [<subcommand-options>]") {
259259
LoadSubCommand("run",
260260
CommandObjectSP(new CommandObjectScriptingRun(interpreter)));
261-
LoadSubCommand("template",
262-
CommandObjectSP(
263-
new CommandObjectMultiwordScriptingTemplate(interpreter)));
261+
LoadSubCommand("extension",
262+
CommandObjectSP(new CommandObjectMultiwordScriptingExtension(
263+
interpreter)));
264264
}
265265

266266
CommandObjectMultiwordScripting::~CommandObjectMultiwordScripting() = default;

lldb/source/Commands/Options.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -841,8 +841,8 @@ let Command = "scripting run" in {
841841
" language. If none is specific the default scripting language is used.">;
842842
}
843843

844-
let Command = "scripting template list" in {
845-
def scripting_template_list_language : Option<"language", "l">,
844+
let Command = "scripting extension list" in {
845+
def scripting_extension_list_language : Option<"language", "l">,
846846
EnumArg<"ScriptLang">, Desc<"Specify the scripting "
847847
" language. If none is specified the default scripting language is used.">;
848848
}

lldb/test/Shell/Commands/command-scripting-template-list.test renamed to lldb/test/Shell/Commands/command-scripting-extension-list.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# REQUIRES: python
22
# RUN: %lldb -s %s -o exit | FileCheck %s
33

4-
scripting template list
4+
scripting extension list
55
# CHECK:Available scripted extension templates:
66

77
# CHECK: Name: OperatingSystemPythonInterface
@@ -38,5 +38,5 @@ scripting template list
3838
# CHECK-NEXT: API Usages: SBThread.StepUsingScriptedThreadPlan
3939
# CHECK-NEXT: Command Interpreter Usages: thread step-scripted -C <script-name> [-k key -v value ...]
4040

41-
scripting template list -l lua
41+
scripting extension list -l lua
4242
# CHECK: Available scripted extension templates: None

0 commit comments

Comments
 (0)