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

@ -26,6 +26,21 @@ Options:
-f, --framework <FRAMEWORK> Remove reference only when targeting a specific framework
";
private const string RemoveCommandHelpText = @".NET Remove Command
Usage: dotnet remove [options] <PROJECT> [command]
Arguments:
<PROJECT> The project file to operate on. If a file is not specified, the command will search the current directory for one.
Options:
-h, --help Show help information
Commands:
package <PACKAGE_NAME> .NET Remove Package reference Command.
reference <args> .NET Remove Project to Project reference Command
";
const string FrameworkNet451Arg = "-f net451";
const string ConditionFrameworkNet451 = "== 'net451'";
const string FrameworkNetCoreApp10Arg = "-f netcoreapp1.0";
@ -129,6 +144,7 @@ Options:
.ExecuteWithCapturedOutput($"remove {commandName}");
cmd.Should().Fail();
cmd.StdErr.Should().Be("Required command was not provided.");
cmd.StdOut.Should().BeVisuallyEquivalentTo(RemoveCommandHelpText);
}
[Fact]