help text adjustments for dotnet sln

This commit is contained in:
Jon Sequeira 2017-03-14 11:23:19 -07:00
parent 96683c1421
commit 898d10cb2d
5 changed files with 14 additions and 14 deletions

View file

@ -79,7 +79,7 @@ namespace Microsoft.DotNet.Cli
} }
catch (HelpException e) catch (HelpException e)
{ {
Reporter.Output.Write(e.Message); Reporter.Output.WriteLine(e.Message);
return 0; return 0;
} }
catch (Exception e) when (e.ShouldBeDisplayedAsError()) catch (Exception e) when (e.ShouldBeDisplayedAsError())
@ -92,7 +92,7 @@ namespace Microsoft.DotNet.Cli
} }
catch (Exception e) when (!e.ShouldBeDisplayedAsError()) catch (Exception e) when (!e.ShouldBeDisplayedAsError())
{ {
Reporter.Output.WriteLine(e.ToString().Red().Bold()); Reporter.Error.WriteLine(e.ToString().Red().Bold());
return 1; return 1;
} }

View file

@ -25,13 +25,14 @@ namespace Microsoft.DotNet.Cli
description: LocalizableStrings.AddSubcommandHelpText), description: LocalizableStrings.AddSubcommandHelpText),
CommonOptions.HelpOption()), CommonOptions.HelpOption()),
Create.Command("list", Create.Command("list",
"List all projects in the solution.", ".NET List project(s) in a solution file Command",
CommonOptions.HelpOption()), CommonOptions.HelpOption()),
Create.Command("remove", Create.Command("remove",
"Remove the specified project(s) from the solution. The project is not impacted.", ".NET Remove project(s) from a solution file Command",
Accept.OneOrMoreArguments() Accept.OneOrMoreArguments(o => CommonLocalizableStrings.SpecifyAtLeastOneProjectToRemove)
.With(name: "args", .With(name: "args",
description: LocalizableStrings.RemoveSubcommandHelpText), description: LocalizableStrings.RemoveSubcommandHelpText),
CommonOptions.HelpOption())); CommonOptions.HelpOption()));
} }
} }

View file

@ -24,7 +24,7 @@ namespace Microsoft.DotNet.Tools.Sln.Remove
throw new ArgumentNullException(nameof(appliedCommand)); throw new ArgumentNullException(nameof(appliedCommand));
} }
if (_appliedCommand.Arguments.Count == 0) if (appliedCommand.Arguments.Count == 0)
{ {
throw new GracefulException(CommonLocalizableStrings.SpecifyAtLeastOneProjectToRemove); throw new GracefulException(CommonLocalizableStrings.SpecifyAtLeastOneProjectToRemove);
} }

View file

@ -18,10 +18,11 @@ namespace Microsoft.DotNet.Cli.Sln.List.Tests
Usage: dotnet sln <SLN_FILE> list [options] Usage: dotnet sln <SLN_FILE> list [options]
Arguments: Arguments:
<SLN_FILE> Solution file to operate on. If not specified, the command will search the current directory for one. <SLN_FILE> Solution file to operate on. If not specified, the command will search the current directory for one.
Options: Options:
-h|--help Show help information"; -h, --help Show help information
";
[Theory] [Theory]
[InlineData("--help")] [InlineData("--help")]

View file

@ -15,16 +15,14 @@ namespace Microsoft.DotNet.Cli.Sln.Remove.Tests
{ {
private const string HelpText = @".NET Remove project(s) from a solution file Command private const string HelpText = @".NET Remove project(s) from a solution file Command
Usage: dotnet sln <SLN_FILE> remove [options] [args] Usage: dotnet sln <SLN_FILE> remove [options] <args>
Arguments: Arguments:
<SLN_FILE> Solution file to operate on. If not specified, the command will search the current directory for one. <SLN_FILE> Solution file to operate on. If not specified, the command will search the current directory for one.
<args> Remove the specified project(s) from the solution. The project is not impacted.
Options: Options:
-h|--help Show help information -h, --help Show help information
Additional Arguments:
Remove the specified project(s) from the solution. The project is not impacted.
"; ";
private const string ExpectedSlnContentsAfterRemove = @" private const string ExpectedSlnContentsAfterRemove = @"