diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 00e3e87beec2..c31c8405a9b1 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -16,6 +16,11 @@ Testing: - Examples: - `dotnet test test/dotnet.Tests/dotnet.Tests.csproj --filter "Name~ItShowsTheAppropriateMessageToTheUser"` - `dotnet exec artifacts/bin/redist/Debug/dotnet.Tests.dll -method "*ItShowsTheAppropriateMessageToTheUser*"` +- To test CLI command changes: + - Build the redist SDK: `./build.sh` from repo root + - Create a dogfood environment: `source eng/dogfood.sh` + - Test commands in the dogfood shell (e.g., `dnx --help`, `dotnet tool install --help`) + - The dogfood script sets up PATH and environment to use the newly built SDK Output Considerations: - When considering how output should look, solicit advice from baronfel. diff --git a/src/Cli/dotnet/CliStrings.resx b/src/Cli/dotnet/CliStrings.resx index 7b118637944b..3f000e269cd8 100644 --- a/src/Cli/dotnet/CliStrings.resx +++ b/src/Cli/dotnet/CliStrings.resx @@ -817,7 +817,7 @@ The default is 'false.' However, when targeting .NET 7 or lower, the default is {Locked="dotnet workload update"} - Package reference in the form of a package identifier like 'Newtonsoft.Json' or package identifier and version separated by '@' like 'Newtonsoft.Json@13.0.3'. + Package reference in the form of a package identifier like '{0}' or package identifier and version separated by '@' like '{0}@{1}'. Package reference id and version must not be null. diff --git a/src/Cli/dotnet/Commands/Tool/Install/ToolInstallCommandParser.cs b/src/Cli/dotnet/Commands/Tool/Install/ToolInstallCommandParser.cs index f2c0109fe9fd..009b270947a3 100644 --- a/src/Cli/dotnet/Commands/Tool/Install/ToolInstallCommandParser.cs +++ b/src/Cli/dotnet/Commands/Tool/Install/ToolInstallCommandParser.cs @@ -10,7 +10,7 @@ namespace Microsoft.DotNet.Cli.Commands.Tool.Install; internal static class ToolInstallCommandParser { - public static readonly Argument PackageIdentityArgument = CommonArguments.RequiredPackageIdentityArgument(); + public static readonly Argument PackageIdentityArgument = CommonArguments.RequiredPackageIdentityArgument("dotnetsay", "2.1.7"); public static readonly Option VersionOption = new("--version") { diff --git a/src/Cli/dotnet/Commands/Tool/Update/ToolUpdateCommandParser.cs b/src/Cli/dotnet/Commands/Tool/Update/ToolUpdateCommandParser.cs index 1bbb466a6af9..f29fce2f7086 100644 --- a/src/Cli/dotnet/Commands/Tool/Update/ToolUpdateCommandParser.cs +++ b/src/Cli/dotnet/Commands/Tool/Update/ToolUpdateCommandParser.cs @@ -9,7 +9,7 @@ namespace Microsoft.DotNet.Cli.Commands.Tool.Update; internal static class ToolUpdateCommandParser { - public static readonly Argument PackageIdentityArgument = CommonArguments.OptionalPackageIdentityArgument(); + public static readonly Argument PackageIdentityArgument = CommonArguments.OptionalPackageIdentityArgument("dotnetsay", "2.1.7"); public static readonly Option UpdateAllOption = ToolAppliedOption.UpdateAllOption; diff --git a/src/Cli/dotnet/CommonArguments.cs b/src/Cli/dotnet/CommonArguments.cs index 994444113cbd..bef42994416f 100644 --- a/src/Cli/dotnet/CommonArguments.cs +++ b/src/Cli/dotnet/CommonArguments.cs @@ -12,17 +12,23 @@ namespace Microsoft.DotNet.Cli internal class CommonArguments { public static DynamicArgument OptionalPackageIdentityArgument() => + OptionalPackageIdentityArgument("Newtonsoft.Json", "13.0.3"); + + public static DynamicArgument OptionalPackageIdentityArgument(string examplePackage, string exampleVersion) => new("packageId") { - Description = CliStrings.PackageIdentityArgumentDescription, + Description = string.Format(CliStrings.PackageIdentityArgumentDescription, examplePackage, exampleVersion), CustomParser = (ArgumentResult argumentResult) => ParsePackageIdentityWithVersionSeparator(argumentResult.Tokens[0]?.Value), Arity = ArgumentArity.ZeroOrOne, }; public static DynamicArgument RequiredPackageIdentityArgument() => + RequiredPackageIdentityArgument("Newtonsoft.Json", "13.0.3"); + + public static DynamicArgument RequiredPackageIdentityArgument(string examplePackage, string exampleVersion) => new("packageId") { - Description = CliStrings.PackageIdentityArgumentDescription, + Description = string.Format(CliStrings.PackageIdentityArgumentDescription, examplePackage, exampleVersion), CustomParser = (ArgumentResult argumentResult) => ParsePackageIdentityWithVersionSeparator(argumentResult.Tokens[0]?.Value)!.Value, Arity = ArgumentArity.ExactlyOne, }; diff --git a/src/Cli/dotnet/xlf/CliStrings.cs.xlf b/src/Cli/dotnet/xlf/CliStrings.cs.xlf index a39f41202af4..9281b2b60519 100644 --- a/src/Cli/dotnet/xlf/CliStrings.cs.xlf +++ b/src/Cli/dotnet/xlf/CliStrings.cs.xlf @@ -779,8 +779,8 @@ setx PATH "%PATH%;{0}" - Package reference in the form of a package identifier like 'Newtonsoft.Json' or package identifier and version separated by '@' like 'Newtonsoft.Json@13.0.3'. - Odkaz na balíček ve formě identifikátoru balíčku, jako je Newtonsoft.Json, nebo identifikátor balíčku a verze oddělené znakem @, například Newtonsoft.Json@13.0.3. + Package reference in the form of a package identifier like '{0}' or package identifier and version separated by '@' like '{0}@{1}'. + Package reference in the form of a package identifier like '{0}' or package identifier and version separated by '@' like '{0}@{1}'. diff --git a/src/Cli/dotnet/xlf/CliStrings.de.xlf b/src/Cli/dotnet/xlf/CliStrings.de.xlf index ec2a34860213..06e36432caa8 100644 --- a/src/Cli/dotnet/xlf/CliStrings.de.xlf +++ b/src/Cli/dotnet/xlf/CliStrings.de.xlf @@ -779,8 +779,8 @@ setx PATH "%PATH%;{0}" - Package reference in the form of a package identifier like 'Newtonsoft.Json' or package identifier and version separated by '@' like 'Newtonsoft.Json@13.0.3'. - Paketverweis in Form eines Paketbezeichners wie "Newtonsoft.Json" oder Paketbezeichner und -version getrennt durch "@" wie "Newtonsoft.Json@13.0.3". + Package reference in the form of a package identifier like '{0}' or package identifier and version separated by '@' like '{0}@{1}'. + Package reference in the form of a package identifier like '{0}' or package identifier and version separated by '@' like '{0}@{1}'. diff --git a/src/Cli/dotnet/xlf/CliStrings.es.xlf b/src/Cli/dotnet/xlf/CliStrings.es.xlf index 1f3ce827c27f..958ecc950691 100644 --- a/src/Cli/dotnet/xlf/CliStrings.es.xlf +++ b/src/Cli/dotnet/xlf/CliStrings.es.xlf @@ -779,8 +779,8 @@ setx PATH "%PATH%;{0}" - Package reference in the form of a package identifier like 'Newtonsoft.Json' or package identifier and version separated by '@' like 'Newtonsoft.Json@13.0.3'. - Referencia de paquete en forma de identificador de paquete como "Newtonsoft.Json" o identificador de paquete y versión separados por "@", como "Newtonsoft.Json@13.0.3". + Package reference in the form of a package identifier like '{0}' or package identifier and version separated by '@' like '{0}@{1}'. + Package reference in the form of a package identifier like '{0}' or package identifier and version separated by '@' like '{0}@{1}'. diff --git a/src/Cli/dotnet/xlf/CliStrings.fr.xlf b/src/Cli/dotnet/xlf/CliStrings.fr.xlf index 635ed4e4b617..5db31a60a949 100644 --- a/src/Cli/dotnet/xlf/CliStrings.fr.xlf +++ b/src/Cli/dotnet/xlf/CliStrings.fr.xlf @@ -779,8 +779,8 @@ setx PATH "%PATH%;{0}" - Package reference in the form of a package identifier like 'Newtonsoft.Json' or package identifier and version separated by '@' like 'Newtonsoft.Json@13.0.3'. - Référence de package sous la forme d’un identificateur de package tel que « Newtonsoft.Json » ou d’un identificateur de package et d’une version séparés par « @ », comme « Newtonsoft.Json@13.0.3 ». + Package reference in the form of a package identifier like '{0}' or package identifier and version separated by '@' like '{0}@{1}'. + Package reference in the form of a package identifier like '{0}' or package identifier and version separated by '@' like '{0}@{1}'. diff --git a/src/Cli/dotnet/xlf/CliStrings.it.xlf b/src/Cli/dotnet/xlf/CliStrings.it.xlf index d39952180a4c..e0ab4a991a6d 100644 --- a/src/Cli/dotnet/xlf/CliStrings.it.xlf +++ b/src/Cli/dotnet/xlf/CliStrings.it.xlf @@ -779,8 +779,8 @@ setx PATH "%PATH%;{0}" - Package reference in the form of a package identifier like 'Newtonsoft.Json' or package identifier and version separated by '@' like 'Newtonsoft.Json@13.0.3'. - Riferimento al pacchetto sotto forma di identificatore di pacchetto, ad esempio 'Newtonsoft.Json', oppure identificatore e versione di pacchetto separati da '@', ad esempio 'Newtonsoft.Json@13.0.3'. + Package reference in the form of a package identifier like '{0}' or package identifier and version separated by '@' like '{0}@{1}'. + Package reference in the form of a package identifier like '{0}' or package identifier and version separated by '@' like '{0}@{1}'. diff --git a/src/Cli/dotnet/xlf/CliStrings.ja.xlf b/src/Cli/dotnet/xlf/CliStrings.ja.xlf index 72dc03c86992..1c60e39eea21 100644 --- a/src/Cli/dotnet/xlf/CliStrings.ja.xlf +++ b/src/Cli/dotnet/xlf/CliStrings.ja.xlf @@ -779,8 +779,8 @@ setx PATH "%PATH%;{0}" - Package reference in the form of a package identifier like 'Newtonsoft.Json' or package identifier and version separated by '@' like 'Newtonsoft.Json@13.0.3'. - 'Newtonsoft.Json' のようなパッケージ識別子の形式のパッケージ参照、または 'Newtonsoft.Json@13.0.3' のような '@' で区切られたパッケージ識別子とバージョンです。 + Package reference in the form of a package identifier like '{0}' or package identifier and version separated by '@' like '{0}@{1}'. + Package reference in the form of a package identifier like '{0}' or package identifier and version separated by '@' like '{0}@{1}'. diff --git a/src/Cli/dotnet/xlf/CliStrings.ko.xlf b/src/Cli/dotnet/xlf/CliStrings.ko.xlf index 43798437e566..9b17fe1f2fe9 100644 --- a/src/Cli/dotnet/xlf/CliStrings.ko.xlf +++ b/src/Cli/dotnet/xlf/CliStrings.ko.xlf @@ -779,8 +779,8 @@ setx PATH "%PATH%;{0}" - Package reference in the form of a package identifier like 'Newtonsoft.Json' or package identifier and version separated by '@' like 'Newtonsoft.Json@13.0.3'. - 'Newtonsoft.Json'과 같은 패키지 식별자 또는 'Newtonsoft.Json@13.0.3'과 같이 '@'로 구분된 패키지 식별자 및 버전 형식의 패키지 참조입니다. + Package reference in the form of a package identifier like '{0}' or package identifier and version separated by '@' like '{0}@{1}'. + Package reference in the form of a package identifier like '{0}' or package identifier and version separated by '@' like '{0}@{1}'. diff --git a/src/Cli/dotnet/xlf/CliStrings.pl.xlf b/src/Cli/dotnet/xlf/CliStrings.pl.xlf index 7b2a4b70c7ef..76ccf8a90a4e 100644 --- a/src/Cli/dotnet/xlf/CliStrings.pl.xlf +++ b/src/Cli/dotnet/xlf/CliStrings.pl.xlf @@ -779,8 +779,8 @@ setx PATH "%PATH%;{0}" - Package reference in the form of a package identifier like 'Newtonsoft.Json' or package identifier and version separated by '@' like 'Newtonsoft.Json@13.0.3'. - Odwołanie do pakietu w postaci identyfikatora pakietu, takiego jak „Newtonsoft.Json” lub identyfikator pakietu i wersja rozdzielone znakiem „@”, na przykład „Newtonsoft.Json@13.0.3”. + Package reference in the form of a package identifier like '{0}' or package identifier and version separated by '@' like '{0}@{1}'. + Package reference in the form of a package identifier like '{0}' or package identifier and version separated by '@' like '{0}@{1}'. diff --git a/src/Cli/dotnet/xlf/CliStrings.pt-BR.xlf b/src/Cli/dotnet/xlf/CliStrings.pt-BR.xlf index 3ee315cd0552..dd485568a4ca 100644 --- a/src/Cli/dotnet/xlf/CliStrings.pt-BR.xlf +++ b/src/Cli/dotnet/xlf/CliStrings.pt-BR.xlf @@ -779,8 +779,8 @@ setx PATH "%PATH%;{0}" - Package reference in the form of a package identifier like 'Newtonsoft.Json' or package identifier and version separated by '@' like 'Newtonsoft.Json@13.0.3'. - Referência do pacote na forma de um identificador de pacote como 'Newtonsoft.Json' ou identificador e versão do pacote separados por '@', como 'Newtonsoft.Json\@13.0.3'. + Package reference in the form of a package identifier like '{0}' or package identifier and version separated by '@' like '{0}@{1}'. + Package reference in the form of a package identifier like '{0}' or package identifier and version separated by '@' like '{0}@{1}'. diff --git a/src/Cli/dotnet/xlf/CliStrings.ru.xlf b/src/Cli/dotnet/xlf/CliStrings.ru.xlf index 96a08e62fc53..d487cd169a11 100644 --- a/src/Cli/dotnet/xlf/CliStrings.ru.xlf +++ b/src/Cli/dotnet/xlf/CliStrings.ru.xlf @@ -779,8 +779,8 @@ setx PATH "%PATH%;{0}" - Package reference in the form of a package identifier like 'Newtonsoft.Json' or package identifier and version separated by '@' like 'Newtonsoft.Json@13.0.3'. - Ссылка на пакет в виде идентификатора пакета, например "Newtonsoft.Json", или идентификатора пакета и версии, разделенных "@", например "Newtonsoft.Json@13.0.3". + Package reference in the form of a package identifier like '{0}' or package identifier and version separated by '@' like '{0}@{1}'. + Package reference in the form of a package identifier like '{0}' or package identifier and version separated by '@' like '{0}@{1}'. diff --git a/src/Cli/dotnet/xlf/CliStrings.tr.xlf b/src/Cli/dotnet/xlf/CliStrings.tr.xlf index 997b259096c2..5a0d120babd0 100644 --- a/src/Cli/dotnet/xlf/CliStrings.tr.xlf +++ b/src/Cli/dotnet/xlf/CliStrings.tr.xlf @@ -779,8 +779,8 @@ setx PATH "%PATH%;{0}" - Package reference in the form of a package identifier like 'Newtonsoft.Json' or package identifier and version separated by '@' like 'Newtonsoft.Json@13.0.3'. - 'Newtonsoft.Json' gibi bir paket tanımlayıcısı veya 'Newtonsoft.Json@13.0.3' gibi '@' ile ayrılmış paket tanımlayıcısı ve sürümü şeklinde paket referansı. + Package reference in the form of a package identifier like '{0}' or package identifier and version separated by '@' like '{0}@{1}'. + Package reference in the form of a package identifier like '{0}' or package identifier and version separated by '@' like '{0}@{1}'. diff --git a/src/Cli/dotnet/xlf/CliStrings.zh-Hans.xlf b/src/Cli/dotnet/xlf/CliStrings.zh-Hans.xlf index ee2890e6fb00..5b6fc1256332 100644 --- a/src/Cli/dotnet/xlf/CliStrings.zh-Hans.xlf +++ b/src/Cli/dotnet/xlf/CliStrings.zh-Hans.xlf @@ -779,8 +779,8 @@ setx PATH "%PATH%;{0}" - Package reference in the form of a package identifier like 'Newtonsoft.Json' or package identifier and version separated by '@' like 'Newtonsoft.Json@13.0.3'. - 包引用采用包标识符形式,如 'Newtonsoft.Json',或采用以 ‘@’ 分隔包标识符和版本的形式,如 ‘Newtonsoft.Json@13.0.3’。 + Package reference in the form of a package identifier like '{0}' or package identifier and version separated by '@' like '{0}@{1}'. + Package reference in the form of a package identifier like '{0}' or package identifier and version separated by '@' like '{0}@{1}'. diff --git a/src/Cli/dotnet/xlf/CliStrings.zh-Hant.xlf b/src/Cli/dotnet/xlf/CliStrings.zh-Hant.xlf index 3a06c5b7c5cd..3df700ef997d 100644 --- a/src/Cli/dotnet/xlf/CliStrings.zh-Hant.xlf +++ b/src/Cli/dotnet/xlf/CliStrings.zh-Hant.xlf @@ -779,8 +779,8 @@ setx PATH "%PATH%;{0}" - Package reference in the form of a package identifier like 'Newtonsoft.Json' or package identifier and version separated by '@' like 'Newtonsoft.Json@13.0.3'. - 套件參考的格式為套件識別碼,例如 'Newtonsoft.Json',或是以 '@' 分隔的套件識別碼和版本,例如 'Newtonsoft.Json@13.0.3'。 + Package reference in the form of a package identifier like '{0}' or package identifier and version separated by '@' like '{0}@{1}'. + Package reference in the form of a package identifier like '{0}' or package identifier and version separated by '@' like '{0}@{1}'. diff --git a/test/dotnet.Tests/CompletionTests/snapshots/zsh/DotnetCliSnapshotTests.VerifyCompletions.verified.zsh b/test/dotnet.Tests/CompletionTests/snapshots/zsh/DotnetCliSnapshotTests.VerifyCompletions.verified.zsh index 03a8a7c0f296..8bd195eccffa 100644 --- a/test/dotnet.Tests/CompletionTests/snapshots/zsh/DotnetCliSnapshotTests.VerifyCompletions.verified.zsh +++ b/test/dotnet.Tests/CompletionTests/snapshots/zsh/DotnetCliSnapshotTests.VerifyCompletions.verified.zsh @@ -1102,7 +1102,7 @@ _testhost() { '--allow-roll-forward[Allow a .NET tool to roll forward to newer versions of the .NET runtime if the runtime it targets isn'\''t installed.]' \ '--help[Show command line help.]' \ '-h[Show command line help.]' \ - ':packageId -- Package reference in the form of a package identifier like '\''Newtonsoft.Json'\'' or package identifier and version separated by '\''@'\'' like '\''Newtonsoft.Json@13.0.3'\''.:->dotnet_dynamic_complete' \ + ':packageId -- Package reference in the form of a package identifier like '\''dotnetsay'\'' or package identifier and version separated by '\''@'\'' like '\''dotnetsay@2.1.7'\''.:->dotnet_dynamic_complete' \ && ret=0 case $state in (dotnet_dynamic_complete) @@ -1150,7 +1150,7 @@ _testhost() { '--all[Update all tools.]' \ '--help[Show command line help.]' \ '-h[Show command line help.]' \ - '::packageId -- Package reference in the form of a package identifier like '\''Newtonsoft.Json'\'' or package identifier and version separated by '\''@'\'' like '\''Newtonsoft.Json@13.0.3'\''.:->dotnet_dynamic_complete' \ + '::packageId -- Package reference in the form of a package identifier like '\''dotnetsay'\'' or package identifier and version separated by '\''@'\'' like '\''dotnetsay@2.1.7'\''.:->dotnet_dynamic_complete' \ && ret=0 case $state in (dotnet_dynamic_complete) @@ -1228,7 +1228,7 @@ _testhost() { '-v=[Set the MSBuild verbosity level. Allowed values are q\[uiet\], m\[inimal\], n\[ormal\], d\[etailed\], and diag\[nostic\].]:LEVEL:((d\:"d" detailed\:"detailed" diag\:"diag" diagnostic\:"diagnostic" m\:"m" minimal\:"minimal" n\:"n" normal\:"normal" q\:"q" quiet\:"quiet" ))' \ '--help[Show command line help.]' \ '-h[Show command line help.]' \ - ':packageId -- Package reference in the form of a package identifier like '\''Newtonsoft.Json'\'' or package identifier and version separated by '\''@'\'' like '\''Newtonsoft.Json@13.0.3'\''.:->dotnet_dynamic_complete' \ + ':packageId -- Package reference in the form of a package identifier like '\''dotnetsay'\'' or package identifier and version separated by '\''@'\'' like '\''dotnetsay@2.1.7'\''.:->dotnet_dynamic_complete' \ '*::commandArguments -- Arguments forwarded to the tool: ' \ && ret=0 case $state in