Show help info when no or wrong arguments are given

Fixes #5383, fixes #5384
This commit is contained in:
Mikkel Nylander Bundgaard 2017-05-04 01:01:35 +02:00
parent f3a4b22457
commit 18d71a8471
8 changed files with 124 additions and 4 deletions

View file

@ -24,6 +24,22 @@ Options:
-h, --help Show help information
";
private const string SlnCommandHelpText = @".NET modify solution file command
Usage: dotnet sln [options] <SLN_FILE> [command]
Arguments:
<SLN_FILE> Solution file to operate on. If not specified, the command will search the current directory for one.
Options:
-h, --help Show help information
Commands:
add <args> .NET Add project(s) to a solution file Command
list .NET List project(s) in a solution file Command
remove <args> .NET Remove project(s) from a solution file Command
";
[Theory]
[InlineData("--help")]
[InlineData("-h")]
@ -44,6 +60,7 @@ Options:
.ExecuteWithCapturedOutput($"sln {commandName}");
cmd.Should().Fail();
cmd.StdErr.Should().Be("Required command was not provided.");
cmd.StdOut.Should().BeVisuallyEquivalentTo(SlnCommandHelpText);
}
[Fact]