246 references to Subcommands
aspire (62)
Commands\AgentCommand.cs (2)
31
Subcommands
.Add(mcpCommand);
32
Subcommands
.Add(initCommand);
Commands\CacheCommand.cs (1)
24
Subcommands
.Add(clearCommand);
Commands\CertificatesCommand.cs (2)
24
Subcommands
.Add(cleanCommand);
25
Subcommands
.Add(trustCommand);
Commands\ConfigCommand.cs (6)
38
Subcommands
.Add(getCommand);
39
Subcommands
.Add(setCommand);
40
Subcommands
.Add(listCommand);
41
Subcommands
.Add(deleteCommand);
42
Subcommands
.Add(infoCommand);
58
Subcommands
.Cast<BaseConfigSubCommand>(),
Commands\DocsCommand.cs (3)
32
Subcommands
.Add(listCommand);
33
Subcommands
.Add(searchCommand);
34
Subcommands
.Add(getCommand);
Commands\ExtensionInternalCommand.cs (1)
21
this.
Subcommands
.Add(new GetAppHostCandidatesCommand(features, updateNotifier, projectLocator, executionContext, interactionService, telemetry));
Commands\GroupedHelpWriter.cs (1)
53
foreach (var sub in command.
Subcommands
)
Commands\McpCommand.cs (4)
34
Subcommands
.Add(toolsCommand);
35
Subcommands
.Add(callCommand);
40
Subcommands
.Add(startCommand);
41
Subcommands
.Add(initCommand);
Commands\NewCommand.cs (1)
115
Subcommands
.Add(templateCommand);
Commands\RootCommand.cs (31)
200
Subcommands
.Add(newCommand);
201
Subcommands
.Add(initCommand);
202
Subcommands
.Add(runCommand);
203
Subcommands
.Add(stopCommand);
204
Subcommands
.Add(startCommand);
205
Subcommands
.Add(waitCommand);
206
Subcommands
.Add(commandCommand);
207
Subcommands
.Add(psCommand);
208
Subcommands
.Add(describeCommand);
209
Subcommands
.Add(logsCommand);
210
Subcommands
.Add(addCommand);
211
Subcommands
.Add(publishCommand);
212
Subcommands
.Add(configCommand);
213
Subcommands
.Add(cacheCommand);
214
Subcommands
.Add(certificatesCommand);
215
Subcommands
.Add(doctorCommand);
216
Subcommands
.Add(deployCommand);
217
Subcommands
.Add(doCommand);
218
Subcommands
.Add(updateCommand);
219
Subcommands
.Add(extensionInternalCommand);
220
Subcommands
.Add(mcpCommand);
221
Subcommands
.Add(agentCommand);
222
Subcommands
.Add(telemetryCommand);
223
Subcommands
.Add(exportCommand);
224
Subcommands
.Add(docsCommand);
225
Subcommands
.Add(secretCommand);
228
Subcommands
.Add(renderCommand);
233
Subcommands
.Add(setupCommand);
238
Subcommands
.Add(execCommand);
241
Subcommands
.Add(sdkCommand);
242
Subcommands
.Add(restoreCommand);
Commands\Sdk\SdkCommand.cs (2)
30
Subcommands
.Add(generateCommand);
31
Subcommands
.Add(dumpCommand);
Commands\SecretCommand.cs (5)
36
Subcommands
.Add(getCommand);
37
Subcommands
.Add(setCommand);
38
Subcommands
.Add(listCommand);
39
Subcommands
.Add(pathCommand);
40
Subcommands
.Add(deleteCommand);
Commands\TelemetryCommand.cs (3)
36
Subcommands
.Add(logsCommand);
37
Subcommands
.Add(spansCommand);
38
Subcommands
.Add(tracesCommand);
Aspire.Cli.Tests (22)
Commands\ConfigCommandTests.cs (1)
436
var hasDeployCommand = rootCommand.
Subcommands
.Any(cmd => cmd.Name == "deploy");
Commands\McpCommandTests.cs (9)
64
var mcpCommand = rootCommand.
Subcommands
.FirstOrDefault(c => c.Name == "mcp");
78
var mcpCommand = rootCommand.
Subcommands
.FirstOrDefault(c => c.Name == "mcp");
81
var startCommand = mcpCommand.
Subcommands
.FirstOrDefault(c => c.Name == "start");
94
var mcpCommand = rootCommand.
Subcommands
.FirstOrDefault(c => c.Name == "mcp");
165
var agentCommand = rootCommand.
Subcommands
.FirstOrDefault(c => c.Name == "agent");
180
var agentCommand = rootCommand.
Subcommands
.FirstOrDefault(c => c.Name == "agent");
183
var mcpCommand = agentCommand.
Subcommands
.FirstOrDefault(c => c.Name == "mcp");
196
var agentCommand = rootCommand.
Subcommands
.FirstOrDefault(c => c.Name == "agent");
199
var initCommand = agentCommand.
Subcommands
.FirstOrDefault(c => c.Name == "init");
Commands\NewCommandTests.cs (8)
52
Assert.NotEmpty(command.
Subcommands
);
53
Assert.Contains(command.
Subcommands
, subcommand => subcommand.Name == KnownTemplateId.CSharpEmptyAppHost && subcommand.Description == "Empty (C# AppHost)");
54
Assert.Contains(command.
Subcommands
, subcommand => subcommand.Name == KnownTemplateId.TypeScriptEmptyAppHost && subcommand.Description == "Empty (TypeScript AppHost)");
65
Assert.NotEmpty(command.
Subcommands
);
927
Assert.Contains(command.
Subcommands
, subcommand => subcommand.Name == "aspire-test");
928
Assert.Contains(command.
Subcommands
, subcommand => subcommand.Name == KnownTemplateId.DotNetEmptyAppHost && subcommand.Description == "Empty (C# AppHost, dotnet template)");
929
Assert.Contains(command.
Subcommands
, subcommand => subcommand.Name == KnownTemplateId.CSharpEmptyAppHost && subcommand.Description == "Empty (C# AppHost)");
930
Assert.Contains(command.
Subcommands
, subcommand => subcommand.Name == KnownTemplateId.TypeScriptEmptyAppHost && subcommand.Description == "Empty (TypeScript AppHost)");
Commands\RootCommandTests.cs (4)
399
var hasSetupCommand = command.
Subcommands
.Any(cmd => cmd.Name == "setup");
415
var hasSetupCommand = command.
Subcommands
.Any(cmd => cmd.Name == "setup");
433
var missingGroup = command.
Subcommands
459
var visibleCommands = command.
Subcommands
.Where(sub => !sub.Hidden).ToList();
aspire-managed (3)
Program.cs (3)
37
rootCommand.
Subcommands
.Add(SearchCommand.Create());
38
rootCommand.
Subcommands
.Add(RestoreCommand.Create());
39
rootCommand.
Subcommands
.Add(LayoutCommand.Create());
dotnet (6)
CliSchema.cs (2)
110
var subcommands = CreateSubcommandsDictionary(command.
Subcommands
);
183
CreateSubcommandsDictionary(subCommand.
Subcommands
)
Commands\NuGet\NuGetCommandParser.cs (1)
14
foreach (var subcommand in command.
Subcommands
)
Parser.cs (3)
132
rootCommand.
Subcommands
[rootCommand.
Subcommands
.IndexOf(rootCommand.NewCommand)] = NewCommandParser.ConfigureCommand(rootCommand.NewCommand);
193
RootCommand.
Subcommands
.FirstOrDefault(c => c.Name.Equals(commandName, StringComparison.OrdinalIgnoreCase));
dotnet-watch (1)
CommandLine\CommandLineOptions.cs (1)
338
var knownCommandsByName = dotnetDefinition.
Subcommands
.ToDictionary(keySelector: c => c.Name, elementSelector: c => c);
Microsoft.DotNet.Cli.Definitions (106)
Commands\BuildServer\BuildServerCommandDefinition.cs (1)
20
Subcommands
.Add(ShutdownCommand);
Commands\Clean\CleanCommandDefinition.cs (1)
69
Subcommands
.Add(FileBasedAppsCommand);
Commands\DotNetCommandDefinition.cs (32)
130
Subcommands
.Add(AddCommand = new());
131
Subcommands
.Add(BuildCommand = new());
132
Subcommands
.Add(BuildServerCommand = new());
133
Subcommands
.Add(CleanCommand = new());
134
Subcommands
.Add(DnxCommand = new());
135
Subcommands
.Add(FormatCommand = new());
136
Subcommands
.Add(CompleteCommand = new());
137
Subcommands
.Add(FsiCommand = new());
138
Subcommands
.Add(ListCommand = new());
139
Subcommands
.Add(MSBuildCommand = new());
140
Subcommands
.Add(NewCommand = new());
141
Subcommands
.Add(NuGetCommand = new());
142
Subcommands
.Add(PackCommand = new());
143
Subcommands
.Add(PackageCommand = new());
144
Subcommands
.Add(ParseCommand = new());
145
Subcommands
.Add(ProjectCommand = new());
146
Subcommands
.Add(PublishCommand = new());
147
Subcommands
.Add(ReferenceCommand = new());
148
Subcommands
.Add(RemoveCommand = new());
149
Subcommands
.Add(RestoreCommand = new());
150
Subcommands
.Add(RunCommand = new());
151
Subcommands
.Add(RunApiCommand = new());
152
Subcommands
.Add(SolutionCommand = new());
153
Subcommands
.Add(StoreCommand = new());
154
Subcommands
.Add(TestCommand = TestCommandDefinition.Create());
155
Subcommands
.Add(ToolCommand = new());
156
Subcommands
.Add(VSTestCommand = new());
157
Subcommands
.Add(HelpCommand = new());
158
Subcommands
.Add(SdkCommand = new());
159
Subcommands
.Add(InternalReportInstallSuccessCommand = new());
160
Subcommands
.Add(WorkloadCommand = new());
161
Subcommands
.Add(CompletionsCommand = new());
Commands\Hidden\Add\AddCommandDefinition.cs (2)
29
Subcommands
.Add(PackageCommand);
30
Subcommands
.Add(ReferenceCommand);
Commands\Hidden\List\ListCommandDefinition.cs (2)
35
Subcommands
.Add(PackageCommand);
36
Subcommands
.Add(ReferenceCommand);
Commands\Hidden\Remove\RemoveCommandDefinition.cs (2)
30
Subcommands
.Add(PackageCommand);
31
Subcommands
.Add(ReferenceCommand);
Commands\New\NewAliasCommandDefinition.cs (2)
24
Subcommands
.Add(AddCommand);
25
Subcommands
.Add(ShowCommand);
Commands\New\NewCommandDefinition.cs (16)
152
Subcommands
.Add(InstantiateCommand);
153
Subcommands
.Add(InstallCommand);
154
Subcommands
.Add(UninstallCommand);
155
Subcommands
.Add(UpdateCommand);
156
Subcommands
.Add(SearchCommand);
157
Subcommands
.Add(ListCommand);
158
Subcommands
.Add(AliasCommand);
159
Subcommands
.Add(DetailsCommand);
160
Subcommands
.Add(LegacyInstallCommand);
161
Subcommands
.Add(LegacyUninstallCommand);
162
Subcommands
.Add(LegacyUpdateApplyCommand);
163
Subcommands
.Add(LegacyUpdateCheckCommand);
164
Subcommands
.Add(LegacySearchCommand);
165
Subcommands
.Add(LegacyListCommand);
166
Subcommands
.Add(LegacyAddAliasCommand);
167
Subcommands
.Add(LegacyShowAliasCommand);
Commands\NuGet\NuGetCommandDefinition.cs (13)
38
Subcommands
.Add(DeleteCommand);
39
Subcommands
.Add(LocalsCommand);
40
Subcommands
.Add(PushCommand);
41
Subcommands
.Add(VerifyCommand);
42
Subcommands
.Add(TrustCommand);
43
Subcommands
.Add(SignCommand);
249
Subcommands
.Add(ListCommand = new(this));
250
Subcommands
.Add(AuthorCommand = new(this));
251
Subcommands
.Add(RepositoryCommand = new(this));
252
Subcommands
.Add(SourceCommand = new(this));
253
Subcommands
.Add(CertificateCommand = new(this));
254
Subcommands
.Add(RemoveCommand = new(this));
255
Subcommands
.Add(SyncCommand = new(this));
Commands\Package\PackageCommandDefinition.cs (4)
47
Subcommands
.Add(SearchCommand);
48
Subcommands
.Add(AddCommand);
49
Subcommands
.Add(ListCommand);
50
Subcommands
.Add(RemoveCommand);
Commands\Project\ProjectCommandDefinition.cs (1)
16
Subcommands
.Add(ConvertCommand);
Commands\Reference\ReferenceCommandDefinition.cs (3)
34
Subcommands
.Add(AddCommand);
35
Subcommands
.Add(ListCommand);
36
Subcommands
.Add(RemoveCommand);
Commands\Sdk\SdkCommandDefinition.cs (1)
20
Subcommands
.Add(CheckCommand);
Commands\Solution\SolutionCommandDefinition.cs (4)
37
Subcommands
.Add(AddCommand);
38
Subcommands
.Add(ListCommand);
39
Subcommands
.Add(RemoveCommand);
40
Subcommands
.Add(MigrateCommand);
Commands\Tool\ToolCommandDefinition.cs (8)
35
Subcommands
.Add(InstallCommand);
36
Subcommands
.Add(UninstallCommand);
37
Subcommands
.Add(UpdateCommand);
38
Subcommands
.Add(ListCommand);
39
Subcommands
.Add(RunCommand);
40
Subcommands
.Add(SearchCommand);
41
Subcommands
.Add(RestoreCommand);
42
Subcommands
.Add(ExecuteCommand);
Commands\Workload\WorkloadCommandDefinition.cs (11)
55
Subcommands
.Add(InstallCommand);
56
Subcommands
.Add(UpdateCommand);
57
Subcommands
.Add(ListCommand);
58
Subcommands
.Add(SearchCommand);
59
Subcommands
.Add(UninstallCommand);
60
Subcommands
.Add(RepairCommand);
61
Subcommands
.Add(RestoreCommand);
62
Subcommands
.Add(CleanCommand);
63
Subcommands
.Add(ElevateCommand);
64
Subcommands
.Add(ConfigCommand);
65
Subcommands
.Add(HistoryCommand);
Commands\Workload\WorkloadSearchCommandDefinition.cs (1)
24
Subcommands
.Add(VersionCommand);
Help\HelpBuilder.cs (2)
412
var hasCommandWithHelp = command.
Subcommands
.Any(x => !x.Hidden);
452
var subcommands = context.Command.
Subcommands
.Where(x => !x.Hidden).Select(x => GetTwoColumnRow(x, context)).ToArray();
Microsoft.DotNet.MacOsPkg.Cli (3)
Program.cs (3)
78
rootCommand.
Subcommands
.Add(unpackCommand);
79
rootCommand.
Subcommands
.Add(packCommand);
80
rootCommand.
Subcommands
.Add(verifyCommand);
Microsoft.DotNet.VersionTools.Cli (1)
Program.cs (1)
61
rootCommand.
Subcommands
.Add(trimAssetVersionCommand);
Microsoft.TemplateEngine.Cli (7)
Commands\BaseCommand.cs (1)
87
foreach (var subcommandDef in definition.
Subcommands
)
Commands\create\InstantiateCommand.cs (2)
250
args.NewOrInstantiateCommand.
Subcommands
.Add(templateCommandToRun);
462
instantiateArgs.NewOrInstantiateCommand.
Subcommands
Commands\create\TemplateCommand.cs (1)
305
foreach (Command subCommand in command.
Subcommands
)
Commands\Example.cs (3)
67
foreach (var child in current.
Subcommands
)
134
var subcommand = (TSubcommand?)currentCommand.
Subcommands
.FirstOrDefault(c => c is TSubcommand)
142
var subcommand = currentCommand.
Subcommands
.FirstOrDefault(c => c.Name.Equals(token) || c.Aliases.Contains(token))
NuGet.CommandLine.XPlat (13)
Commands\ConfigCommands\ConfigCommand.cs (5)
102
ConfigCmd.
Subcommands
.Add(PathsCmd);
110
ConfigCmd.
Subcommands
.Add(GetCmd);
118
ConfigCmd.
Subcommands
.Add(SetCmd);
126
ConfigCmd.
Subcommands
.Add(UnsetCmd);
128
app.
Subcommands
.Add(ConfigCmd);
Commands\Package\Download\PackageDownloadCommand.cs (1)
96
packageCommand.
Subcommands
.Add(downloadCommand);
Commands\Package\Update\PackageUpdateCommand.cs (1)
48
packageCommand.
Subcommands
.Add(command);
Commands\PackageSearch\PackageSearchCommand.cs (1)
133
rootCommand.
Subcommands
.Add(searchCommand);
Commands\Why\WhyCommand.cs (1)
146
rootCommand.
Subcommands
.Add(whyCommand);
NuGetCommands.cs (2)
29
var packageCommand = rootCommand.
Subcommands
.FirstOrDefault(c => c.Name == "package");
33
rootCommand.
Subcommands
.Add(packageCommand);
Program.cs (2)
117
rootCommand.
Subcommands
.Add(packageCommand);
128
rootCommand.
Subcommands
.Add(nugetCommand);
System.CommandLine (8)
Command.cs (3)
48
foreach (var command in
Subcommands
)
232
public void Add(Command command) =>
Subcommands
.Add(command);
273
var commands =
Subcommands
;
Help\HelpBuilder.cs (2)
146
var hasCommandWithHelp = command.
Subcommands
.Any(x => !x.Hidden);
177
var subcommands = context.Command.
Subcommands
.Where(x => !x.Hidden).Select(x => GetTwoColumnRow(x, context)).ToArray();
Parsing\StringExtensions.cs (1)
398
var subCommands = command.
Subcommands
;
Parsing\SymbolResultTree.cs (2)
125
for (var i = 0; i < command.
Subcommands
.Count; i++)
127
var childCommand = command.
Subcommands
[i];
System.CommandLine.StaticCompletions (14)
CompletionsCommandDefinition.cs (1)
22
Subcommands
.Add(GenerateScriptCommand = new(this));
shells\BashShellProvider.cs (1)
41
var visibleSubcommands = command.
Subcommands
.Where(c => !c.Hidden).ToArray();
shells\FishShellProvider.cs (3)
64
foreach (var sub in cmd.
Subcommands
.Where(c => !c.Hidden))
103
var visibleSubs = cmd.
Subcommands
.Where(c => !c.Hidden).ToArray();
325
foreach (var sub in cmd.
Subcommands
.Where(c => !c.Hidden))
shells\PowershellShellProvider.cs (2)
160
foreach (var subcommand in command.
Subcommands
)
188
foreach (var subcommand in command.
Subcommands
)
shells\ZshShellProvider.cs (7)
118
if (isMultiValued && command.
Subcommands
.Count == 0)
138
if (command.
Subcommands
.Any(c => !c.Hidden))
183
if (command.
Subcommands
.Count == 0)
204
foreach (var subcommand in command.
Subcommands
.Where(c => !c.Hidden))
252
if (command.
Subcommands
.Where(s => !s.Hidden).Count() > 0)
256
foreach (var subcommand in command.
Subcommands
.Where(s => !s.Hidden))
273
foreach (var subcommand in command.
Subcommands
.Where(c => !c.Hidden))