Skip to content
This repository was archived by the owner on Apr 20, 2023. It is now read-only.

Commit 88b2e06

Browse files
William Liwilliaml33
authored andcommitted
Merged host and SDK help
Change help according to https://github.com/dotnet/cli/issues/6215
1 parent 6647edd commit 88b2e06

File tree

3 files changed

+90
-67
lines changed

3 files changed

+90
-67
lines changed

src/dotnet/commands/dotnet-help/HelpUsageText.cs

Lines changed: 34 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,43 +3,45 @@
33
internal static class HelpUsageText
44
{
55
public static readonly string UsageText =
6-
$@"{LocalizableStrings.Usage}: dotnet [host-options] [command] [arguments] [common-options]
6+
$@"{LocalizableStrings.Usage}: dotnet [runtime-options] [path-to-application]
7+
{LocalizableStrings.Usage}: dotnet [command] [arguments] [command-options]
78
8-
{LocalizableStrings.Arguments}:
9-
[command] {LocalizableStrings.CommandDefinition}
10-
[arguments] {LocalizableStrings.ArgumentsDefinition}
11-
[host-options] {LocalizableStrings.HostOptionsDefinition}
12-
[common-options] {LocalizableStrings.OptionsDescription}
9+
path-to-application:
10+
{LocalizableStrings.PathToApplicationDefinition}
11+
12+
{LocalizableStrings.Commands}:
13+
new {LocalizableStrings.NewDefinition}
14+
restore {LocalizableStrings.RestoreDefinition}
15+
run {LocalizableStrings.RunDefinition}
16+
build {LocalizableStrings.BuildDefinition}
17+
publish {LocalizableStrings.PublishDefinition}
18+
test {LocalizableStrings.TestDefinition}
19+
pack {LocalizableStrings.PackDefinition}
20+
migrate {LocalizableStrings.MigrateDefinition}
21+
clean {LocalizableStrings.CleanDefinition}
22+
sln {LocalizableStrings.SlnDefinition}
23+
add {LocalizableStrings.AddDefinition}
24+
remove {LocalizableStrings.RemoveDefinition}
25+
list {LocalizableStrings.ListDefinition}
26+
nuget {LocalizableStrings.NugetDefinition}
27+
msbuild {LocalizableStrings.MsBuildDefinition}
28+
vstest {LocalizableStrings.VsTestDefinition}
29+
-v|--version {LocalizableStrings.SDKVersionCommandDefinition}
30+
-i|--info {LocalizableStrings.SDKInfoCommandDefinition}
31+
-d|--diagnostics {LocalizableStrings.SDKDiagnosticsCommandDefinition}
1332
1433
{LocalizableStrings.CommonOptions}:
1534
-v|--verbose {LocalizableStrings.VerboseDefinition}
1635
-h|--help {LocalizableStrings.HelpDefinition}
1736
18-
{LocalizableStrings.HostOptions}:
19-
-d|--diagnostics {LocalizableStrings.DiagnosticsDefinition}
20-
--version {LocalizableStrings.VersionDescription}
21-
--info {LocalizableStrings.InfoDescription}
22-
23-
{LocalizableStrings.Commands}:
24-
new {LocalizableStrings.NewDefinition}
25-
restore {LocalizableStrings.RestoreDefinition}
26-
build {LocalizableStrings.BuildDefinition}
27-
publish {LocalizableStrings.PublishDefinition}
28-
run {LocalizableStrings.RunDefinition}
29-
test {LocalizableStrings.TestDefinition}
30-
pack {LocalizableStrings.PackDefinition}
31-
migrate {LocalizableStrings.MigrateDefinition}
32-
clean {LocalizableStrings.CleanDefinition}
33-
sln {LocalizableStrings.SlnDefinition}
34-
35-
{LocalizableStrings.ProjectModificationCommands}:
36-
add {LocalizableStrings.AddDefinition}
37-
remove {LocalizableStrings.RemoveDefinition}
38-
list {LocalizableStrings.ListDefinition}
37+
{LocalizableStrings.RunDotnetCommandHelpForMore}
3938
40-
{LocalizableStrings.AdvancedCommands}:
41-
nuget {LocalizableStrings.NugetDefinition}
42-
msbuild {LocalizableStrings.MsBuildDefinition}
43-
vstest {LocalizableStrings.VsTestDefinition}";
39+
runtime-options:
40+
--additionalprobingpath <path> {LocalizableStrings.AdditionalprobingpathDefinition}
41+
--depsfile <path> {LocalizableStrings.DepsfilDefinition}
42+
--runtimeconfig <path> {LocalizableStrings.RuntimeconfigDefinition}
43+
--fx-version <version> {LocalizableStrings.FxVersionDefinition}
44+
--roll-forward-on-no-candidate-fx {LocalizableStrings.RollForwardOnNoCandidateFxDefinition}
45+
--additional-deps <path> {LocalizableStrings.AdditionalDeps}
46+
";
4447
}
45-

src/dotnet/commands/dotnet-help/LocalizableStrings.cs

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ internal class LocalizableStrings
3131

3232
public const string InfoDescription = "Display .NET CLI Info";
3333

34-
public const string Commands = "Commands";
34+
public const string Commands = "SDK commands";
3535

3636
public const string NewDefinition = "Initialize .NET projects.";
3737

@@ -51,11 +51,11 @@ internal class LocalizableStrings
5151

5252
public const string ProjectModificationCommands = "Project modification commands";
5353

54-
public const string AddDefinition = "Add items to the project.";
54+
public const string AddDefinition = "Add reference to the project.";
5555

56-
public const string RemoveDefinition = "Remove items from the project.";
56+
public const string RemoveDefinition = "Remove reference from the project.";
5757

58-
public const string ListDefinition = "List items in the project.";
58+
public const string ListDefinition = "List reference in the project.";
5959

6060
public const string AdvancedCommands = "Advanced Commands";
6161

@@ -79,7 +79,26 @@ internal class LocalizableStrings
7979

8080
public const string CommandArgumentDescription = "CLI command for which to view more detailed help.";
8181

82+
public const string PathToApplicationDefinition = "The path to an application .dll file to execute.";
8283

84+
public const string SDKVersionCommandDefinition = "Display .NET Core SDK version.";
8385

86+
public const string SDKInfoCommandDefinition = "Display .NET Core information.";
87+
88+
public const string SDKDiagnosticsCommandDefinition = "Enable diagnostic output.";
89+
90+
public const string RunDotnetCommandHelpForMore = "Run 'dotnet COMMAND --help' for more information on a command.";
91+
92+
public const string AdditionalprobingpathDefinition = "Path containing probing policy and assemblies to probe for.";
93+
94+
public const string DepsfilDefinition = "Path to <application>.deps.json file.";
95+
96+
public const string RuntimeconfigDefinition = "Path to <application>.runtimeconfig.json file.";
97+
98+
public const string FxVersionDefinition = "Version of the installed Shared Framework to use to run the application.";
99+
100+
public const string RollForwardOnNoCandidateFxDefinition = "Roll forward on no candidate shared framework is enabled.";
101+
102+
public const string AdditionalDeps = "Path to additonal deps.json file.";
84103
}
85104
}

test/dotnet-help.Tests/GivenThatIWantToShowHelpForDotnetCommand.cs

Lines changed: 33 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -15,44 +15,46 @@ namespace Microsoft.DotNet.Help.Tests
1515
public class GivenThatIWantToShowHelpForDotnetCommand : TestBase
1616
{
1717
private const string HelpText =
18-
@"Usage: dotnet [host-options] [command] [arguments] [common-options]
18+
@"Usage: dotnet [runtime-options] [path-to-application]
19+
Usage: dotnet [command] [arguments] [command-options]
1920
20-
Arguments:
21-
[command] The command to execute
22-
[arguments] Arguments to pass to the command
23-
[host-options] Options specific to dotnet (host)
24-
[common-options] Options common to all commands
21+
path-to-application:
22+
The path to an application .dll file to execute.
23+
24+
SDK commands:
25+
new Initialize .NET projects.
26+
restore Restore dependencies specified in the .NET project.
27+
run Compiles and immediately executes a .NET project.
28+
build Builds a .NET project.
29+
publish Publishes a .NET project for deployment (including the runtime).
30+
test Runs unit tests using the test runner specified in the project.
31+
pack Creates a NuGet package.
32+
migrate Migrates a project.json based project to a msbuild based project.
33+
clean Clean build output(s).
34+
sln Modify solution (SLN) files.
35+
add Add reference to the project.
36+
remove Remove reference from the project.
37+
list List reference in the project.
38+
nuget Provides additional NuGet commands.
39+
msbuild Runs Microsoft Build Engine (MSBuild).
40+
vstest Runs Microsoft Test Execution Command Line Tool.
41+
-v|--version Display .NET Core SDK version.
42+
-i|--info Display .NET Core information.
43+
-d|--diagnostics Enable diagnostic output.
2544
2645
Common options:
2746
-v|--verbose Enable verbose output
2847
-h|--help Show help
2948
30-
Host options (passed before the command):
31-
-d|--diagnostics Enable diagnostic output
32-
--version Display .NET CLI Version Number
33-
--info Display .NET CLI Info
34-
35-
Commands:
36-
new Initialize .NET projects.
37-
restore Restore dependencies specified in the .NET project.
38-
build Builds a .NET project.
39-
publish Publishes a .NET project for deployment (including the runtime).
40-
run Compiles and immediately executes a .NET project.
41-
test Runs unit tests using the test runner specified in the project.
42-
pack Creates a NuGet package.
43-
migrate Migrates a project.json based project to a msbuild based project.
44-
clean Clean build output(s).
45-
sln Modify solution (SLN) files.
46-
47-
Project modification commands:
48-
add Add items to the project.
49-
remove Remove items from the project.
50-
list List items in the project.
49+
Run 'dotnet COMMAND --help' for more information on a command.
5150
52-
Advanced Commands:
53-
nuget Provides additional NuGet commands.
54-
msbuild Runs Microsoft Build Engine (MSBuild).
55-
vstest Runs Microsoft Test Execution Command Line Tool.";
51+
runtime-options:
52+
--additionalprobingpath <path> Path containing probing policy and assemblies to probe for.
53+
--depsfile <path> Path to <application>.deps.json file.
54+
--runtimeconfig <path> Path to <application>.runtimeconfig.json file.
55+
--fx-version <version> Version of the installed Shared Framework to use to run the application.
56+
--roll-forward-on-no-candidate-fx Roll forward on no candidate shared framework is enabled.
57+
--additional-deps <path> Path to additonal deps.json file.";
5658

5759
[Theory]
5860
[InlineData("--help")]

0 commit comments

Comments
 (0)