Skip to content

Commit

Permalink
Merge pull request #18301 from dsplaisted/deprecate-dotnet-run-p
Browse files Browse the repository at this point in the history
Deprecate -p option (in short form) to dotnet run
  • Loading branch information
dsplaisted authored Jun 18, 2021
2 parents 71d68fe + e6d84d4 commit 57122c7
Show file tree
Hide file tree
Showing 31 changed files with 178 additions and 6 deletions.
5 changes: 4 additions & 1 deletion src/Cli/dotnet/commands/dotnet-run/LocalizableStrings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -217,4 +217,7 @@ The current {1} is '{2}'.</value>
<data name="ValueMustBeAnObject" xml:space="preserve">
<value>The property '{0}' must be an object if it is specified.</value>
</data>
</root>
<data name="RunCommandProjectAbbreviationDeprecated" xml:space="preserve">
<value>Warning NETSDK1174: The abbreviation of -p for --project is deprecated. Please use --project.</value>
</data>
</root>
12 changes: 11 additions & 1 deletion src/Cli/dotnet/commands/dotnet-run/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,22 @@ public static RunCommand FromArgs(string[] args)
throw new HelpException(string.Empty);
}

string project = parseResult.ValueForOption<string>(RunCommandParser.ProjectOptionShort);
if (!string.IsNullOrEmpty(project))
{
Console.WriteLine(LocalizableStrings.RunCommandProjectAbbreviationDeprecated.Yellow());
}
else
{
project = parseResult.ValueForOption<string>(RunCommandParser.ProjectOption);
}

var command = new RunCommand(
configuration: parseResult.ValueForOption<string>(RunCommandParser.ConfigurationOption),
framework: parseResult.ValueForOption<string>(RunCommandParser.FrameworkOption),
runtime: parseResult.ValueForOption<string>(RunCommandParser.RuntimeOption),
noBuild: parseResult.HasOption(RunCommandParser.NoBuildOption),
project: parseResult.ValueForOption<string>(RunCommandParser.ProjectOption),
project: project,
launchProfile: parseResult.ValueForOption<string>(RunCommandParser.LaunchProfileOption),
noLaunchProfile: parseResult.HasOption(RunCommandParser.NoLaunchProfileOption),
noRestore: parseResult.HasOption(RunCommandParser.NoRestoreOption) || parseResult.HasOption(RunCommandParser.NoBuildOption),
Expand Down
8 changes: 7 additions & 1 deletion src/Cli/dotnet/commands/dotnet-run/RunCommandParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ internal static class RunCommandParser

public static readonly Option RuntimeOption = CommonOptions.RuntimeOption(LocalizableStrings.RuntimeOptionDescription);

public static readonly Option ProjectOption = new Option<string>(new string[] { "-p", "--project" }, LocalizableStrings.CommandOptionProjectDescription);
public static readonly Option ProjectOption = new Option<string>("--project", LocalizableStrings.CommandOptionProjectDescription);

public static readonly Option ProjectOptionShort = new Option<string>("-p", LocalizableStrings.CommandOptionProjectDescription)
{
IsHidden = true
};

public static readonly Option LaunchProfileOption = new Option<string>("--launch-profile", LocalizableStrings.CommandOptionLaunchProfileDescription);

Expand All @@ -35,6 +40,7 @@ public static Command GetCommand()
command.AddOption(FrameworkOption);
command.AddOption(RuntimeOption);
command.AddOption(ProjectOption);
command.AddOption(ProjectOptionShort);
command.AddOption(LaunchProfileOption);
command.AddOption(NoLaunchProfileOption);
command.AddOption(NoBuildOption);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ Aktuální {1} je {2}.</target>
<target state="translated">(výchozí)</target>
<note />
</trans-unit>
<trans-unit id="RunCommandProjectAbbreviationDeprecated">
<source>Warning NETSDK1174: The abbreviation of -p for --project is deprecated. Please use --project.</source>
<target state="new">Warning NETSDK1174: The abbreviation of -p for --project is deprecated. Please use --project.</target>
<note />
</trans-unit>
<trans-unit id="UsingLaunchSettingsFromMessage">
<source>Using launch settings from {0}...</source>
<target state="translated">Použití nastavení spuštění z {0}...</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ Ein ausführbares Projekt muss ein ausführbares TFM (z. B. net5.0) und den Outp
<target state="translated">(Standard)</target>
<note />
</trans-unit>
<trans-unit id="RunCommandProjectAbbreviationDeprecated">
<source>Warning NETSDK1174: The abbreviation of -p for --project is deprecated. Please use --project.</source>
<target state="new">Warning NETSDK1174: The abbreviation of -p for --project is deprecated. Please use --project.</target>
<note />
</trans-unit>
<trans-unit id="UsingLaunchSettingsFromMessage">
<source>Using launch settings from {0}...</source>
<target state="translated">Die Starteinstellungen von {0} werden verwendet…</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ El valor actual de {1} es "{2}".</target>
<target state="translated">(Predeterminada)</target>
<note />
</trans-unit>
<trans-unit id="RunCommandProjectAbbreviationDeprecated">
<source>Warning NETSDK1174: The abbreviation of -p for --project is deprecated. Please use --project.</source>
<target state="new">Warning NETSDK1174: The abbreviation of -p for --project is deprecated. Please use --project.</target>
<note />
</trans-unit>
<trans-unit id="UsingLaunchSettingsFromMessage">
<source>Using launch settings from {0}...</source>
<target state="translated">Usando la configuración de inicio de {0}...</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ Le {1} actuel est '{2}'.</target>
<target state="translated">(Par défaut)</target>
<note />
</trans-unit>
<trans-unit id="RunCommandProjectAbbreviationDeprecated">
<source>Warning NETSDK1174: The abbreviation of -p for --project is deprecated. Please use --project.</source>
<target state="new">Warning NETSDK1174: The abbreviation of -p for --project is deprecated. Please use --project.</target>
<note />
</trans-unit>
<trans-unit id="UsingLaunchSettingsFromMessage">
<source>Using launch settings from {0}...</source>
<target state="translated">Utilisation des paramètres de lancement à partir de {0}...</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ Il valore corrente di {1} è '{2}'.</target>
<target state="translated">(Predefinita)</target>
<note />
</trans-unit>
<trans-unit id="RunCommandProjectAbbreviationDeprecated">
<source>Warning NETSDK1174: The abbreviation of -p for --project is deprecated. Please use --project.</source>
<target state="new">Warning NETSDK1174: The abbreviation of -p for --project is deprecated. Please use --project.</target>
<note />
</trans-unit>
<trans-unit id="UsingLaunchSettingsFromMessage">
<source>Using launch settings from {0}...</source>
<target state="translated">Uso delle impostazioni di avvio di {0}...</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ The current {1} is '{2}'.</source>
<target state="translated">(既定)</target>
<note />
</trans-unit>
<trans-unit id="RunCommandProjectAbbreviationDeprecated">
<source>Warning NETSDK1174: The abbreviation of -p for --project is deprecated. Please use --project.</source>
<target state="new">Warning NETSDK1174: The abbreviation of -p for --project is deprecated. Please use --project.</target>
<note />
</trans-unit>
<trans-unit id="UsingLaunchSettingsFromMessage">
<source>Using launch settings from {0}...</source>
<target state="translated">{0} からの起動設定を使用中...</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ The current {1} is '{2}'.</source>
<target state="translated">(기본값)</target>
<note />
</trans-unit>
<trans-unit id="RunCommandProjectAbbreviationDeprecated">
<source>Warning NETSDK1174: The abbreviation of -p for --project is deprecated. Please use --project.</source>
<target state="new">Warning NETSDK1174: The abbreviation of -p for --project is deprecated. Please use --project.</target>
<note />
</trans-unit>
<trans-unit id="UsingLaunchSettingsFromMessage">
<source>Using launch settings from {0}...</source>
<target state="translated">{0}의 시작 설정을 사용하는 중...</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ Bieżący element {1}: „{2}”.</target>
<target state="translated">(Domyślne)</target>
<note />
</trans-unit>
<trans-unit id="RunCommandProjectAbbreviationDeprecated">
<source>Warning NETSDK1174: The abbreviation of -p for --project is deprecated. Please use --project.</source>
<target state="new">Warning NETSDK1174: The abbreviation of -p for --project is deprecated. Please use --project.</target>
<note />
</trans-unit>
<trans-unit id="UsingLaunchSettingsFromMessage">
<source>Using launch settings from {0}...</source>
<target state="translated">Używanie ustawień uruchamiania z profilu {0}...</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ O {1} atual é '{2}'.</target>
<target state="translated">(Padrão)</target>
<note />
</trans-unit>
<trans-unit id="RunCommandProjectAbbreviationDeprecated">
<source>Warning NETSDK1174: The abbreviation of -p for --project is deprecated. Please use --project.</source>
<target state="new">Warning NETSDK1174: The abbreviation of -p for --project is deprecated. Please use --project.</target>
<note />
</trans-unit>
<trans-unit id="UsingLaunchSettingsFromMessage">
<source>Using launch settings from {0}...</source>
<target state="translated">Usando as configurações de inicialização de {0}...</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ The current {1} is '{2}'.</source>
<target state="translated">(По умолчанию)</target>
<note />
</trans-unit>
<trans-unit id="RunCommandProjectAbbreviationDeprecated">
<source>Warning NETSDK1174: The abbreviation of -p for --project is deprecated. Please use --project.</source>
<target state="new">Warning NETSDK1174: The abbreviation of -p for --project is deprecated. Please use --project.</target>
<note />
</trans-unit>
<trans-unit id="UsingLaunchSettingsFromMessage">
<source>Using launch settings from {0}...</source>
<target state="translated">Используются параметры запуска из {0}...</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ Geçerli {1}: '{2}'.</target>
<target state="translated">(Varsayılan)</target>
<note />
</trans-unit>
<trans-unit id="RunCommandProjectAbbreviationDeprecated">
<source>Warning NETSDK1174: The abbreviation of -p for --project is deprecated. Please use --project.</source>
<target state="new">Warning NETSDK1174: The abbreviation of -p for --project is deprecated. Please use --project.</target>
<note />
</trans-unit>
<trans-unit id="UsingLaunchSettingsFromMessage">
<source>Using launch settings from {0}...</source>
<target state="translated">{0} içindeki başlatma ayarları kullanılıyor...</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ The current {1} is '{2}'.</source>
<target state="translated">(默认值)</target>
<note />
</trans-unit>
<trans-unit id="RunCommandProjectAbbreviationDeprecated">
<source>Warning NETSDK1174: The abbreviation of -p for --project is deprecated. Please use --project.</source>
<target state="new">Warning NETSDK1174: The abbreviation of -p for --project is deprecated. Please use --project.</target>
<note />
</trans-unit>
<trans-unit id="UsingLaunchSettingsFromMessage">
<source>Using launch settings from {0}...</source>
<target state="translated">从 {0} 使用启动设置...</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ The current {1} is '{2}'.</source>
<target state="translated">(預設)</target>
<note />
</trans-unit>
<trans-unit id="RunCommandProjectAbbreviationDeprecated">
<source>Warning NETSDK1174: The abbreviation of -p for --project is deprecated. Please use --project.</source>
<target state="new">Warning NETSDK1174: The abbreviation of -p for --project is deprecated. Please use --project.</target>
<note />
</trans-unit>
<trans-unit id="UsingLaunchSettingsFromMessage">
<source>Using launch settings from {0}...</source>
<target state="translated">使用來自 {0} 的啟動設定...</target>
Expand Down
6 changes: 5 additions & 1 deletion src/Tasks/Common/Resources/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -807,4 +807,8 @@ To install these workloads, run the following command: {1}</value>
<value>NETSDK1173: The provided type library '{0}' is in an invalid format.</value>
<comment>{StrBegin="NETSDK1173: "}</comment>
</data>
</root>
<data name="PlaceholderRunCommandProjectAbbreviationDeprecated" xml:space="preserve">
<value>NETSDK1174: Placeholder</value>
<comment>{StrBegin="NETSDK1174: "} - This string is not used here, but is a placeholder for the error code, which is used by the "dotnet run" command.</comment>
</data>
</root>
5 changes: 5 additions & 0 deletions src/Tasks/Common/Resources/xlf/Strings.cs.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,11 @@ The following are names of parameters or literal values and should not be transl
<target state="translated">NETSDK1071: PackageReference na balíček {0} určuje verzi {1}. Určení verze tohoto balíčku se nedoporučuje. Další informace najdete na adrese https://aka.ms/sdkimplicitrefs.</target>
<note>{StrBegin="NETSDK1071: "}</note>
</trans-unit>
<trans-unit id="PlaceholderRunCommandProjectAbbreviationDeprecated">
<source>NETSDK1174: Placeholder</source>
<target state="new">NETSDK1174: Placeholder</target>
<note>{StrBegin="NETSDK1174: "} - This string is not used here, but is a placeholder for the error code, which is used by the "dotnet run" command.</note>
</trans-unit>
<trans-unit id="ProjectAssetsConsumedWithoutMSBuildProjectPath">
<source>NETSDK1011: Assets are consumed from project '{0}', but no corresponding MSBuild project path was found in '{1}'.</source>
<target state="translated">NETSDK1011: Prostředky se používají z projektu {0}, ale v {1} se nenašla odpovídající cesta k projektu MSBuild.</target>
Expand Down
5 changes: 5 additions & 0 deletions src/Tasks/Common/Resources/xlf/Strings.de.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,11 @@ The following are names of parameters or literal values and should not be transl
<target state="translated">NETSDK1071: Ein PackageReference-Verweis auf "{0}" hat die Version "{1}" angegeben. Die Angabe der Version dieses Pakets wird nicht empfohlen. Weitere Informationen finden Sie unter https://aka.ms/sdkimplicitrefs.</target>
<note>{StrBegin="NETSDK1071: "}</note>
</trans-unit>
<trans-unit id="PlaceholderRunCommandProjectAbbreviationDeprecated">
<source>NETSDK1174: Placeholder</source>
<target state="new">NETSDK1174: Placeholder</target>
<note>{StrBegin="NETSDK1174: "} - This string is not used here, but is a placeholder for the error code, which is used by the "dotnet run" command.</note>
</trans-unit>
<trans-unit id="ProjectAssetsConsumedWithoutMSBuildProjectPath">
<source>NETSDK1011: Assets are consumed from project '{0}', but no corresponding MSBuild project path was found in '{1}'.</source>
<target state="translated">NETSDK1011: Es werden Ressourcen aus dem Projekt "{0}" genutzt, in "{1}" wurde jedoch kein entsprechender MSBuild-Projektpfad gefunden.</target>
Expand Down
5 changes: 5 additions & 0 deletions src/Tasks/Common/Resources/xlf/Strings.es.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,11 @@ The following are names of parameters or literal values and should not be transl
<target state="new">NETSDK1071: A PackageReference to '{0}' specified a Version of `{1}`. Specifying the version of this package is not recommended. For more information, see https://aka.ms/sdkimplicitrefs</target>
<note>{StrBegin="NETSDK1071: "}</note>
</trans-unit>
<trans-unit id="PlaceholderRunCommandProjectAbbreviationDeprecated">
<source>NETSDK1174: Placeholder</source>
<target state="new">NETSDK1174: Placeholder</target>
<note>{StrBegin="NETSDK1174: "} - This string is not used here, but is a placeholder for the error code, which is used by the "dotnet run" command.</note>
</trans-unit>
<trans-unit id="ProjectAssetsConsumedWithoutMSBuildProjectPath">
<source>NETSDK1011: Assets are consumed from project '{0}', but no corresponding MSBuild project path was found in '{1}'.</source>
<target state="new">NETSDK1011: Assets are consumed from project '{0}', but no corresponding MSBuild project path was found in '{1}'.</target>
Expand Down
5 changes: 5 additions & 0 deletions src/Tasks/Common/Resources/xlf/Strings.fr.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,11 @@ The following are names of parameters or literal values and should not be transl
<target state="translated">NETSDK1071: Une référence de package vers '{0}' a spécifié une version '{1}'. Nous ne vous recommandons pas de spécifier la version de ce package. Pour plus d'informations, consultez https://aka.ms/sdkimplicitrefs</target>
<note>{StrBegin="NETSDK1071: "}</note>
</trans-unit>
<trans-unit id="PlaceholderRunCommandProjectAbbreviationDeprecated">
<source>NETSDK1174: Placeholder</source>
<target state="new">NETSDK1174: Placeholder</target>
<note>{StrBegin="NETSDK1174: "} - This string is not used here, but is a placeholder for the error code, which is used by the "dotnet run" command.</note>
</trans-unit>
<trans-unit id="ProjectAssetsConsumedWithoutMSBuildProjectPath">
<source>NETSDK1011: Assets are consumed from project '{0}', but no corresponding MSBuild project path was found in '{1}'.</source>
<target state="translated">NETSDK1011: Les composants sont consommés à partir du projet '{0}', mais il n'existe aucun chemin de projet MSBuild correspondant dans '{1}'.</target>
Expand Down
5 changes: 5 additions & 0 deletions src/Tasks/Common/Resources/xlf/Strings.it.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,11 @@ The following are names of parameters or literal values and should not be transl
<target state="translated">NETSDK1071: in un elemento PackageReference che fa riferimento a '{0}' è specificata la versione di `{1}`. È consigliabile non specificare la versione di questo pacchetto. Per altre informazioni, vedere https://aka.ms/sdkimplicitrefs</target>
<note>{StrBegin="NETSDK1071: "}</note>
</trans-unit>
<trans-unit id="PlaceholderRunCommandProjectAbbreviationDeprecated">
<source>NETSDK1174: Placeholder</source>
<target state="new">NETSDK1174: Placeholder</target>
<note>{StrBegin="NETSDK1174: "} - This string is not used here, but is a placeholder for the error code, which is used by the "dotnet run" command.</note>
</trans-unit>
<trans-unit id="ProjectAssetsConsumedWithoutMSBuildProjectPath">
<source>NETSDK1011: Assets are consumed from project '{0}', but no corresponding MSBuild project path was found in '{1}'.</source>
<target state="translated">NETSDK1011: le risorse vengono utilizzate dal progetto '{0}', ma non è stato trovato alcun percorso di progetto MSBuild corrispondente in '{1}'.</target>
Expand Down
5 changes: 5 additions & 0 deletions src/Tasks/Common/Resources/xlf/Strings.ja.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,11 @@ The following are names of parameters or literal values and should not be transl
<target state="translated">NETSDK1071: '{0}' への PackageReference は '{1}' のバージョンを指定しました。このパッケージのバージョンを指定することは推奨されません。詳細については、https://aka.ms/sdkimplicitrefs を参照してください</target>
<note>{StrBegin="NETSDK1071: "}</note>
</trans-unit>
<trans-unit id="PlaceholderRunCommandProjectAbbreviationDeprecated">
<source>NETSDK1174: Placeholder</source>
<target state="new">NETSDK1174: Placeholder</target>
<note>{StrBegin="NETSDK1174: "} - This string is not used here, but is a placeholder for the error code, which is used by the "dotnet run" command.</note>
</trans-unit>
<trans-unit id="ProjectAssetsConsumedWithoutMSBuildProjectPath">
<source>NETSDK1011: Assets are consumed from project '{0}', but no corresponding MSBuild project path was found in '{1}'.</source>
<target state="translated">NETSDK1011: プロジェクト '{0}' の資産が使用されますが、対応する MSBuild プロジェクト パスが '{1}' で見つかりませんでした。</target>
Expand Down
Loading

0 comments on commit 57122c7

Please sign in to comment.