162 references to NewCommandStrings
aspire (96)
Commands\NewCommand.cs (34)
43
Description =
NewCommandStrings
.NameArgumentDescription,
48
Description =
NewCommandStrings
.OutputArgumentDescription,
53
Description =
NewCommandStrings
.SourceArgumentDescription,
58
Description =
NewCommandStrings
.VersionArgumentDescription,
63
Description =
NewCommandStrings
.TemplatePathOptionDescription
67
Description =
NewCommandStrings
.TemplateRepositoryOptionDescription
71
Description =
NewCommandStrings
.TemplateRepositoryRefOptionDescription
93
: base("new",
NewCommandStrings
.Description, services)
123
?
NewCommandStrings
.ChannelOptionDescriptionWithStaging
124
:
NewCommandStrings
.ChannelOptionDescription,
131
Description =
NewCommandStrings
.LanguageOptionDescription,
348
InteractionService.DisplayError(
NewCommandStrings
.NonInteractiveTemplateRequired);
379
var builtInGroup = new SelectionChoiceGroup("builtin",
NewCommandStrings
.BuiltInTemplates);
393
NewCommandStrings
.SelectAProjectTemplate, choices, choice => choice.Label.EscapeMarkup(),
441
NewCommandStrings
.ResolvingTemplateVersion,
494
errorMessage =
NewCommandStrings
.NoPackageChannelsAvailable;
509
NewCommandStrings
.NoChannelFoundMatching,
558
NewCommandStrings
.NoTemplateVersionsFoundInChannel,
581
NewCommandStrings
.NoMatchingLocalTemplatePackage,
597
return CommandResult.Failure(CliExitCodes.InvalidCommand,
NewCommandStrings
.TemplateRepositoryRefRequiresRepository);
607
return CommandResult.Failure(CliExitCodes.InvalidCommand,
NewCommandStrings
.TemplatePathConflictingOptions);
616
InteractionService.DisplayError(
NewCommandStrings
.SourceWithCredentialsCannotBePersisted);
626
NewCommandStrings
.SourceDirectoryNotFound,
651
return CommandResult.Failure(CliExitCodes.InvalidCommand,
NewCommandStrings
.ConfiguredTemplateConflictingOptions);
740
string.Format(CultureInfo.CurrentCulture,
NewCommandStrings
.NoLocalTemplatesFound, source.Path));
745
return CommandResult.Failure(CliExitCodes.InvalidCommand,
NewCommandStrings
.LocalTemplateSelectionRequiresInteraction);
761
string.Format(CultureInfo.CurrentCulture,
NewCommandStrings
.LocalTemplateLoadFailed, ex.Message));
789
string.Format(CultureInfo.CurrentCulture,
NewCommandStrings
.LocalTemplateLoadFailed, ex.Message));
938
NewCommandStrings
.SelectATemplateVersion,
982
NewCommandStrings
.SelectATemplateVersion,
999
NewCommandStrings
.EnterTheOutputPath,
1013
NewCommandStrings
.EnterTheProjectName,
1017
: ValidationResult.Error(
NewCommandStrings
.InvalidProjectName),
1024
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)
356
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)
49
throw new TemplateSourceConfigurationException($"{AspireConfigFile.TemplateSourcesSectionName}.{name}",
NewCommandStrings
.InvalidConfiguredTemplateSource);
64
interactionService.DisplayMessage(KnownEmojis.Information,
NewCommandStrings
.NoConfiguredTemplateSources);
105
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)
91
string.Format(CultureInfo.CurrentCulture,
NewCommandStrings
.TemplateDirectoryNotFound, fullPath));
111
string.Format(CultureInfo.CurrentCulture,
NewCommandStrings
.LocalTemplateLoadFailed,
132
string.Format(CultureInfo.CurrentCulture,
NewCommandStrings
.NoLocalTemplatesFound, fullPath));
199
string.Format(CultureInfo.CurrentCulture,
NewCommandStrings
.TemplateRepositoryRefNotFound, ex.Reference));
204
? string.Format(CultureInfo.CurrentCulture,
NewCommandStrings
.TemplateRepositoryGitExited, exitCode, ex.Message)
267
throw new TemplateDiscoveryException(CliExitCodes.InvalidCommand,
NewCommandStrings
.TemplateRepositoryPathInvalid);
274
string.Format(CultureInfo.CurrentCulture,
NewCommandStrings
.TemplateDirectoryNotFound, fullPath));
522
NewCommandStrings
.NoChannelFoundMatching,
594
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)
84
throw new TemplateSourceConfigurationException($"{settingPath}.displayName",
NewCommandStrings
.TemplateSourceDisplayNameInvalid);
107
throw new TemplateSourceConfigurationException(settingPath,
NewCommandStrings
.TemplateSourceMissingLocation);
123
throw new TemplateSourceConfigurationException(settingPath,
NewCommandStrings
.TemplateSourceStringRequired);
133
throw new TemplateSourceConfigurationException(settingPath,
NewCommandStrings
.TemplateSourceStringRequired);
141
throw new TemplateSourceConfigurationException(settingPath,
NewCommandStrings
.TemplateSourceInvalidRepository);
149
throw new TemplateSourceConfigurationException(AspireConfigFile.TemplateSourcesSectionName,
NewCommandStrings
.TemplateSourceNameRequired);
161
throw new TemplateSourceConfigurationException(settingPath,
NewCommandStrings
.TemplateRepositoryPathInvalid);
198
throw new TemplateSourceConfigurationException(AspireConfigFile.TemplateSourcesSectionName,
NewCommandStrings
.TemplateSourcesMustBeObject);
203
throw new TemplateSourceConfigurationException(key.Replace(':', '.'),
NewCommandStrings
.TemplateSourceUnknownField);
207
throw new TemplateSourceConfigurationException(AspireConfigFile.TemplateSourcesSectionName,
NewCommandStrings
.TemplateSourcesMustBeObject);
214
string.Format(CultureInfo.CurrentCulture,
NewCommandStrings
.TemplateSourceCannotExtendString, $"{AspireConfigFile.TemplateSourcesSectionName}.{parts[1]}"));
234
: 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)
35
Assert.Equal([
NewCommandStrings
.TemplateSourceExplanation, $"[yellow]{SharedCommandStrings.SourceTrustWarning}[/]"],
252
Assert.Equal([
NewCommandStrings
.TemplateSourceExplanation, $"[yellow]{SharedCommandStrings.SourceTrustWarning}[/]"],
272
Assert.Equal([
NewCommandStrings
.TemplateSourceExplanation, $"[yellow]{SharedCommandStrings.SourceTrustWarning}[/]"],
299
message => Assert.Equal(
NewCommandStrings
.TemplateSourceExplanation, message.Message),
305
NewCommandStrings
.TemplateSourceSearchFailed, "missing", ""), message.Message);
311
NewCommandStrings
.TemplateSourceSearchFailed, "empty", ""), message.Message);
378
Assert.Equal(new SelectionChoiceGroup("builtin",
NewCommandStrings
.BuiltInTemplates), choice.Group));
411
Assert.Equal([
NewCommandStrings
.TemplateSourceExplanation, $"[yellow]{SharedCommandStrings.SourceTrustWarning}[/]"],
Commands\NewCommandLocalTemplateTests.cs (16)
1046
string.Format(CultureInfo.CurrentCulture,
NewCommandStrings
.NoChannelFoundMatching, "pr-missing", "default"),
1090
string.Format(CultureInfo.CurrentCulture,
NewCommandStrings
.LocalTemplateLoadFailed,
1091
NewCommandStrings
.SourceWithCredentialsCannotBePersisted),
1154
string.Format(CultureInfo.CurrentCulture,
NewCommandStrings
.NoChannelFoundMatching, "pr-missing", "default"),
1199
Assert.Equal(string.Format(
NewCommandStrings
.LocalTemplateCreationFailed, "MissingMandatoryParam", "Greeting"), Assert.Single(interaction.DisplayedErrors));
1249
Assert.Equal(
NewCommandStrings
.TemplatePathConflictingOptions, Assert.Single(interaction.DisplayedErrors));
1302
Assert.Equal(
NewCommandStrings
.LocalTemplateSelectionRequiresInteraction, Assert.Single(interaction.DisplayedErrors));
1319
Assert.Equal(
NewCommandStrings
.TemplatePathOptionDescription, Assert.Single(newCommand.Options, option => option.Name == "--template-path").Description);
1511
0 => string.Format(
NewCommandStrings
.TemplateRepositoryGitExited, 128, ErrorStrings.GitRepositoryUnavailable),
1513
2 => string.Format(
NewCommandStrings
.TemplateRepositoryGitExited, 128, ErrorStrings.GitAuthenticationFailed),
1544
Assert.Equal(
NewCommandStrings
.TemplateRepositoryPathInvalid, Assert.Single(interaction.DisplayedErrors));
1584
Assert.Equal(
NewCommandStrings
.TemplateRepositoryPathInvalid, Assert.Single(interaction.DisplayedErrors));
1883
Assert.Equal(string.Format(
NewCommandStrings
.TemplateRepositoryRefNotFound, "missing"), exception.Message);
1907
Assert.Equal(
NewCommandStrings
.TemplateRepositoryRefRequiresRepository, Assert.Single(interaction.DisplayedErrors));
1928
Assert.Equal(
NewCommandStrings
.TemplatePathConflictingOptions, Assert.Single(interaction.DisplayedErrors));
1947
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);
1493
Assert.Contains(
NewCommandStrings
.SourceWithCredentialsCannotBePersisted, interactionService!.DisplayedErrors);
2568
e => string.Equals(e,
NewCommandStrings
.NonInteractiveTemplateRequired, StringComparison.Ordinal));
3229
NewCommandStrings
.OutputDirectoryNotEmptyInteractive,
3609
var expectedError = string.Format(CultureInfo.CurrentCulture,
NewCommandStrings
.OutputDirectoryNotEmptyNonInteractive, existingDir.FullName);
3691
var expectedError = string.Format(CultureInfo.CurrentCulture,
NewCommandStrings
.OutputPathContainsInvalidCharacters, invalidPath);
3748
var expectedMessage = string.Format(CultureInfo.CurrentCulture,
NewCommandStrings
.OutputPathContainsInvalidCharacters, invalidPath);
Commands\TemplateSourceStartupTests.cs (1)
210
"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);