162 references to NewCommandStrings
aspire (96)
Commands\NewCommand.cs (34)
46
Description =
NewCommandStrings
.NameArgumentDescription,
51
Description =
NewCommandStrings
.OutputArgumentDescription,
56
Description =
NewCommandStrings
.SourceArgumentDescription,
61
Description =
NewCommandStrings
.VersionArgumentDescription,
66
Description =
NewCommandStrings
.TemplatePathOptionDescription
70
Description =
NewCommandStrings
.TemplateRepositoryOptionDescription
74
Description =
NewCommandStrings
.TemplateRepositoryRefOptionDescription
97
: base("new",
NewCommandStrings
.Description, services)
129
?
NewCommandStrings
.ChannelOptionDescriptionWithStaging
130
:
NewCommandStrings
.ChannelOptionDescription,
137
Description =
NewCommandStrings
.LanguageOptionDescription,
354
InteractionService.DisplayError(
NewCommandStrings
.NonInteractiveTemplateRequired);
390
var builtInGroup = new SelectionChoiceGroup("builtin",
NewCommandStrings
.BuiltInTemplates);
406
NewCommandStrings
.SelectAProjectTemplate, choices, choice => choice.Label.EscapeMarkup(),
466
NewCommandStrings
.ResolvingTemplateVersion,
519
errorMessage =
NewCommandStrings
.NoPackageChannelsAvailable;
534
NewCommandStrings
.NoChannelFoundMatching,
583
NewCommandStrings
.NoTemplateVersionsFoundInChannel,
606
NewCommandStrings
.NoMatchingLocalTemplatePackage,
622
return CommandResult.Failure(CliExitCodes.InvalidCommand,
NewCommandStrings
.TemplateRepositoryRefRequiresRepository);
632
return CommandResult.Failure(CliExitCodes.InvalidCommand,
NewCommandStrings
.TemplatePathConflictingOptions);
641
InteractionService.DisplayError(
NewCommandStrings
.SourceWithCredentialsCannotBePersisted);
651
NewCommandStrings
.SourceDirectoryNotFound,
676
return CommandResult.Failure(CliExitCodes.InvalidCommand,
NewCommandStrings
.ConfiguredTemplateConflictingOptions);
765
string.Format(CultureInfo.CurrentCulture,
NewCommandStrings
.NoLocalTemplatesFound, source.Path));
770
return CommandResult.Failure(CliExitCodes.InvalidCommand,
NewCommandStrings
.LocalTemplateSelectionRequiresInteraction);
788
string.Format(CultureInfo.CurrentCulture,
NewCommandStrings
.LocalTemplateLoadFailed, ex.Message));
818
string.Format(CultureInfo.CurrentCulture,
NewCommandStrings
.LocalTemplateLoadFailed, ex.Message));
984
NewCommandStrings
.SelectATemplateVersion,
1028
NewCommandStrings
.SelectATemplateVersion,
1045
NewCommandStrings
.EnterTheOutputPath,
1059
NewCommandStrings
.EnterTheProjectName,
1063
: ValidationResult.Error(
NewCommandStrings
.InvalidProjectName),
1070
NewCommandStrings
.SelectAProjectTemplate,
Commands\TemplateManagementCommand.cs (20)
22
: base("template",
NewCommandStrings
.TemplateCommandDescription, services)
29
internal static Argument<string> NameArgument { get; } = new("name") { Description =
NewCommandStrings
.TemplateSourceNameDescription };
30
internal static Option<string?> PathOption { get; } = new("--path") { Description =
NewCommandStrings
.TemplateSourcePathDescription };
31
internal static Option<string?> RepositoryOption { get; } = new("--repository") { Description =
NewCommandStrings
.TemplateSourceRepositoryDescription };
32
internal static Option<string?> RefOption { get; } = new("--ref") { Description =
NewCommandStrings
.TemplateSourceRefDescription };
68
: base("source",
NewCommandStrings
.TemplateSourceCommandDescription, services)
82
: base("list",
NewCommandStrings
.TemplateSourceListDescription, services)
108
return CommandResult.Failure(CliExitCodes.InvalidCommand,
NewCommandStrings
.TemplateSourceReadFailed);
125
InteractionService.DisplayMessage(KnownEmojis.Information,
NewCommandStrings
.TemplateSourceListEmpty);
131
.AddBoldColumn(
NewCommandStrings
.TemplateSourceConfigurationHeader);
151
Description =
NewCommandStrings
.TemplateSourceYesOptionDescription
156
: base("add",
NewCommandStrings
.TemplateSourceAddDescription, services)
175
string.Format(CultureInfo.CurrentCulture,
NewCommandStrings
.TemplateSourceTrustPrompt,
185
InteractionService.DisplaySuccess(string.Format(CultureInfo.CurrentCulture,
NewCommandStrings
.TemplateSourceAdded, options.Name));
194
return CommandResult.Failure(CliExitCodes.InvalidCommand,
NewCommandStrings
.TemplateSourceWriteFailed);
201
private readonly Argument<string> _name = new("name") { Description =
NewCommandStrings
.TemplateSourceNameDescription };
205
: base("remove",
NewCommandStrings
.TemplateSourceRemoveDescription, services)
219
string.Format(CultureInfo.CurrentCulture,
NewCommandStrings
.TemplateSourceNotFound, name));
221
InteractionService.DisplaySuccess(string.Format(CultureInfo.CurrentCulture,
NewCommandStrings
.TemplateSourceRemoved, name));
230
return CommandResult.Failure(CliExitCodes.InvalidCommand,
NewCommandStrings
.TemplateSourceWriteFailed);
Configuration\ConfigSourceService.cs (1)
419
throw new TemplateSourceConfigurationException(AspireConfigFile.TemplateSourcesSectionName,
NewCommandStrings
.TemplateSourcesMustBeObject);
Resources\NewCommandStrings.Designer.cs (1)
42
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Aspire.Cli.Resources.NewCommandStrings", typeof(
NewCommandStrings
).Assembly);
Templating\ConfiguredTemplateSourceService.cs (3)
54
throw new TemplateSourceConfigurationException($"{AspireConfigFile.TemplateSourcesSectionName}.{name}",
NewCommandStrings
.InvalidConfiguredTemplateSource);
73
interactionService.DisplayMessage(KnownEmojis.Information,
NewCommandStrings
.NoConfiguredTemplateSources);
116
CultureInfo.CurrentCulture,
NewCommandStrings
.TemplateSourceSearchFailed, source, message));
Templating\OutputPathHelper.cs (6)
102
var subdirectoryChoice = string.Format(CultureInfo.CurrentCulture,
NewCommandStrings
.CreateProjectNameSubdirectoryChoice, projectName);
104
NewCommandStrings
.SelectProjectCreationLocation,
105
[subdirectoryChoice,
NewCommandStrings
.CreateProjectDirectlyInSelectedFolderChoice],
131
return string.Format(CultureInfo.CurrentCulture,
NewCommandStrings
.OutputPathContainsInvalidCharacters, path);
137
var format = isExplicitOutput ?
NewCommandStrings
.OutputDirectoryNotEmptyNonInteractive :
NewCommandStrings
.OutputDirectoryNotEmptyInteractive;
Templating\TemplateEngineFactory.cs (9)
94
string.Format(CultureInfo.CurrentCulture,
NewCommandStrings
.TemplateDirectoryNotFound, fullPath));
117
string.Format(CultureInfo.CurrentCulture,
NewCommandStrings
.LocalTemplateLoadFailed,
139
string.Format(CultureInfo.CurrentCulture,
NewCommandStrings
.NoLocalTemplatesFound, fullPath));
213
string.Format(CultureInfo.CurrentCulture,
NewCommandStrings
.TemplateRepositoryRefNotFound, ex.Reference));
219
? string.Format(CultureInfo.CurrentCulture,
NewCommandStrings
.TemplateRepositoryGitExited, exitCode, ex.Message)
286
throw new TemplateDiscoveryException(CliExitCodes.InvalidCommand,
NewCommandStrings
.TemplateRepositoryPathInvalid);
293
string.Format(CultureInfo.CurrentCulture,
NewCommandStrings
.TemplateDirectoryNotFound, fullPath));
543
NewCommandStrings
.NoChannelFoundMatching,
615
interactionService.DisplayError(string.Format(CultureInfo.CurrentCulture,
NewCommandStrings
.LocalTemplateCreationFailed, status, errorMessage));
Templating\TemplateNuGetConfigService.cs (1)
70
throw new ArgumentException(Resources.
NewCommandStrings
.SourceWithCredentialsCannotBePersisted);
Templating\TemplateSource.cs (2)
21
throw new TemplateDiscoveryException(CliExitCodes.InvalidCommand, Resources.
NewCommandStrings
.TemplateRepositoryPathInvalid);
35
throw new TemplateDiscoveryException(CliExitCodes.InvalidCommand, Resources.
NewCommandStrings
.TemplateRepositoryPathInvalid);
Templating\TemplateSourceConfiguration.cs (14)
34
throw new TemplateSourceConfigurationException(settingPath,
NewCommandStrings
.InvalidConfiguredTemplateSource);
55
_ => throw new TemplateSourceConfigurationException($"{settingPath}.{property.Name}",
NewCommandStrings
.TemplateSourceDisplayNameInvalid)
86
throw new TemplateSourceConfigurationException($"{settingPath}.displayName",
NewCommandStrings
.TemplateSourceDisplayNameInvalid);
109
throw new TemplateSourceConfigurationException(settingPath,
NewCommandStrings
.TemplateSourceMissingLocation);
125
throw new TemplateSourceConfigurationException(settingPath,
NewCommandStrings
.TemplateSourceStringRequired);
135
throw new TemplateSourceConfigurationException(settingPath,
NewCommandStrings
.TemplateSourceStringRequired);
143
throw new TemplateSourceConfigurationException(settingPath,
NewCommandStrings
.TemplateSourceInvalidRepository);
151
throw new TemplateSourceConfigurationException(AspireConfigFile.TemplateSourcesSectionName,
NewCommandStrings
.TemplateSourceNameRequired);
163
throw new TemplateSourceConfigurationException(settingPath,
NewCommandStrings
.TemplateRepositoryPathInvalid);
200
throw new TemplateSourceConfigurationException(AspireConfigFile.TemplateSourcesSectionName,
NewCommandStrings
.TemplateSourcesMustBeObject);
205
throw new TemplateSourceConfigurationException(key.Replace(':', '.'),
NewCommandStrings
.TemplateSourceUnknownField);
209
throw new TemplateSourceConfigurationException(AspireConfigFile.TemplateSourcesSectionName,
NewCommandStrings
.TemplateSourcesMustBeObject);
216
string.Format(CultureInfo.CurrentCulture,
NewCommandStrings
.TemplateSourceCannotExtendString, $"{AspireConfigFile.TemplateSourcesSectionName}.{parts[1]}"));
236
: Exception(string.Format(CultureInfo.CurrentCulture,
NewCommandStrings
.TemplateSourceSettingInvalid, settingPath, reason));
Templating\TemplateSourceStore.cs (4)
47
throw new TemplateSourceConfigurationException($"{AspireConfigFile.TemplateSourcesSectionName}.{name}",
NewCommandStrings
.TemplateSourceAlreadyExists);
82
throw new TemplateSourceConfigurationException(AspireConfigFile.TemplateSourcesSectionName,
NewCommandStrings
.TemplateSourceLegacyConfiguration);
93
?? throw new TemplateSourceConfigurationException(AspireConfigFile.TemplateSourcesSectionName,
NewCommandStrings
.TemplateSourcesMustBeObject);
106
?? throw new TemplateSourceConfigurationException(AspireConfigFile.TemplateSourcesSectionName,
NewCommandStrings
.TemplateSourcesMustBeObject);
Utils\ConsoleHelpers.cs (1)
75
interactionService.DisplayMessage(KnownEmojis.Information,
NewCommandStrings
.TemplateSourceExplanation);
Aspire.Cli.Tests (66)
Commands\NewCommandChannelResolutionTests.cs (1)
223
NewCommandStrings
.NoMatchingLocalTemplatePackage,
Commands\NewCommandLocalTemplateTests.ConfiguredGitSourceObjects.cs (13)
119
Assert.Equal([
NewCommandStrings
.TemplateSourceExplanation, $"[yellow]{SharedCommandStrings.SourceTrustWarning}[/]"],
156
NewCommandStrings
.TemplateSourceSettingInvalid,
157
"templateSources.broken.path",
NewCommandStrings
.TemplateRepositoryPathInvalid), error.Message);
196
message => Assert.Equal(
NewCommandStrings
.TemplateSourceExplanation, message.Message),
207
NewCommandStrings
.TemplateSourceSearchFailed, "broken",
NewCommandStrings
.TemplateRepositoryPathInvalid),
245
message => Assert.Equal(
NewCommandStrings
.TemplateSourceExplanation, message.Message),
255
NewCommandStrings
.TemplateSourceSearchFailed, "missing",
256
string.Format(CultureInfo.CurrentCulture,
NewCommandStrings
.TemplateDirectoryNotFound, missingPath)),
295
message => Assert.Equal(
NewCommandStrings
.TemplateSourceExplanation, message.Message),
305
NewCommandStrings
.TemplateSourceSearchFailed, "missing",
306
string.Format(CultureInfo.CurrentCulture,
NewCommandStrings
.TemplateRepositoryRefNotFound, "missing")),
396
Assert.Equal([
NewCommandStrings
.TemplateSourceExplanation, $"[yellow]{SharedCommandStrings.SourceTrustWarning}[/]"],
Commands\NewCommandLocalTemplateTests.ConfiguredGitSources.cs (11)
100
[
NewCommandStrings
.TemplateSourceExplanation, $"[yellow]{SharedCommandStrings.SourceTrustWarning}[/]",
344
0 => string.Format(CultureInfo.CurrentCulture,
NewCommandStrings
.TemplateRepositoryGitExited, 128, ErrorStrings.GitRepositoryUnavailable),
346
2 => string.Format(CultureInfo.CurrentCulture,
NewCommandStrings
.TemplateRepositoryGitExited, 128, ErrorStrings.GitAuthenticationFailed),
348
_ => string.Format(CultureInfo.CurrentCulture,
NewCommandStrings
.TemplateRepositoryRefNotFound, "HEAD")
351
message => Assert.Equal(
NewCommandStrings
.TemplateSourceExplanation, message.Message),
361
NewCommandStrings
.TemplateSourceSearchFailed, "broken", expectedError), warning.Message);
414
Assert.Equal([
NewCommandStrings
.TemplateSourceExplanation, $"[yellow]{SharedCommandStrings.SourceTrustWarning}[/]"],
648
Assert.Equal(
NewCommandStrings
.TemplateSourceExplanation, messages[0].Message);
655
Assert.StartsWith(string.Format(CultureInfo.CurrentCulture,
NewCommandStrings
.TemplateSourceSearchFailed, "empty", ""),
657
Assert.Equal(string.Format(CultureInfo.CurrentCulture,
NewCommandStrings
.TemplateSourceSearchFailed, "broken",
658
string.Format(CultureInfo.CurrentCulture,
NewCommandStrings
.TemplateRepositoryGitExited, 128, ErrorStrings.GitAuthenticationFailed)),
Commands\NewCommandLocalTemplateTests.ConfiguredSources.cs (8)
37
Assert.Equal([
NewCommandStrings
.TemplateSourceExplanation, $"[yellow]{SharedCommandStrings.SourceTrustWarning}[/]"],
256
Assert.Equal([
NewCommandStrings
.TemplateSourceExplanation, $"[yellow]{SharedCommandStrings.SourceTrustWarning}[/]"],
276
Assert.Equal([
NewCommandStrings
.TemplateSourceExplanation, $"[yellow]{SharedCommandStrings.SourceTrustWarning}[/]"],
303
message => Assert.Equal(
NewCommandStrings
.TemplateSourceExplanation, message.Message),
309
NewCommandStrings
.TemplateSourceSearchFailed, "missing", ""), message.Message);
315
NewCommandStrings
.TemplateSourceSearchFailed, "empty", ""), message.Message);
382
Assert.Equal(new SelectionChoiceGroup("builtin",
NewCommandStrings
.BuiltInTemplates), choice.Group));
449
Assert.Equal([
NewCommandStrings
.TemplateSourceExplanation, $"[yellow]{SharedCommandStrings.SourceTrustWarning}[/]"],
Commands\NewCommandLocalTemplateTests.cs (16)
1047
string.Format(CultureInfo.CurrentCulture,
NewCommandStrings
.NoChannelFoundMatching, "pr-missing", "default"),
1091
string.Format(CultureInfo.CurrentCulture,
NewCommandStrings
.LocalTemplateLoadFailed,
1092
NewCommandStrings
.SourceWithCredentialsCannotBePersisted),
1155
string.Format(CultureInfo.CurrentCulture,
NewCommandStrings
.NoChannelFoundMatching, "pr-missing", "default"),
1200
Assert.Equal(string.Format(
NewCommandStrings
.LocalTemplateCreationFailed, "MissingMandatoryParam", "Greeting"), Assert.Single(interaction.DisplayedErrors));
1250
Assert.Equal(
NewCommandStrings
.TemplatePathConflictingOptions, Assert.Single(interaction.DisplayedErrors));
1303
Assert.Equal(
NewCommandStrings
.LocalTemplateSelectionRequiresInteraction, Assert.Single(interaction.DisplayedErrors));
1320
Assert.Equal(
NewCommandStrings
.TemplatePathOptionDescription, Assert.Single(newCommand.Options, option => option.Name == "--template-path").Description);
1561
0 => string.Format(
NewCommandStrings
.TemplateRepositoryGitExited, 128, ErrorStrings.GitRepositoryUnavailable),
1563
2 => string.Format(
NewCommandStrings
.TemplateRepositoryGitExited, 128, ErrorStrings.GitAuthenticationFailed),
1594
Assert.Equal(
NewCommandStrings
.TemplateRepositoryPathInvalid, Assert.Single(interaction.DisplayedErrors));
1634
Assert.Equal(
NewCommandStrings
.TemplateRepositoryPathInvalid, Assert.Single(interaction.DisplayedErrors));
1933
Assert.Equal(string.Format(
NewCommandStrings
.TemplateRepositoryRefNotFound, "missing"), exception.Message);
1957
Assert.Equal(
NewCommandStrings
.TemplateRepositoryRefRequiresRepository, Assert.Single(interaction.DisplayedErrors));
1978
Assert.Equal(
NewCommandStrings
.TemplatePathConflictingOptions, Assert.Single(interaction.DisplayedErrors));
1997
Assert.Equal(
NewCommandStrings
.TemplatePathConflictingOptions, Assert.Single(interaction.DisplayedErrors));
Commands\NewCommandLocalTemplateTests.SourceList.cs (3)
126
Assert.Equal(
NewCommandStrings
.TemplateSourceListEmpty, Assert.Single(interaction.DisplayedMessages).Message);
166
Assert.Equal(
NewCommandStrings
.TemplateSourceReadFailed, Assert.Single(interaction.DisplayedErrors));
373
Assert.Equal(
NewCommandStrings
.TemplateSourceListEmpty, Assert.Single(interaction.DisplayedMessages).Message);
Commands\NewCommandLocalTemplateTests.SourceManagement.cs (1)
74
Assert.Equal(string.Format(CultureInfo.CurrentCulture,
NewCommandStrings
.TemplateSourceTrustPrompt, "company", location),
Commands\NewCommandTests.cs (7)
132
Assert.Equal(
NewCommandStrings
.ChannelOptionDescriptionWithStaging, channelOption.Description);
1551
Assert.Contains(
NewCommandStrings
.SourceWithCredentialsCannotBePersisted, interactionService!.DisplayedErrors);
2626
e => string.Equals(e,
NewCommandStrings
.NonInteractiveTemplateRequired, StringComparison.Ordinal));
3287
NewCommandStrings
.OutputDirectoryNotEmptyInteractive,
3667
var expectedError = string.Format(CultureInfo.CurrentCulture,
NewCommandStrings
.OutputDirectoryNotEmptyNonInteractive, existingDir.FullName);
3749
var expectedError = string.Format(CultureInfo.CurrentCulture,
NewCommandStrings
.OutputPathContainsInvalidCharacters, invalidPath);
3806
var expectedMessage = string.Format(CultureInfo.CurrentCulture,
NewCommandStrings
.OutputPathContainsInvalidCharacters, invalidPath);
Commands\TemplateSourceStartupTests.cs (1)
255
"templateSources",
NewCommandStrings
.TemplateSourceLegacyConfiguration).Message, error.Message);
Interaction\ConsoleInteractionServiceTests.cs (2)
1608
NewCommandStrings
.TemplateSourceExplanation,
NewCommandStrings
.TemplateSourceExplanation],
Templating\TemplateEngineFactoryGitCheckoutTests.cs (1)
108
Assert.Equal(string.Format(
NewCommandStrings
.TemplateRepositoryGitExited, 128, ErrorStrings.GitRepositoryUnavailable), exception.Message);
Templating\TemplateEngineFactoryGitTests.cs (2)
101
Assert.Equal(string.Format(
NewCommandStrings
.TemplateRepositoryRefNotFound, CommitSha), exception.Message);
123
Assert.Equal(string.Format(
NewCommandStrings
.TemplateRepositoryGitExited, 128, ErrorStrings.GitCommandFailed), exception.Message);