Localized strings for the dotnet-pack command. (#4879)
* Localized strings for the dotnet-pack command. * Moved parameters of options to a new line * Moved the other option parameters
This commit is contained in:
parent
1aa562d97f
commit
8083a68944
2 changed files with 60 additions and 19 deletions
33
src/dotnet/commands/dotnet-pack/LocalizableStrings.cs
Normal file
33
src/dotnet/commands/dotnet-pack/LocalizableStrings.cs
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
namespace Microsoft.DotNet.Tools.Pack
|
||||||
|
{
|
||||||
|
internal class LocalizableStrings
|
||||||
|
{
|
||||||
|
public const string AppFullName = "pack";
|
||||||
|
|
||||||
|
public const string AppDescription = "pack for msbuild";
|
||||||
|
|
||||||
|
public const string CmdOutputDir = "OUTPUT_DIR";
|
||||||
|
|
||||||
|
public const string CmdOutputDirDescription = "Directory in which to place outputs";
|
||||||
|
|
||||||
|
public const string CmdNoBuildOptionDescription = "Do not build project before packing";
|
||||||
|
|
||||||
|
public const string CmdIncludeSymbolsDescription = "Include PDBs along with the DLLs in the output folder";
|
||||||
|
|
||||||
|
public const string CmdIncludeSourceDescription = "Include PDBs and source files. Source files go into the src folder in the resulting nuget package";
|
||||||
|
|
||||||
|
public const string CmdConfig = "CONFIGURATION";
|
||||||
|
|
||||||
|
public const string CmdConfigDescription = "Configuration under which to build";
|
||||||
|
|
||||||
|
public const string CmdVersionSuffix = "VERSION_SUFFIX";
|
||||||
|
|
||||||
|
public const string CmdVersionSuffixDescription = "Defines what `*` should be replaced with in version field in project.json";
|
||||||
|
|
||||||
|
public const string CmdServiceableDescription = "Set the serviceable flag in the package";
|
||||||
|
|
||||||
|
public const string CmdArgumentProject = "PROJECT";
|
||||||
|
|
||||||
|
public const string CmdArgumentDescription = "The project to pack, defaults to the project file in the current directory. Can be a path to any project file";
|
||||||
|
}
|
||||||
|
}
|
|
@ -17,37 +17,45 @@ namespace Microsoft.DotNet.Tools.Pack
|
||||||
CommandLineApplication cmd = new CommandLineApplication(throwOnUnexpectedArg: false)
|
CommandLineApplication cmd = new CommandLineApplication(throwOnUnexpectedArg: false)
|
||||||
{
|
{
|
||||||
Name = "pack",
|
Name = "pack",
|
||||||
FullName = "pack",
|
FullName = LocalizableStrings.AppFullName,
|
||||||
Description = "pack for msbuild",
|
Description = LocalizableStrings.AppDescription,
|
||||||
AllowArgumentSeparator = true,
|
AllowArgumentSeparator = true,
|
||||||
ArgumentSeparatorHelpText = HelpMessageStrings.MSBuildAdditionalArgsHelpText
|
ArgumentSeparatorHelpText = HelpMessageStrings.MSBuildAdditionalArgsHelpText
|
||||||
};
|
};
|
||||||
|
|
||||||
cmd.HelpOption("-h|--help");
|
cmd.HelpOption("-h|--help");
|
||||||
|
|
||||||
var output = cmd.Option("-o|--output <OUTPUT_DIR>",
|
var output = cmd.Option(
|
||||||
"Directory in which to place outputs",
|
$"-o|--output <{LocalizableStrings.CmdOutputDir}>",
|
||||||
|
LocalizableStrings.CmdOutputDirDescription,
|
||||||
CommandOptionType.SingleValue);
|
CommandOptionType.SingleValue);
|
||||||
var noBuild = cmd.Option("--no-build",
|
var noBuild = cmd.Option(
|
||||||
"Do not build project before packing",
|
"--no-build",
|
||||||
|
LocalizableStrings.CmdNoBuildOptionDescription,
|
||||||
CommandOptionType.NoValue);
|
CommandOptionType.NoValue);
|
||||||
var includeSymbols = cmd.Option("--include-symbols",
|
var includeSymbols = cmd.Option(
|
||||||
"Include PDBs along with the DLLs in the output folder",
|
"--include-symbols",
|
||||||
|
LocalizableStrings.CmdIncludeSymbolsDescription,
|
||||||
CommandOptionType.NoValue);
|
CommandOptionType.NoValue);
|
||||||
var includeSource = cmd.Option("--include-source",
|
var includeSource = cmd.Option(
|
||||||
"Include PDBs and source files. Source files go into the src folder in the resulting nuget package",
|
"--include-source",
|
||||||
|
LocalizableStrings.CmdIncludeSourceDescription,
|
||||||
CommandOptionType.NoValue);
|
CommandOptionType.NoValue);
|
||||||
var configuration = cmd.Option("-c|--configuration <CONFIGURATION>",
|
var configuration = cmd.Option(
|
||||||
"Configuration under which to build",
|
$"-c|--configuration <{LocalizableStrings.CmdConfig}>",
|
||||||
|
LocalizableStrings.CmdConfigDescription,
|
||||||
CommandOptionType.SingleValue);
|
CommandOptionType.SingleValue);
|
||||||
var versionSuffix = cmd.Option("--version-suffix <VERSION_SUFFIX>",
|
var versionSuffix = cmd.Option(
|
||||||
"Defines what `*` should be replaced with in version field in project.json",
|
$"--version-suffix <{LocalizableStrings.CmdVersionSuffix}>",
|
||||||
|
LocalizableStrings.CmdVersionSuffixDescription,
|
||||||
CommandOptionType.SingleValue);
|
CommandOptionType.SingleValue);
|
||||||
var serviceable = cmd.Option("-s|--serviceable",
|
var serviceable = cmd.Option(
|
||||||
"Set the serviceable flag in the package",
|
"-s|--serviceable",
|
||||||
|
LocalizableStrings.CmdServiceableDescription,
|
||||||
CommandOptionType.NoValue);
|
CommandOptionType.NoValue);
|
||||||
var argRoot = cmd.Argument("<PROJECT>",
|
var argRoot = cmd.Argument(
|
||||||
"The project to pack, defaults to the project file in the current directory. Can be a path to any project file",
|
$"<{LocalizableStrings.CmdArgumentProject}>",
|
||||||
|
LocalizableStrings.CmdArgumentDescription,
|
||||||
multipleValues:true);
|
multipleValues:true);
|
||||||
CommandOption verbosityOption = MSBuildForwardingApp.AddVerbosityOption(cmd);
|
CommandOption verbosityOption = MSBuildForwardingApp.AddVerbosityOption(cmd);
|
||||||
|
|
||||||
|
@ -107,4 +115,4 @@ namespace Microsoft.DotNet.Tools.Pack
|
||||||
return cmd.Execute(args);
|
return cmd.Execute(args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue