rename command show-topic to help

This commit is contained in:
Chris Cheetham 2020-02-17 11:19:14 -05:00
Родитель 178d8b60ae
Коммит eda4ca38ee
4 изменённых файлов: 24 добавлений и 24 удалений

Просмотреть файл

@ -29,16 +29,16 @@ Overview:
Examples:
Display documentation for autodetection:
$ st show-topic autodetection"
$ st help autodetection"
)]
public class ShowTopicCommand : Command
public class HelpCommand : Command
{
public const string CommandName = "show-topic";
public const string CommandName = "help";
[Argument(0, Name = "topic", Description = "Topic")]
private string Topic { get; } = null;
public ShowTopicCommand(IConsole console) : base(console)
public HelpCommand(IConsole console) : base(console)
{
}

Просмотреть файл

@ -23,6 +23,7 @@ namespace Steeltoe.Cli
[Subcommand(AddDependencyCommand.CommandName, typeof(AddDependencyCommand))]
[Subcommand(DefineDependencyCommand.CommandName, typeof(DefineDependencyCommand))]
[Subcommand(DoctorCommand.CommandName, typeof(DoctorCommand))]
[Subcommand(HelpCommand.CommandName, typeof(HelpCommand))]
[Subcommand(ListConfigurationsCommand.CommandName, typeof(ListConfigurationsCommand))]
[Subcommand(ListDependenciesCommand.CommandName, typeof(ListDependenciesCommand))]
[Subcommand(ListTemplatesCommand.CommandName, typeof(ListTemplatesCommand))]
@ -32,7 +33,6 @@ namespace Steeltoe.Cli
[Subcommand(RunCommand.CommandName, typeof(RunCommand))]
[Subcommand(ShowCommand.CommandName, typeof(ShowCommand))]
[Subcommand(ShowConfigurationCommand.CommandName, typeof(ShowConfigurationCommand))]
[Subcommand(ShowTopicCommand.CommandName, typeof(ShowTopicCommand))]
[Subcommand(StopCommand.CommandName, typeof(StopCommand))]
[Subcommand(UndefineDependencyCommand.CommandName, typeof(UndefineDependencyCommand))]
public class Program

Просмотреть файл

@ -17,19 +17,19 @@ using LightBDD.XUnit2;
namespace Steeltoe.Cli.Test
{
public class ShowTopicFeature : FeatureSpecs
public class HelpFeature : FeatureSpecs
{
[Scenario]
public void ShowTopicHelp()
public void HelpHelp()
{
Runner.RunScenario(
given => an_empty_directory("show_topic_help"),
when => the_developer_runs_cli_command("show-topic --help"),
given => an_empty_directory("help_help"),
when => the_developer_runs_cli_command("help --help"),
then => the_cli_command_should_succeed(),
and => the_cli_should_output(new[]
{
"Displays documentation on a topic",
$"Usage: {Program.Name} show-topic [arguments] [options]",
$"Usage: {Program.Name} help [arguments] [options]",
"Arguments:",
"topic Topic",
"Options:",
@ -38,27 +38,27 @@ namespace Steeltoe.Cli.Test
"Displays documentation for various topics. Run with no arguments for a list of available topics.",
"Examples:",
"Display documentation for autodetection:",
"$ st show-topic autodetection",
"$ st help autodetection",
})
);
}
[Scenario]
public void ShowTopicTooManyArgs()
public void HelpTooManyArgs()
{
Runner.RunScenario(
given => an_empty_directory("show_topic_too_many_args"),
when => the_developer_runs_cli_command("show-topic arg1 arg2"),
given => an_empty_directory("help_too_many_args"),
when => the_developer_runs_cli_command("help arg1 arg2"),
then => the_cli_should_fail_parse("Unrecognized command or argument 'arg2'")
);
}
[Scenario]
public void ShowTopicList()
public void HelpTopicList()
{
Runner.RunScenario(
given => an_empty_directory("show_topic_list"),
when => the_developer_runs_cli_command("show-topic"),
given => an_empty_directory("help_topic_list"),
when => the_developer_runs_cli_command("help"),
then => the_cli_command_should_succeed(),
and => the_cli_should_output(new[]
{
@ -68,21 +68,21 @@ namespace Steeltoe.Cli.Test
}
[Scenario]
public void ShowTopicNotFound()
public void HelpNotFound()
{
Runner.RunScenario(
given => an_empty_directory("show_topic_not_found"),
when => the_developer_runs_cli_command("show-topic no-such-topic"),
given => an_empty_directory("help_topic_not_found"),
when => the_developer_runs_cli_command("help no-such-topic"),
then => the_cli_should_error(ErrorCode.Tooling, "'no-such-topic' does not exist")
);
}
[Scenario]
public void ShowTopicAutodetection()
public void HelpAutodetection()
{
Runner.RunScenario(
given => an_empty_directory("show_topic_autodetection"),
when => the_developer_runs_cli_command("show-topic autodetection"),
given => an_empty_directory("help_topic_autodetection"),
when => the_developer_runs_cli_command("help autodetection"),
then => the_cli_command_should_succeed(),
and => the_cli_should_output(new[]
{

Просмотреть файл

@ -53,6 +53,7 @@ namespace Steeltoe.Cli.Test
"add-dep Adds a dependency",
"def-dep Adds a custom dependency definition",
"doctor Checks for potential problems",
"help Displays documentation on a topic",
"list-cfgs Displays a list of available configurations",
"list-deps Displays a list of available dependencies",
"list-templates Displays a list of available templates",
@ -62,7 +63,6 @@ namespace Steeltoe.Cli.Test
"run Runs the project in the local Docker environment",
"show Displays the project details",
"show-cfg Displays configuration details",
"show-topic Displays documentation on a topic",
"stop Stops the project running in the local Docker environment",
"undef-dep Removes a custom dependency definition",
$"Run 'st [command] --help' for more information about a command.",