diff --git a/src/Microsoft.TemplateEngine.Cli/CommandParsing/CommandParserSupport.cs b/src/Microsoft.TemplateEngine.Cli/CommandParsing/CommandParserSupport.cs index 524c7c539f2..4628fcd618c 100644 --- a/src/Microsoft.TemplateEngine.Cli/CommandParsing/CommandParserSupport.cs +++ b/src/Microsoft.TemplateEngine.Cli/CommandParsing/CommandParserSupport.cs @@ -57,8 +57,8 @@ private static Option[] NewCommandVisibleArgs Create.Option("-o|--output", LocalizableStrings.OutputPath, Accept.ExactlyOneArgument()), Create.Option("-i|--install", LocalizableStrings.InstallHelp, Accept.OneOrMoreArguments()), Create.Option("-u|--uninstall", LocalizableStrings.UninstallHelp, Accept.ZeroOrMoreArguments()), - Create.Option("--interactive", LocalizableStrings.InteractiveHelp, Accept.NoArguments()), - Create.Option("--nuget-source|--add-source", LocalizableStrings.NuGetSourceHelp, Accept.OneOrMoreArguments()), + Create.Option("--interactive", LocalizableStrings.OptionDescriptionInteractive, Accept.NoArguments()), + Create.Option("--nuget-source|--add-source", LocalizableStrings.OptionDescriptionNuGetSource, Accept.OneOrMoreArguments()), Create.Option("--type", LocalizableStrings.ShowsFilteredTemplates, Accept.ExactlyOneArgument()), Create.Option("--dry-run", LocalizableStrings.DryRunDescription, Accept.NoArguments()), Create.Option("--force", LocalizableStrings.ForcesTemplateCreation, Accept.NoArguments()), diff --git a/src/Microsoft.TemplateEngine.Cli/Commands/InstallCommand.cs b/src/Microsoft.TemplateEngine.Cli/Commands/InstallCommand.cs index 50291e0d134..26e6eeed139 100644 --- a/src/Microsoft.TemplateEngine.Cli/Commands/InstallCommand.cs +++ b/src/Microsoft.TemplateEngine.Cli/Commands/InstallCommand.cs @@ -16,45 +16,38 @@ namespace Microsoft.TemplateEngine.Cli.Commands { internal class InstallCommand : BaseInstallCommand { - private readonly LegacyInstallCommand _legacyInstallCommand; - public InstallCommand( - LegacyInstallCommand legacyInstallCommand, + NewCommand parentCommand, ITemplateEngineHost host, ITelemetryLogger logger, NewCommandCallbacks callbacks) - : base(host, logger, callbacks, "install") + : base(parentCommand, host, logger, callbacks, "install") { - _legacyInstallCommand = legacyInstallCommand; - AddValidator(symbolResult => ValidateOptionUsageInParent(symbolResult, _legacyInstallCommand.InteractiveOption)); - AddValidator(symbolResult => ValidateOptionUsageInParent(symbolResult, _legacyInstallCommand.AddSourceOption)); + AddValidator(symbolResult => ValidateOptionUsageInParent(symbolResult, parentCommand.InteractiveOption)); + AddValidator(symbolResult => ValidateOptionUsageInParent(symbolResult, parentCommand.AddSourceOption)); } } internal class LegacyInstallCommand : BaseInstallCommand { public LegacyInstallCommand(NewCommand newCommand, ITemplateEngineHost host, ITelemetryLogger logger, NewCommandCallbacks callbacks) - : base(host, logger, callbacks, "--install") + : base(newCommand, host, logger, callbacks, "--install") { this.IsHidden = true; this.AddAlias("-i"); - AddSourceOption.AddAlias("--nuget-source"); + } - //the user should use --nuget-source A --nuget-source B to specify multiple options - AddSourceOption.AllowMultipleArgumentsPerToken = false; - AddSourceOption.IsHidden = true; - InteractiveOption.IsHidden = true; + internal override Option InteractiveOption => ParentCommand.InteractiveOption; - newCommand.AddOption(AddSourceOption); - newCommand.AddOption(InteractiveOption); - } + internal override Option> AddSourceOption => ParentCommand.AddSourceOption; } internal abstract class BaseInstallCommand : BaseCommand { - internal BaseInstallCommand(ITemplateEngineHost host, ITelemetryLogger logger, NewCommandCallbacks callbacks, string commandName) + internal BaseInstallCommand(NewCommand parentCommand, ITemplateEngineHost host, ITelemetryLogger logger, NewCommandCallbacks callbacks, string commandName) : base(host, logger, callbacks, commandName) { + ParentCommand = parentCommand; this.AddArgument(NameArgument); this.AddOption(InteractiveOption); this.AddOption(AddSourceOption); @@ -66,16 +59,11 @@ internal BaseInstallCommand(ITemplateEngineHost host, ITelemetryLogger logger, N Arity = new ArgumentArity(1, 99) }; - internal Option InteractiveOption { get; } = new("--interactive") - { - Description = "When downloading enable NuGet interactive." - }; + internal virtual Option InteractiveOption { get; } = SharedOptionsFactory.GetInteractiveOption(); - internal Option> AddSourceOption { get; } = new(new[] { "--add-source", "--nuget-source" }) - { - Description = "Add NuGet source when looking for package.", - AllowMultipleArgumentsPerToken = true, - }; + internal virtual Option> AddSourceOption { get; } = SharedOptionsFactory.GetAddSourceOption(); + + protected NewCommand ParentCommand { get; } protected override async Task ExecuteAsync(InstallCommandArgs args, IEngineEnvironmentSettings environmentSettings, InvocationContext context) { diff --git a/src/Microsoft.TemplateEngine.Cli/Commands/NewCommand.cs b/src/Microsoft.TemplateEngine.Cli/Commands/NewCommand.cs index fcc0f547d24..4987e474cf9 100644 --- a/src/Microsoft.TemplateEngine.Cli/Commands/NewCommand.cs +++ b/src/Microsoft.TemplateEngine.Cli/Commands/NewCommand.cs @@ -27,16 +27,23 @@ internal NewCommand(string commandName, ITemplateEngineHost host, ITelemetryLogg this.TreatUnmatchedTokensAsErrors = true; this.Add(new InstantiateCommand(host, telemetryLogger, callbacks)); - LegacyInstallCommand legacyInstall = new LegacyInstallCommand(this, host, telemetryLogger, callbacks); - this.Add(legacyInstall); - this.Add(new InstallCommand(legacyInstall, host, telemetryLogger, callbacks)); + this.Add(new LegacyInstallCommand(this, host, telemetryLogger, callbacks)); + this.Add(new InstallCommand(this, host, telemetryLogger, callbacks)); this.Add(new LegacyUninstallCommand(host, telemetryLogger, callbacks)); this.Add(new UninstallCommand(host, telemetryLogger, callbacks)); + this.Add(new LegacyUpdateCheckCommand(this, host, telemetryLogger, callbacks)); + this.Add(new LegacyUpdateApplyCommand(this, host, telemetryLogger, callbacks)); + this.Add(new UpdateCommand(this, host, telemetryLogger, callbacks)); + //yield return (host, telemetryLogger, callbacks) => new ListCommand(host, telemetryLogger, callbacks); //yield return (host, telemetryLogger, callbacks) => new SearchCommand(host, telemetryLogger, callbacks); //yield return (host, telemetryLogger, callbacks) => new UpdateCommand(host, telemetryLogger, callbacks); //yield return (host, telemetryLogger, callbacks) => new AliasCommand(host, telemetryLogger, callbacks); + + //legacy options + this.AddOption(InteractiveOption); + this.AddOption(AddSourceOption); } internal Argument ShortNameArgument { get; } = new Argument("template-short-name") @@ -51,6 +58,14 @@ internal NewCommand(string commandName, ITemplateEngineHost host, ITelemetryLogg internal Option HelpOption { get; } = new Option(new string[] { "-h", "--help", "-?" }); + #region Legacy Options + + internal virtual Option InteractiveOption { get; } = SharedOptionsFactory.GetInteractiveOption().AsHidden(); + + internal virtual Option> AddSourceOption { get; } = SharedOptionsFactory.GetAddSourceOption().AsHidden().DisableAllowMultipleArgumentsPerToken(); + + #endregion + protected override IEnumerable GetSuggestions(NewCommandArgs args, IEngineEnvironmentSettings environmentSettings, string? textToMatch) { using TemplatePackageManager templatePackageManager = new TemplatePackageManager(environmentSettings); diff --git a/src/Microsoft.TemplateEngine.Cli/Commands/SharedOptionsFactory.cs b/src/Microsoft.TemplateEngine.Cli/Commands/SharedOptionsFactory.cs new file mode 100644 index 00000000000..e137a7a46b8 --- /dev/null +++ b/src/Microsoft.TemplateEngine.Cli/Commands/SharedOptionsFactory.cs @@ -0,0 +1,39 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.CommandLine; + +namespace Microsoft.TemplateEngine.Cli.Commands +{ + internal static class SharedOptionsFactory + { + internal static Option GetInteractiveOption() + { + return new Option("--interactive") + { + Description = LocalizableStrings.OptionDescriptionInteractive + }; + } + + internal static Option> GetAddSourceOption() + { + return new(new[] { "--add-source", "--nuget-source" }) + { + Description = LocalizableStrings.OptionDescriptionNuGetSource, + AllowMultipleArgumentsPerToken = true, + }; + } + + internal static Option AsHidden(this Option o) + { + o.IsHidden = true; + return o; + } + + internal static Option DisableAllowMultipleArgumentsPerToken(this Option o) + { + o.AllowMultipleArgumentsPerToken = false; + return o; + } + } +} diff --git a/src/Microsoft.TemplateEngine.Cli/Commands/UpdateCommand.cs b/src/Microsoft.TemplateEngine.Cli/Commands/UpdateCommand.cs index d998ef86015..d1bf1d8fa5e 100644 --- a/src/Microsoft.TemplateEngine.Cli/Commands/UpdateCommand.cs +++ b/src/Microsoft.TemplateEngine.Cli/Commands/UpdateCommand.cs @@ -3,25 +3,132 @@ #nullable enable +using System.CommandLine; using System.CommandLine.Invocation; using System.CommandLine.Parsing; using Microsoft.TemplateEngine.Abstractions; +using Microsoft.TemplateEngine.Cli.Extensions; +using Microsoft.TemplateEngine.Cli.HelpAndUsage; +using Microsoft.TemplateEngine.Edge.Settings; +using Microsoft.TemplateEngine.Edge.Template; namespace Microsoft.TemplateEngine.Cli.Commands { - internal class UpdateCommand : BaseCommand + internal class UpdateCommand : BaseUpdateCommand { - internal UpdateCommand(ITemplateEngineHost host, ITelemetryLogger logger, NewCommandCallbacks callbacks) : base(host, logger, callbacks, "update") { } + public UpdateCommand( + NewCommand newCommand, + ITemplateEngineHost host, + ITelemetryLogger logger, + NewCommandCallbacks callbacks) + : base(newCommand, host, logger, callbacks, "update") + { + AddValidator(symbolResult => ValidateOptionUsageInParent(symbolResult, newCommand.InteractiveOption)); + AddValidator(symbolResult => ValidateOptionUsageInParent(symbolResult, newCommand.AddSourceOption)); + + this.AddOption(CheckOnlyOption); + } + + internal Option CheckOnlyOption { get; } = new(new[] { "--check-only", "--dry-run" }) + { + Description = LocalizableStrings.OptionDescriptionCheckOnly + }; + } + + internal class LegacyUpdateApplyCommand : BaseUpdateCommand + { + public LegacyUpdateApplyCommand(NewCommand newCommand, ITemplateEngineHost host, ITelemetryLogger logger, NewCommandCallbacks callbacks) + : base(newCommand, host, logger, callbacks, "--update-apply") + { + this.IsHidden = true; + } - protected override Task ExecuteAsync(UpdateCommandArgs args, IEngineEnvironmentSettings environmentSettings, InvocationContext context) => throw new NotImplementedException(); + internal override Option InteractiveOption => ParentCommand.InteractiveOption; - protected override UpdateCommandArgs ParseContext(ParseResult parseResult) => throw new NotImplementedException(); + internal override Option> AddSourceOption => ParentCommand.AddSourceOption; + } + + internal class LegacyUpdateCheckCommand : BaseUpdateCommand + { + public LegacyUpdateCheckCommand(NewCommand newCommand, ITemplateEngineHost host, ITelemetryLogger logger, NewCommandCallbacks callbacks) + : base(newCommand, host, logger, callbacks, "--update-check") + { + this.IsHidden = true; + } + + internal override Option InteractiveOption => ParentCommand.InteractiveOption; + + internal override Option> AddSourceOption => ParentCommand.AddSourceOption; + } + + internal class BaseUpdateCommand : BaseCommand + { + internal BaseUpdateCommand(NewCommand parentCommand, ITemplateEngineHost host, ITelemetryLogger logger, NewCommandCallbacks callbacks, string commandName) : base(host, logger, callbacks, commandName) + { + ParentCommand = parentCommand; + this.AddOption(InteractiveOption); + this.AddOption(AddSourceOption); + } + + internal virtual Option InteractiveOption { get; } = SharedOptionsFactory.GetInteractiveOption(); + + internal virtual Option> AddSourceOption { get; } = SharedOptionsFactory.GetAddSourceOption(); + + protected NewCommand ParentCommand { get; } + + protected override async Task ExecuteAsync(UpdateCommandArgs args, IEngineEnvironmentSettings environmentSettings, InvocationContext context) + { + using TemplatePackageManager templatePackageManager = new TemplatePackageManager(environmentSettings); + TemplateInformationCoordinator templateInformationCoordinator = new TemplateInformationCoordinator( + environmentSettings, + templatePackageManager, + new TemplateCreator(environmentSettings), + new HostSpecificDataLoader(environmentSettings), + TelemetryLogger, + environmentSettings.GetDefaultLanguage()); + + TemplatePackageCoordinator templatePackageCoordinator = new TemplatePackageCoordinator( + TelemetryLogger, + environmentSettings, + templatePackageManager, + templateInformationCoordinator); + + //TODO: we need to await, otherwise templatePackageManager will be disposed. + return await templatePackageCoordinator.EnterUpdateFlowAsync(args, context.GetCancellationToken()).ConfigureAwait(false); + } + + protected override UpdateCommandArgs ParseContext(ParseResult parseResult) => new(this, parseResult); } internal class UpdateCommandArgs : GlobalArgs { - public UpdateCommandArgs(UpdateCommand command, ParseResult parseResult) : base(command, parseResult) + public UpdateCommandArgs(BaseUpdateCommand command, ParseResult parseResult) : base(command, parseResult) { + if (command is UpdateCommand updateCommand) + { + CheckOnly = parseResult.GetValueForOption(updateCommand.CheckOnlyOption); + } + else if (command is LegacyUpdateCheckCommand) + { + CheckOnly = true; + } + else if (command is LegacyUpdateApplyCommand) + { + CheckOnly = false; + } + else + { + throw new ArgumentException($"Unsupported type {command.GetType().FullName}", nameof(command)); + } + + Interactive = parseResult.GetValueForOption(command.InteractiveOption); + AdditionalSources = parseResult.GetValueForOption(command.AddSourceOption); } + + public bool CheckOnly { get; } + + public bool Interactive { get; } + + public IReadOnlyList? AdditionalSources { get; } } } diff --git a/src/Microsoft.TemplateEngine.Cli/LocalizableStrings.Designer.cs b/src/Microsoft.TemplateEngine.Cli/LocalizableStrings.Designer.cs index efa262c35a2..0d1e0654e35 100644 --- a/src/Microsoft.TemplateEngine.Cli/LocalizableStrings.Designer.cs +++ b/src/Microsoft.TemplateEngine.Cli/LocalizableStrings.Designer.cs @@ -978,15 +978,6 @@ internal static string InstallHelp { } } - /// - /// Looks up a localized string similar to Allows the internal dotnet restore command to stop and wait for user input or action (for example to complete authentication).. - /// - internal static string InteractiveHelp { - get { - return ResourceManager.GetString("InteractiveHelp", resourceCulture); - } - } - /// /// Looks up a localized string similar to Error: Invalid option(s):. /// @@ -1149,15 +1140,6 @@ internal static string NoTemplatesMatchingInputParameters { } } - /// - /// Looks up a localized string similar to Specifies a NuGet source to use during install.. - /// - internal static string NuGetSourceHelp { - get { - return ResourceManager.GetString("NuGetSourceHelp", resourceCulture); - } - } - /// /// Looks up a localized string similar to Error during synchronization with the Optional SDK Workloads.. /// @@ -1176,6 +1158,15 @@ internal static string OptionDescriptionAuthorFilter { } } + /// + /// Looks up a localized string similar to Only check for updates and display the template packages to be updated without applying update.. + /// + internal static string OptionDescriptionCheckOnly { + get { + return ResourceManager.GetString("OptionDescriptionCheckOnly", resourceCulture); + } + } + /// /// Looks up a localized string similar to Comma separated list of columns to display in --list and --search output. ///The supported columns are: language, tags, author, type.. @@ -1195,6 +1186,15 @@ internal static string OptionDescriptionColumnsAll { } } + /// + /// Looks up a localized string similar to Allows the command to stop and wait for user input or action (for example to complete authentication).. + /// + internal static string OptionDescriptionInteractive { + get { + return ResourceManager.GetString("OptionDescriptionInteractive", resourceCulture); + } + } + /// /// Looks up a localized string similar to Disables checking for the template package updates when instantiating a template.. /// @@ -1204,6 +1204,15 @@ internal static string OptionDescriptionNoUpdateCheck { } } + /// + /// Looks up a localized string similar to Specifies a NuGet source to use during install.. + /// + internal static string OptionDescriptionNuGetSource { + get { + return ResourceManager.GetString("OptionDescriptionNuGetSource", resourceCulture); + } + } + /// /// Looks up a localized string similar to Filters the templates based on NuGet package ID. Applies to --search.. /// diff --git a/src/Microsoft.TemplateEngine.Cli/LocalizableStrings.resx b/src/Microsoft.TemplateEngine.Cli/LocalizableStrings.resx index 2ef9cb31579..8f5567003c7 100644 --- a/src/Microsoft.TemplateEngine.Cli/LocalizableStrings.resx +++ b/src/Microsoft.TemplateEngine.Cli/LocalizableStrings.resx @@ -450,7 +450,7 @@ Run 'dotnet {1} --show-aliases' with no args to show all aliases. An ambiguous choice parameter value prevented unambiguously choosing a template to invoke. - + Specifies a NuGet source to use during install. @@ -498,8 +498,8 @@ Run 'dotnet {1} --show-aliases' with no args to show all aliases. Check the currently installed template packages for updates. - - Allows the internal dotnet restore command to stop and wait for user input or action (for example to complete authentication). + + Allows the command to stop and wait for user input or action (for example to complete authentication). {0} template(s) partially matched, but failed on {1}. @@ -766,4 +766,7 @@ The supported columns are: language, tags, author, type. Failed to load dotnet CLI host data for template {0} from {1}. The host data will be ignored. {0} - template short name, {1} - file path to host data. + + Only check for updates and display the template packages to be updated without applying update. + \ No newline at end of file diff --git a/src/Microsoft.TemplateEngine.Cli/TemplatePackageCoordinator.cs b/src/Microsoft.TemplateEngine.Cli/TemplatePackageCoordinator.cs index f613e718a56..ef6c94866a3 100644 --- a/src/Microsoft.TemplateEngine.Cli/TemplatePackageCoordinator.cs +++ b/src/Microsoft.TemplateEngine.Cli/TemplatePackageCoordinator.cs @@ -209,12 +209,12 @@ internal async Task EnterInstallFlowAsync(InstallCommandArgs a /// /// Update the template package(s) flow (--update-check and --update-apply). /// - private async Task EnterUpdateFlowAsync(INewCommandInput commandInput, CancellationToken cancellationToken) + internal async Task EnterUpdateFlowAsync(UpdateCommandArgs commandArgs, CancellationToken cancellationToken) { - _ = commandInput ?? throw new ArgumentNullException(nameof(commandInput)); + _ = commandArgs ?? throw new ArgumentNullException(nameof(commandArgs)); cancellationToken.ThrowIfCancellationRequested(); - bool applyUpdates = commandInput.ApplyUpdates; + bool applyUpdates = !commandArgs.CheckOnly; bool allTemplatesUpToDate = true; NewCommandStatus success = NewCommandStatus.Success; var managedTemplatePackages = await _templatePackageManager.GetManagedTemplatePackagesAsync(false, cancellationToken).ConfigureAwait(false); @@ -223,7 +223,7 @@ private async Task EnterUpdateFlowAsync(INewCommandInput comma { var provider = packagesGrouping.Key; IReadOnlyList checkUpdateResults = await provider.GetLatestVersionsAsync(packagesGrouping, cancellationToken).ConfigureAwait(false); - DisplayUpdateCheckResults(checkUpdateResults, commandInput, showUpdates: !applyUpdates); + DisplayUpdateCheckResults(checkUpdateResults, commandArgs.CommandName, showUpdates: !applyUpdates); if (checkUpdateResults.Any(result => !result.Success)) { success = NewCommandStatus.CreateFailed; @@ -432,10 +432,9 @@ private async Task IsTemplateShortNameAsync(string sourceIdentifier, Cance }); } - private void DisplayUpdateCheckResults(IEnumerable versionCheckResults, INewCommandInput commandInput, bool showUpdates = true) + private void DisplayUpdateCheckResults(IEnumerable versionCheckResults, string commandName, bool showUpdates = true) { _ = versionCheckResults ?? throw new ArgumentNullException(nameof(versionCheckResults)); - _ = commandInput ?? throw new ArgumentNullException(nameof(commandInput)); //handle success if (versionCheckResults.Any(result => result.Success && !result.IsLatestVersion) && showUpdates) @@ -458,15 +457,15 @@ private void DisplayUpdateCheckResults(IEnumerable versionChe Reporter.Output.WriteLine(); Reporter.Output.WriteLine(LocalizableStrings.TemplatePackageCoordinator_Update_Info_UpdateSingleCommandHeader); - Reporter.Output.WriteCommand(CommandExamples.InstallCommandExample(commandInput.CommandName, withVersion: true)); + Reporter.Output.WriteCommand(CommandExamples.InstallCommandExample(commandName, withVersion: true)); Reporter.Output.WriteCommand( CommandExamples.InstallCommandExample( - commandInput.CommandName, + commandName, packageID: displayableResults.First().Identifier, version: displayableResults.First().LatestVersion)); Reporter.Output.WriteLine(); Reporter.Output.WriteLine(LocalizableStrings.TemplatePackageCoordinator_Update_Info_UpdateAllCommandHeader); - Reporter.Output.WriteCommand(CommandExamples.UpdateApplyCommandExample(commandInput.CommandName)); + Reporter.Output.WriteCommand(CommandExamples.UpdateApplyCommandExample(commandName)); Reporter.Output.WriteLine(); } diff --git a/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.cs.xlf b/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.cs.xlf index 4b899fb921a..ce619fe2522 100644 --- a/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.cs.xlf +++ b/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.cs.xlf @@ -525,11 +525,6 @@ Pokud si chcete zobrazit všechny aliasy, spusťte bez argumentů příkaz dotne Nainstaluje zdroj nebo balíček šablon. - - Allows the internal dotnet restore command to stop and wait for user input or action (for example to complete authentication). - Umožňuje, aby se interní příkaz dotnet restore zastavil a počkal na vstup nebo akci uživatele (například na dokončení ověření). - - Error: Invalid option(s): Chyba: Neplatné možnosti: @@ -620,16 +615,16 @@ Pokud si chcete zobrazit všechny aliasy, spusťte bez argumentů příkaz dotne Nenašly se žádné šablony, které by odpovídaly tomuto hledání: {0} - - Specifies a NuGet source to use during install. - Určuje zdroj NuGet, který se má použít během instalace. - - Filters the templates based on the template author. Applicable only with --search or --list | -l option. Filtruje šablony podle jejich autora. Dá se použít pouze s možností --search nebo --list | -l. + + Only check for updates and display the template packages to be updated without applying update. + Only check for updates and display the template packages to be updated without applying update. + + Comma separated list of columns to display in --list and --search output. The supported columns are: language, tags, author, type. @@ -642,11 +637,21 @@ Podporované sloupce: language, tags, author, type Zobrazí všechny sloupce ve výstupu --list a --search. + + Allows the command to stop and wait for user input or action (for example to complete authentication). + Allows the command to stop and wait for user input or action (for example to complete authentication). + + Disables checking for the template package updates when instantiating a template. Zakáže kontrolu aktualizací balíčků šablony při vytváření instance šablony. + + Specifies a NuGet source to use during install. + Specifies a NuGet source to use during install. + + Filters the templates based on NuGet package ID. Applies to --search. Filtruje šablony podle ID balíčku NuGet. Vztahuje se na možnost --search. diff --git a/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.de.xlf b/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.de.xlf index 2f300f9d51b..edb2f9854e9 100644 --- a/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.de.xlf +++ b/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.de.xlf @@ -525,11 +525,6 @@ Führen Sie "dotnet {1}--show-aliases" ohne Argumente aus, um alle Aliase anzuze Installiert ein Quell- oder Vorlagenpaket. - - Allows the internal dotnet restore command to stop and wait for user input or action (for example to complete authentication). - Hiermit wird die interne dotnet restore zugelassen, dass der Befehl anhält und auf eine Benutzereingabe oder Aktion wartet (beispielsweise auf den Abschluss der Authentifizierung). - - Error: Invalid option(s): Fehler: Ungültige Option(en): @@ -620,16 +615,16 @@ Führen Sie "dotnet {1}--show-aliases" ohne Argumente aus, um alle Aliase anzuze Keine Vorlagen gefunden, die "{0}" entsprechen. - - Specifies a NuGet source to use during install. - Gibt eine NuGet-Quelle an, die während dem Installieren verwendet werden soll. - - Filters the templates based on the template author. Applicable only with --search or --list | -l option. Filtert die Vorlagen basierend auf dem Vorlagenautor. Nur anwendbar mit der Option "--search or --list | -l". + + Only check for updates and display the template packages to be updated without applying update. + Only check for updates and display the template packages to be updated without applying update. + + Comma separated list of columns to display in --list and --search output. The supported columns are: language, tags, author, type. @@ -642,11 +637,21 @@ Die unterstützten Spalten sind: Sprache, Tags, Autor, Typ. Anzeigen aller Spalten in der Ausgabe "--list" und "--search". + + Allows the command to stop and wait for user input or action (for example to complete authentication). + Allows the command to stop and wait for user input or action (for example to complete authentication). + + Disables checking for the template package updates when instantiating a template. Deaktiviert die Suche nach Vorlagenpaketaktualisierungen beim Instanziieren einer Vorlage. + + Specifies a NuGet source to use during install. + Specifies a NuGet source to use during install. + + Filters the templates based on NuGet package ID. Applies to --search. Filtert die Vorlagen basierend auf der NuGet-Paket-ID. Gilt für --search. diff --git a/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.es.xlf b/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.es.xlf index 9c7d2a7577f..04a6ea4d643 100644 --- a/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.es.xlf +++ b/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.es.xlf @@ -525,11 +525,6 @@ Ejecute "dotnet {1} --show-aliases" sin argumentos para mostrar todos los alias. Instala un paquete de origen o de plantilla. - - Allows the internal dotnet restore command to stop and wait for user input or action (for example to complete authentication). - Permite que el comando interno dotnet restore se detenga y espere la entrada o acción del usuario (por ejemplo, para completar la autenticación). - - Error: Invalid option(s): Error: Opción u opciones no válidas: @@ -620,16 +615,16 @@ Ejecute "dotnet {1} --show-aliases" sin argumentos para mostrar todos los alias. No se encontró ninguna plantilla que coincida con: {0} - - Specifies a NuGet source to use during install. - Especifica un origen de NuGet para usarlo durante la instalación. - - Filters the templates based on the template author. Applicable only with --search or --list | -l option. Filtra las plantillas en función del autor de la plantilla. Aplicable solo con las opciones--search o --list | -l. + + Only check for updates and display the template packages to be updated without applying update. + Only check for updates and display the template packages to be updated without applying update. + + Comma separated list of columns to display in --list and --search output. The supported columns are: language, tags, author, type. @@ -642,11 +637,21 @@ Las columnas admitidas son: idioma, etiquetas, autor y tipo. Muestra todas las columnas en los resultados de --list y --search. + + Allows the command to stop and wait for user input or action (for example to complete authentication). + Allows the command to stop and wait for user input or action (for example to complete authentication). + + Disables checking for the template package updates when instantiating a template. Deshabilita la comprobación de las actualizaciones del paquete de plantillas al crear una plantilla de forma instantánea. + + Specifies a NuGet source to use during install. + Specifies a NuGet source to use during install. + + Filters the templates based on NuGet package ID. Applies to --search. Filtra las plantillas en función del id. de paquete de NuGet. Se aplica a --search. diff --git a/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.fr.xlf b/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.fr.xlf index 6df296bb707..df87e7ec998 100644 --- a/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.fr.xlf +++ b/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.fr.xlf @@ -525,11 +525,6 @@ Exécutez « dotnet {1} --show-aliases » sans arguments pour afficher tous le Installe une source ou un package de modèle. - - Allows the internal dotnet restore command to stop and wait for user input or action (for example to complete authentication). - Permet à la commande dotnet restore interne de s’arrêter et d’attendre une entrée ou une action de l’utilisateur (par exemple pour effectuer une authentification). - - Error: Invalid option(s): Erreur : option(s) non valide(s) : @@ -620,16 +615,16 @@ Exécutez « dotnet {1} --show-aliases » sans arguments pour afficher tous le Aucun modèle trouvé correspondant : {0}. - - Specifies a NuGet source to use during install. - Spécifie une source NuGet à utiliser lors de l’installation. - - Filters the templates based on the template author. Applicable only with --search or --list | -l option. Filtre les modèles en fonction de l’auteur du modèle. Applicable uniquement avec --search ou --list | -l option. + + Only check for updates and display the template packages to be updated without applying update. + Only check for updates and display the template packages to be updated without applying update. + + Comma separated list of columns to display in --list and --search output. The supported columns are: language, tags, author, type. @@ -642,11 +637,21 @@ Les colonnes prises en charge sont : Langage, balises, auteur, type. Affichez toutes les colonnes dans la sortie --list et --search. + + Allows the command to stop and wait for user input or action (for example to complete authentication). + Allows the command to stop and wait for user input or action (for example to complete authentication). + + Disables checking for the template package updates when instantiating a template. Désactive la vérification des mises à jour du package de modèles lors de l’instanciation d’un modèle. + + Specifies a NuGet source to use during install. + Specifies a NuGet source to use during install. + + Filters the templates based on NuGet package ID. Applies to --search. Filtre les modèles en fonction de l’ID de package NuGet. S’applique à --search. diff --git a/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.it.xlf b/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.it.xlf index a37bc98feeb..efd9f22d682 100644 --- a/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.it.xlf +++ b/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.it.xlf @@ -525,11 +525,6 @@ Eseguire 'dotnet {1}--show-alias ' senza argomenti per mostrare tutti gli alias. Installa un pacchetto di origine o di modello. - - Allows the internal dotnet restore command to stop and wait for user input or action (for example to complete authentication). - Consente al comando internal dotnet restore di arrestare l'esecuzione e attendere l'input o l'azione dell'utente, ad esempio per completare l'autenticazione. - - Error: Invalid option(s): Errore: opzioni non valide: @@ -620,16 +615,16 @@ Eseguire 'dotnet {1}--show-alias ' senza argomenti per mostrare tutti gli alias. Nessun modello corrispondente trovato: {0}. - - Specifies a NuGet source to use during install. - Specifica un’origine NuGet da usare durante l’installazione. - - Filters the templates based on the template author. Applicable only with --search or --list | -l option. Filtra i modelli in base all'autore del modello. Applicabile solo con--search o --list | -l option. + + Only check for updates and display the template packages to be updated without applying update. + Only check for updates and display the template packages to be updated without applying update. + + Comma separated list of columns to display in --list and --search output. The supported columns are: language, tags, author, type. @@ -642,11 +637,21 @@ Le colonne supportate sono: lingua, tag, autore, tipo. Visualizza tutte le colonne in--list e --search output. + + Allows the command to stop and wait for user input or action (for example to complete authentication). + Allows the command to stop and wait for user input or action (for example to complete authentication). + + Disables checking for the template package updates when instantiating a template. Disabilita il controllo degli aggiornamenti del pacchetto di modelli durante la creazione di un'istanza di un modello. + + Specifies a NuGet source to use during install. + Specifies a NuGet source to use during install. + + Filters the templates based on NuGet package ID. Applies to --search. Filtra i modelli basati sull'ID pacchetto NuGet. Si applica a--search. diff --git a/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.ja.xlf b/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.ja.xlf index 984eb1bf049..ede3fcaf3b1 100644 --- a/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.ja.xlf +++ b/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.ja.xlf @@ -525,11 +525,6 @@ Run 'dotnet {1} --show-aliases' with no args to show all aliases. ソースまたはテンプレート パッケージをインストールします。 - - Allows the internal dotnet restore command to stop and wait for user input or action (for example to complete authentication). - internal dotnet restore command を停止して、ユーザーの入力またはアクション (認証の完了など) を待機できるようにします。 - - Error: Invalid option(s): エラー: オプション %s は無効です。 @@ -620,16 +615,16 @@ Run 'dotnet {1} --show-aliases' with no args to show all aliases. テンプレートが見つかりません: {0}。 - - Specifies a NuGet source to use during install. - インストール時に使用する NuGet ソースを指定します。 - - Filters the templates based on the template author. Applicable only with --search or --list | -l option. テンプレートの作成者に基づいてテンプレートをフィルターします。--search または--list | -l オプションでのみ使用できます。 + + Only check for updates and display the template packages to be updated without applying update. + Only check for updates and display the template packages to be updated without applying update. + + Comma separated list of columns to display in --list and --search output. The supported columns are: language, tags, author, type. @@ -642,11 +637,21 @@ The supported columns are: language, tags, author, type. すべての列を--list および--search の出力に表示します。 + + Allows the command to stop and wait for user input or action (for example to complete authentication). + Allows the command to stop and wait for user input or action (for example to complete authentication). + + Disables checking for the template package updates when instantiating a template. テンプレートをインスタンス化する場合に、テンプレート パッケージの更新の確認を無効にします。 + + Specifies a NuGet source to use during install. + Specifies a NuGet source to use during install. + + Filters the templates based on NuGet package ID. Applies to --search. NuGet パッケージ ID に基づいてテンプレートをフィルターします。--search に適用されます。 diff --git a/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.ko.xlf b/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.ko.xlf index a7d37b35ed8..3237d9deabe 100644 --- a/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.ko.xlf +++ b/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.ko.xlf @@ -525,11 +525,6 @@ Run 'dotnet {1} --show-aliases' with no args to show all aliases. 소스 또는 템플릿 패키지를 설치합니다. - - Allows the internal dotnet restore command to stop and wait for user input or action (for example to complete authentication). - 내부 dotnet restore 명령을 중지하고 사용자 입력 또는 작업을 기다리도록 허용합니다(예: 인증 완료). - - Error: Invalid option(s): 오류: 잘못된 옵션 : @@ -620,16 +615,16 @@ Run 'dotnet {1} --show-aliases' with no args to show all aliases. 일치하는 템플릿이 없음:{0}. - - Specifies a NuGet source to use during install. - 설치 중에 사용할 NuGet 소스를 지정합니다. - - Filters the templates based on the template author. Applicable only with --search or --list | -l option. 템플릿 작성자를 기준으로 템플릿을 필터링합니다. --search 또는 --list와 함께 만 적용 가능 | -l 옵션. + + Only check for updates and display the template packages to be updated without applying update. + Only check for updates and display the template packages to be updated without applying update. + + Comma separated list of columns to display in --list and --search output. The supported columns are: language, tags, author, type. @@ -642,11 +637,21 @@ The supported columns are: language, tags, author, type. --list 및 --search 출력의 모든 열을 표시합니다. + + Allows the command to stop and wait for user input or action (for example to complete authentication). + Allows the command to stop and wait for user input or action (for example to complete authentication). + + Disables checking for the template package updates when instantiating a template. 템플릿을 인스턴스화할 때 템플릿 패키지 업데이트 확인을 사용하지 않도록 설정합니다. + + Specifies a NuGet source to use during install. + Specifies a NuGet source to use during install. + + Filters the templates based on NuGet package ID. Applies to --search. NuGet 패키지 ID를 기반으로 템플릿을 필터링합니다. --search에 적용됩니다. diff --git a/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.pl.xlf b/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.pl.xlf index e94aebeb1fa..c0062136438 100644 --- a/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.pl.xlf +++ b/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.pl.xlf @@ -525,11 +525,6 @@ Uruchom polecenie "dotnet {1}--show-aliases" bez argumentów, aby wyświetlić w Instaluje źródło lub pakiet szablonów. - - Allows the internal dotnet restore command to stop and wait for user input or action (for example to complete authentication). - Zezwala wewnętrznemu poleceniu dotnet restore na zatrzymanie działania i zaczekanie na wprowadzenie danych wejściowych lub wykonanie akcji przez użytkownika (na przykład ukończenie uwierzytelniania). - - Error: Invalid option(s): Błąd: nieprawidłowe opcje: @@ -620,16 +615,16 @@ Uruchom polecenie "dotnet {1}--show-aliases" bez argumentów, aby wyświetlić w Nie stwierdzono dopasowania żadnych szablonów: {0}. - - Specifies a NuGet source to use during install. - Określa źródło NuGet do użycia podczas instalacji. - - Filters the templates based on the template author. Applicable only with --search or --list | -l option. Filtruje szablony na podstawie autora szablonu. Dotyczy tylko opcji from --search lub--list | -l. + + Only check for updates and display the template packages to be updated without applying update. + Only check for updates and display the template packages to be updated without applying update. + + Comma separated list of columns to display in --list and --search output. The supported columns are: language, tags, author, type. @@ -642,11 +637,21 @@ Obsługiwane kolumny to: język, tagi, autor, typ. Wyświetl wszystkie kolumny w danych wyjściowych --list i --search. + + Allows the command to stop and wait for user input or action (for example to complete authentication). + Allows the command to stop and wait for user input or action (for example to complete authentication). + + Disables checking for the template package updates when instantiating a template. Wyłącza sprawdzanie aktualizacji pakietu szablonów podczas tworzenia wystąpienia szablonu. + + Specifies a NuGet source to use during install. + Specifies a NuGet source to use during install. + + Filters the templates based on NuGet package ID. Applies to --search. Filtruje szablony na podstawie identyfikatora pakietu NuGet. Ma zastosowanie do opcji --search. diff --git a/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.pt-BR.xlf b/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.pt-BR.xlf index 24c8c181a2c..67149d30fb1 100644 --- a/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.pt-BR.xlf +++ b/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.pt-BR.xlf @@ -525,11 +525,6 @@ Execute 'dotnet {1} --mostrar- aliases' sem nenhum args para mostrar todos os al Instala um pacote de origem ou de modelo. - - Allows the internal dotnet restore command to stop and wait for user input or action (for example to complete authentication). - Permite que o comando dotnet restore interno seja interrompido e aguarde a ação ou entrada do usuário (por exemplo, para concluir a autenticação). - - Error: Invalid option(s): Erro: Opções inválidas: @@ -620,16 +615,16 @@ Execute 'dotnet {1} --mostrar- aliases' sem nenhum args para mostrar todos os al Nenhum modelo encontrado: {0}. - - Specifies a NuGet source to use during install. - Especifica uma fonte do NuGet a ser usada durante a instalação. - - Filters the templates based on the template author. Applicable only with --search or --list | -l option. Filtra os modelos com base no autor do modelo. Aplicável somente com --busca ou --lista | -l opção. + + Only check for updates and display the template packages to be updated without applying update. + Only check for updates and display the template packages to be updated without applying update. + + Comma separated list of columns to display in --list and --search output. The supported columns are: language, tags, author, type. @@ -642,11 +637,21 @@ As colunas com suporte são: idioma, marcas, autor, tipo. Exibir todas as colunas na saída de --lista e --pesquisa. + + Allows the command to stop and wait for user input or action (for example to complete authentication). + Allows the command to stop and wait for user input or action (for example to complete authentication). + + Disables checking for the template package updates when instantiating a template. Desativa a verificação de atualizações de pacote de modelo ao instanciar um modelo. + + Specifies a NuGet source to use during install. + Specifies a NuGet source to use during install. + + Filters the templates based on NuGet package ID. Applies to --search. Filtra os modelos baseados na ID do pacote NuGet. aplica-se a --pesquisa. diff --git a/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.ru.xlf b/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.ru.xlf index 2357e349800..93a7fe776a2 100644 --- a/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.ru.xlf +++ b/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.ru.xlf @@ -525,11 +525,6 @@ Run 'dotnet {1} --show-aliases' with no args to show all aliases. Устанавливает источник или пакет шаблона. - - Allows the internal dotnet restore command to stop and wait for user input or action (for example to complete authentication). - Позволяет остановить внутреннюю команду восстановления dotnet, а также ожидать ввода или действия пользователя (например, для завершения проверки подлинности). - - Error: Invalid option(s): Ошибка: недопустимые параметры: @@ -620,16 +615,16 @@ Run 'dotnet {1} --show-aliases' with no args to show all aliases. Соответствующие шаблоны не найдены: {0}. - - Specifies a NuGet source to use during install. - Указывает источник NuGet, который будет применяться во время установки. - - Filters the templates based on the template author. Applicable only with --search or --list | -l option. Фильтрует шаблоны на основе автора шаблона. Применимо только с параметром--search или--list | -l. + + Only check for updates and display the template packages to be updated without applying update. + Only check for updates and display the template packages to be updated without applying update. + + Comma separated list of columns to display in --list and --search output. The supported columns are: language, tags, author, type. @@ -642,11 +637,21 @@ The supported columns are: language, tags, author, type. Показать все столбцы в выходных данных параметров --list и --search. + + Allows the command to stop and wait for user input or action (for example to complete authentication). + Allows the command to stop and wait for user input or action (for example to complete authentication). + + Disables checking for the template package updates when instantiating a template. Отключает проверку наличия обновлений пакета шаблона при создании экземпляра шаблона. + + Specifies a NuGet source to use during install. + Specifies a NuGet source to use during install. + + Filters the templates based on NuGet package ID. Applies to --search. Фильтрует шаблоны на основе идентификатора пакета NuGet. Применяется к параметру --search. diff --git a/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.tr.xlf b/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.tr.xlf index 7a78f177d8f..3c2915f7a4e 100644 --- a/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.tr.xlf +++ b/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.tr.xlf @@ -525,11 +525,6 @@ Tüm diğer adları göstermek için 'dotnet {1} --show-aliases' komutunu bağı Bir kaynak veya şablon paketi yükler. - - Allows the internal dotnet restore command to stop and wait for user input or action (for example to complete authentication). - İç dotnet restore komutunun kullanıcı girişini veya eylemini (örneğin, kimlik doğrulamasını tamamlamak için) durdurmasına ve beklemesine olanak sağlar. - - Error: Invalid option(s): Hata: Geçersiz seçenek(ler): @@ -620,16 +615,16 @@ Tüm diğer adları göstermek için 'dotnet {1} --show-aliases' komutunu bağı Eşleşen şablon bulunamadı: {0}. - - Specifies a NuGet source to use during install. - Yükleme sırasında kullanılacak NuGet kaynağını belirtir. - - Filters the templates based on the template author. Applicable only with --search or --list | -l option. Şablonları şablon yazarına göre filtreler. Yalnızca “--search” veya “--list | -l” seçeneğiyle uygulanabilir. + + Only check for updates and display the template packages to be updated without applying update. + Only check for updates and display the template packages to be updated without applying update. + + Comma separated list of columns to display in --list and --search output. The supported columns are: language, tags, author, type. @@ -642,11 +637,21 @@ Desteklenen sütunlar şunlardır: dil, etiketler, yazar ve tür. Tüm sütunları “--list” ve “--search” çıkışında görüntüleyin. + + Allows the command to stop and wait for user input or action (for example to complete authentication). + Allows the command to stop and wait for user input or action (for example to complete authentication). + + Disables checking for the template package updates when instantiating a template. Bir şablon örneği oluşturulurken şablon paketi güncelleştirmelerinin denetlenmesini devre dışı bırakır. + + Specifies a NuGet source to use during install. + Specifies a NuGet source to use during install. + + Filters the templates based on NuGet package ID. Applies to --search. Şablonları NuGet paketi kimliğine göre filtreler. “--search” için geçerlidir. diff --git a/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.zh-Hans.xlf b/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.zh-Hans.xlf index f2579c70c52..46849744d15 100644 --- a/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.zh-Hans.xlf +++ b/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.zh-Hans.xlf @@ -525,11 +525,6 @@ Run 'dotnet {1} --show-aliases' with no args to show all aliases. 安装源或模板包。 - - Allows the internal dotnet restore command to stop and wait for user input or action (for example to complete authentication). - 允许内部 dotnet restore 命令以停止和等待用户输入或操作(例如完成身份验证)。 - - Error: Invalid option(s): 错误: 无效选项: @@ -620,16 +615,16 @@ Run 'dotnet {1} --show-aliases' with no args to show all aliases. 找不到匹配的模板: {0}。 - - Specifies a NuGet source to use during install. - 指定安装期间将使用的 NuGet 源。 - - Filters the templates based on the template author. Applicable only with --search or --list | -l option. 根据模板作者筛选模板。仅适用于 --搜索 或 --列出 | -l 选项。 + + Only check for updates and display the template packages to be updated without applying update. + Only check for updates and display the template packages to be updated without applying update. + + Comma separated list of columns to display in --list and --search output. The supported columns are: language, tags, author, type. @@ -642,11 +637,21 @@ The supported columns are: language, tags, author, type. 在 --列出 和 --搜索 中显示所有列。 + + Allows the command to stop and wait for user input or action (for example to complete authentication). + Allows the command to stop and wait for user input or action (for example to complete authentication). + + Disables checking for the template package updates when instantiating a template. 在实例化模板时,禁用对模板包更新的检查。 + + Specifies a NuGet source to use during install. + Specifies a NuGet source to use during install. + + Filters the templates based on NuGet package ID. Applies to --search. 筛选基于 NuGet 包 ID 的模板。应用于 --搜索。 diff --git a/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.zh-Hant.xlf b/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.zh-Hant.xlf index bc301344601..75447137222 100644 --- a/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.zh-Hant.xlf +++ b/src/Microsoft.TemplateEngine.Cli/xlf/LocalizableStrings.zh-Hant.xlf @@ -525,11 +525,6 @@ Run 'dotnet {1} --show-aliases' with no args to show all aliases. 安裝來源或範本套件。 - - Allows the internal dotnet restore command to stop and wait for user input or action (for example to complete authentication). - 允許內部 dotnet restore 命令停止並等候使用者輸入或動作 (例如: 完成驗證)。 - - Error: Invalid option(s): 錯誤: 選項無效: @@ -620,16 +615,16 @@ Run 'dotnet {1} --show-aliases' with no args to show all aliases. 找不到符合的範本: {0}。 - - Specifies a NuGet source to use during install. - 指定安裝期間使用的 NuGet 來源。 - - Filters the templates based on the template author. Applicable only with --search or --list | -l option. 根據範本作者篩選範本。僅適用於 --search 或 --list | -l 選項。 + + Only check for updates and display the template packages to be updated without applying update. + Only check for updates and display the template packages to be updated without applying update. + + Comma separated list of columns to display in --list and --search output. The supported columns are: language, tags, author, type. @@ -642,11 +637,21 @@ The supported columns are: language, tags, author, type. 在 --list 和 --search 輸出中顯示所有欄。 + + Allows the command to stop and wait for user input or action (for example to complete authentication). + Allows the command to stop and wait for user input or action (for example to complete authentication). + + Disables checking for the template package updates when instantiating a template. 停用在具現化範本時檢查範本套件更新。 + + Specifies a NuGet source to use during install. + Specifies a NuGet source to use during install. + + Filters the templates based on NuGet package ID. Applies to --search. 根據 NuGet 套件識別碼篩選範本。適用於 --search。 diff --git a/test/Microsoft.TemplateEngine.Cli.UnitTests/ParserTests/InstallTests.cs b/test/Microsoft.TemplateEngine.Cli.UnitTests/ParserTests/InstallTests.cs index 15c255beeb3..9c0ace04440 100644 --- a/test/Microsoft.TemplateEngine.Cli.UnitTests/ParserTests/InstallTests.cs +++ b/test/Microsoft.TemplateEngine.Cli.UnitTests/ParserTests/InstallTests.cs @@ -161,8 +161,7 @@ public void Install_Legacy_CanParseMultipleArgs(string testCase) [Theory] [InlineData("new --install source --add-source my-custom-source1 --add-source my-custom-source2")] [InlineData("new --add-source my-custom-source1 --add-source my-custom-source2 --install source")] - //TODO: this test case is now failing - to be discussed. - //[InlineData("new --add-source my-custom-source1 --install source --add-source my-custom-source2")] + [InlineData("new --add-source my-custom-source1 --install source --add-source my-custom-source2")] public void Install_Legacy_CanParseAddSourceOption_MultipleEntries(string testCase) { ITemplateEngineHost host = TestHost.GetVirtualHost(additionalComponents: BuiltInTemplatePackagesProviderFactory.GetComponents(includeTestTemplates: false)); diff --git a/test/Microsoft.TemplateEngine.Cli.UnitTests/ParserTests/UpdateTests.cs b/test/Microsoft.TemplateEngine.Cli.UnitTests/ParserTests/UpdateTests.cs new file mode 100644 index 00000000000..64f4e2cdce8 --- /dev/null +++ b/test/Microsoft.TemplateEngine.Cli.UnitTests/ParserTests/UpdateTests.cs @@ -0,0 +1,159 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.CommandLine; +using Microsoft.TemplateEngine.Abstractions; +using Microsoft.TemplateEngine.Cli.Commands; +using Microsoft.TemplateEngine.TestHelper; +using Xunit; + +namespace Microsoft.TemplateEngine.Cli.UnitTests.ParserTests +{ + public class UpdateTests + { + [Theory] + [InlineData("--add-source")] + [InlineData("--nuget-source")] + public void Update_CanParseAddSourceOption(string optionName) + { + ITemplateEngineHost host = TestHost.GetVirtualHost(additionalComponents: BuiltInTemplatePackagesProviderFactory.GetComponents(includeTestTemplates: false)); + NewCommand myCommand = (NewCommand)NewCommandFactory.Create("new", host, new TelemetryLogger(null, false), new NewCommandCallbacks()); + + var parseResult = myCommand.Parse($"new update {optionName} my-custom-source"); + UpdateCommandArgs args = new UpdateCommandArgs((UpdateCommand)parseResult.CommandResult.Command, parseResult); + + Assert.Single(args.AdditionalSources); + Assert.Contains("my-custom-source", args.AdditionalSources); + } + + [Theory] + [InlineData("--update-apply")] + [InlineData("--update-check")] + [InlineData("update")] + public void Update_Error_WhenArguments(string commandName) + { + ITemplateEngineHost host = TestHost.GetVirtualHost(additionalComponents: BuiltInTemplatePackagesProviderFactory.GetComponents(includeTestTemplates: false)); + NewCommand myCommand = (NewCommand)NewCommandFactory.Create("new", host, new TelemetryLogger(null, false), new NewCommandCallbacks()); + + var parseResult = myCommand.Parse($"new {commandName} source"); + + Assert.True(parseResult.Errors.Any()); + Assert.Contains(parseResult.Errors, error => error.Message.Contains("Unrecognized command or argument 'source'")); + } + + [Theory] + [InlineData("new update --add-source my-custom-source1 my-custom-source2")] + [InlineData("new update --check-only --add-source my-custom-source1 --add-source my-custom-source2")] + public void Update_CanParseAddSourceOption_MultipleEntries(string testCase) + { + ITemplateEngineHost host = TestHost.GetVirtualHost(additionalComponents: BuiltInTemplatePackagesProviderFactory.GetComponents(includeTestTemplates: false)); + NewCommand myCommand = (NewCommand)NewCommandFactory.Create("new", host, new TelemetryLogger(null, false), new NewCommandCallbacks()); + var parseResult = myCommand.Parse(testCase); + UpdateCommandArgs args = new UpdateCommandArgs((UpdateCommand)parseResult.CommandResult.Command, parseResult); + + Assert.Equal(2, args.AdditionalSources.Count); + Assert.Contains("my-custom-source1", args.AdditionalSources); + Assert.Contains("my-custom-source2", args.AdditionalSources); + } + + [Fact] + public void Update_CanParseInteractiveOption() + { + ITemplateEngineHost host = TestHost.GetVirtualHost(additionalComponents: BuiltInTemplatePackagesProviderFactory.GetComponents(includeTestTemplates: false)); + NewCommand myCommand = (NewCommand)NewCommandFactory.Create("new", host, new TelemetryLogger(null, false), new NewCommandCallbacks()); + + var parseResult = myCommand.Parse($"new update --interactive"); + UpdateCommandArgs args = new UpdateCommandArgs((UpdateCommand)parseResult.CommandResult.Command, parseResult); + + Assert.True(args.Interactive); + + parseResult = myCommand.Parse($"new update"); + args = new UpdateCommandArgs((UpdateCommand)parseResult.CommandResult.Command, parseResult); + + Assert.False(args.Interactive); + } + + [Theory] + [InlineData("--check-only")] + [InlineData("--dry-run")] + public void Update_CanParseCheckOnlyOption(string optionAlias) + { + ITemplateEngineHost host = TestHost.GetVirtualHost(additionalComponents: BuiltInTemplatePackagesProviderFactory.GetComponents(includeTestTemplates: false)); + NewCommand myCommand = (NewCommand)NewCommandFactory.Create("new", host, new TelemetryLogger(null, false), new NewCommandCallbacks()); + + var parseResult = myCommand.Parse($"new update {optionAlias}"); + UpdateCommandArgs args = new UpdateCommandArgs((UpdateCommand)parseResult.CommandResult.Command, parseResult); + + Assert.True(args.CheckOnly); + + parseResult = myCommand.Parse($"new update"); + args = new UpdateCommandArgs((UpdateCommand)parseResult.CommandResult.Command, parseResult); + + Assert.False(args.CheckOnly); + } + + [Fact] + public void Update_Legacy_CanParseCheckOnlyOption() + { + ITemplateEngineHost host = TestHost.GetVirtualHost(additionalComponents: BuiltInTemplatePackagesProviderFactory.GetComponents(includeTestTemplates: false)); + NewCommand myCommand = (NewCommand)NewCommandFactory.Create("new", host, new TelemetryLogger(null, false), new NewCommandCallbacks()); + + var parseResult = myCommand.Parse($"new --update-check"); + UpdateCommandArgs args = new UpdateCommandArgs((LegacyUpdateCheckCommand)parseResult.CommandResult.Command, parseResult); + + Assert.True(args.CheckOnly); + + parseResult = myCommand.Parse($"new --update-apply"); + args = new UpdateCommandArgs((LegacyUpdateApplyCommand)parseResult.CommandResult.Command, parseResult); + + Assert.False(args.CheckOnly); + } + + [Theory] + [InlineData("new --update-check --add-source my-custom-source")] + [InlineData("new --update-apply --nuget-source my-custom-source")] + [InlineData("new --nuget-source my-custom-source --update-apply")] + public void Update_Legacy_CanParseAddSourceOption(string testCase) + { + ITemplateEngineHost host = TestHost.GetVirtualHost(additionalComponents: BuiltInTemplatePackagesProviderFactory.GetComponents(includeTestTemplates: false)); + NewCommand myCommand = (NewCommand)NewCommandFactory.Create("new", host, new TelemetryLogger(null, false), new NewCommandCallbacks()); + + var parseResult = myCommand.Parse(testCase); + UpdateCommandArgs args = new UpdateCommandArgs((BaseUpdateCommand)parseResult.CommandResult.Command, parseResult); + + Assert.Single(args.AdditionalSources); + Assert.Contains("my-custom-source", args.AdditionalSources); + } + + [Theory] + [InlineData("new --update-check source --interactive")] + [InlineData("new --interactive --update-apply source")] + public void Update_Legacy_CanParseInteractiveOption(string testCase) + { + ITemplateEngineHost host = TestHost.GetVirtualHost(additionalComponents: BuiltInTemplatePackagesProviderFactory.GetComponents(includeTestTemplates: false)); + NewCommand myCommand = (NewCommand)NewCommandFactory.Create("new", host, new TelemetryLogger(null, false), new NewCommandCallbacks()); + + var parseResult = myCommand.Parse(testCase); + UpdateCommandArgs args = new UpdateCommandArgs((BaseUpdateCommand)parseResult.CommandResult.Command, parseResult); + + Assert.True(args.Interactive); + } + + [Theory] + [InlineData("new --update-check --add-source my-custom-source1 --add-source my-custom-source2")] + [InlineData("new --add-source my-custom-source1 --add-source my-custom-source2 --update-apply source")] + [InlineData("new --add-source my-custom-source1 --update-apply --add-source my-custom-source2")] + public void Update_Legacy_CanParseAddSourceOption_MultipleEntries(string testCase) + { + ITemplateEngineHost host = TestHost.GetVirtualHost(additionalComponents: BuiltInTemplatePackagesProviderFactory.GetComponents(includeTestTemplates: false)); + NewCommand myCommand = (NewCommand)NewCommandFactory.Create("new", host, new TelemetryLogger(null, false), new NewCommandCallbacks()); + var parseResult = myCommand.Parse(testCase); + UpdateCommandArgs args = new UpdateCommandArgs((BaseUpdateCommand)parseResult.CommandResult.Command, parseResult); + + Assert.Equal(2, args.AdditionalSources.Count); + Assert.Contains("my-custom-source1", args.AdditionalSources); + Assert.Contains("my-custom-source2", args.AdditionalSources); + } + + } +} diff --git a/test/dotnet-new3.UnitTests/DotnetNewUpdateApply.cs b/test/dotnet-new3.UnitTests/DotnetNewUpdateApply.cs index 34633de585e..2b30fbee074 100644 --- a/test/dotnet-new3.UnitTests/DotnetNewUpdateApply.cs +++ b/test/dotnet-new3.UnitTests/DotnetNewUpdateApply.cs @@ -20,11 +20,13 @@ public DotnetNewUpdateApply(ITestOutputHelper log) _log = log; } - [Fact] - public void CanApplyUpdates() + [Theory] + [InlineData("--update-apply")] + [InlineData("update")] + public void CanApplyUpdates(string testCase) { var home = TestUtils.CreateTemporaryFolder("Home"); - new DotnetNewCommand(_log, "-i", "Microsoft.DotNet.Common.ProjectTemplates.5.0::5.0.0") + new DotnetNewCommand(_log, "install", "Microsoft.DotNet.Common.ProjectTemplates.5.0::5.0.0") .WithCustomHive(home).WithoutBuiltInTemplates() .WithWorkingDirectory(TestUtils.CreateTemporaryFolder()) .Execute() @@ -36,7 +38,7 @@ public void CanApplyUpdates() .And.HaveStdOutContaining("console") .And.HaveStdOutContaining("classlib"); - new DotnetNewCommand(_log, "--update-check") + new DotnetNewCommand(_log, "update", "--check-only") .WithCustomHive(home).WithoutBuiltInTemplates() .WithWorkingDirectory(TestUtils.CreateTemporaryFolder()) .Execute() @@ -51,7 +53,7 @@ public void CanApplyUpdates() .And.HaveStdOutContaining(" dotnet new3 --install ::") .And.HaveStdOutMatching(" dotnet new3 --install Microsoft\\.DotNet\\.Common\\.ProjectTemplates\\.5\\.0::([\\d\\.a-z-])+"); - new DotnetNewCommand(_log, "--update-apply") + new DotnetNewCommand(_log, testCase) .WithCustomHive(home).WithoutBuiltInTemplates() .WithWorkingDirectory(TestUtils.CreateTemporaryFolder()) .Execute() @@ -67,13 +69,15 @@ public void CanApplyUpdates() .And.HaveStdOutContaining("Console Application"); } - [Fact] - public void DoesNotApplyUpdatesWhenAllTemplatesAreUpToDate() + [Theory] + [InlineData("--update-apply")] + [InlineData("update")] + public void DoesNotApplyUpdatesWhenAllTemplatesAreUpToDate(string commandName) { var home = TestUtils.CreateTemporaryFolder("Home"); string workingDirectory = TestUtils.CreateTemporaryFolder(); string templateLocation = Helpers.InstallTestTemplate("TemplateResolution/DifferentLanguagesGroup/BasicFSharp", _log, workingDirectory, home); - new DotnetNewCommand(_log, "-i", "Microsoft.DotNet.Common.ProjectTemplates.5.0") + new DotnetNewCommand(_log, "install", "Microsoft.DotNet.Common.ProjectTemplates.5.0") .WithCustomHive(home) .WithWorkingDirectory(TestUtils.CreateTemporaryFolder()) .Execute() @@ -85,7 +89,7 @@ public void DoesNotApplyUpdatesWhenAllTemplatesAreUpToDate() .And.HaveStdOutContaining("console") .And.HaveStdOutContaining("classlib"); - new DotnetNewCommand(_log, "--update-apply") + new DotnetNewCommand(_log, commandName) .WithCustomHive(home) .WithWorkingDirectory(TestUtils.CreateTemporaryFolder()) .Execute() diff --git a/test/dotnet-new3.UnitTests/DotnetNewUpdateCheck.cs b/test/dotnet-new3.UnitTests/DotnetNewUpdateCheck.cs index cf78f507482..9bf2c3fbec5 100644 --- a/test/dotnet-new3.UnitTests/DotnetNewUpdateCheck.cs +++ b/test/dotnet-new3.UnitTests/DotnetNewUpdateCheck.cs @@ -20,11 +20,14 @@ public DotnetNewUpdateCheck(ITestOutputHelper log) _log = log; } - [Fact] - public void CanCheckForUpdate() + [Theory] + [InlineData("--update-check")] + [InlineData("update --check-only")] + [InlineData("update --dry-run")] + public void CanCheckForUpdate(string testCase) { var home = TestUtils.CreateTemporaryFolder("Home"); - new DotnetNewCommand(_log, "-i", "Microsoft.DotNet.Common.ProjectTemplates.5.0::5.0.0") + new DotnetNewCommand(_log, "install", "Microsoft.DotNet.Common.ProjectTemplates.5.0::5.0.0") .WithCustomHive(home).WithoutBuiltInTemplates() .WithWorkingDirectory(TestUtils.CreateTemporaryFolder()) .Execute() @@ -36,7 +39,7 @@ public void CanCheckForUpdate() .And.HaveStdOutContaining("console") .And.HaveStdOutContaining("classlib"); - new DotnetNewCommand(_log, "--update-check") + new DotnetNewCommand(_log, testCase.Split(" ")) .WithCustomHive(home).WithoutBuiltInTemplates() .WithWorkingDirectory(TestUtils.CreateTemporaryFolder()) .Execute() @@ -52,13 +55,16 @@ public void CanCheckForUpdate() .And.HaveStdOutMatching(" dotnet new3 --install Microsoft\\.DotNet\\.Common\\.ProjectTemplates\\.5\\.0::([\\d\\.a-z-])+"); } - [Fact] - public void DoesNotShowUpdatesWhenAllTemplatesAreUpToDate() + [Theory] + [InlineData("--update-check")] + [InlineData("update --check-only")] + [InlineData("update --dry-run")] + public void DoesNotShowUpdatesWhenAllTemplatesAreUpToDate(string testCase) { var home = TestUtils.CreateTemporaryFolder("Home"); string workingDirectory = TestUtils.CreateTemporaryFolder(); Helpers.InstallTestTemplate("TemplateResolution/DifferentLanguagesGroup/BasicFSharp", _log, workingDirectory, home); - new DotnetNewCommand(_log, "-i", "Microsoft.DotNet.Common.ProjectTemplates.5.0") + new DotnetNewCommand(_log, "install", "Microsoft.DotNet.Common.ProjectTemplates.5.0") .WithCustomHive(home) .WithWorkingDirectory(TestUtils.CreateTemporaryFolder()) .Execute() @@ -70,7 +76,7 @@ public void DoesNotShowUpdatesWhenAllTemplatesAreUpToDate() .And.HaveStdOutContaining("console") .And.HaveStdOutContaining("classlib"); - new DotnetNewCommand(_log, "--update-check") + new DotnetNewCommand(_log, testCase.Split(" ")) .WithCustomHive(home) .WithWorkingDirectory(TestUtils.CreateTemporaryFolder()) .Execute() @@ -85,7 +91,7 @@ public void DoesNotShowUpdatesWhenAllTemplatesAreUpToDate() public void PrintInfoOnUpdateOnCreation() { var home = TestUtils.CreateTemporaryFolder("Home"); - new DotnetNewCommand(_log, "-i", "Microsoft.DotNet.Common.ProjectTemplates.5.0::5.0.0") + new DotnetNewCommand(_log, "install", "Microsoft.DotNet.Common.ProjectTemplates.5.0::5.0.0") .WithCustomHive(home).WithoutBuiltInTemplates() .WithWorkingDirectory(TestUtils.CreateTemporaryFolder()) .Execute() @@ -115,7 +121,7 @@ public void PrintInfoOnUpdateOnCreation() public void DoesNotPrintUpdateInfoOnCreation_WhenNoUpdateCheckOption() { var home = TestUtils.CreateTemporaryFolder("Home"); - new DotnetNewCommand(_log, "-i", "Microsoft.DotNet.Common.ProjectTemplates.5.0::5.0.0") + new DotnetNewCommand(_log, "install", "Microsoft.DotNet.Common.ProjectTemplates.5.0::5.0.0") .WithCustomHive(home).WithoutBuiltInTemplates() .WithWorkingDirectory(TestUtils.CreateTemporaryFolder()) .Execute() @@ -158,7 +164,7 @@ public void DoesNotPrintUpdateInfoOnCreation_WhenNoUpdateCheckOption() public void DoesNotPrintUpdateInfoOnCreation_WhenLatestVersionIsInstalled() { var home = TestUtils.CreateTemporaryFolder("Home"); - new DotnetNewCommand(_log, "-i", "Microsoft.DotNet.Common.ProjectTemplates.5.0") + new DotnetNewCommand(_log, "install", "Microsoft.DotNet.Common.ProjectTemplates.5.0") .WithCustomHive(home).WithoutBuiltInTemplates() .WithWorkingDirectory(TestUtils.CreateTemporaryFolder()) .Execute()