diff --git a/src/Steeltoe.Cli/ShowTopicCommand.cs b/src/Steeltoe.Cli/HelpCommand.cs similarity index 94% rename from src/Steeltoe.Cli/ShowTopicCommand.cs rename to src/Steeltoe.Cli/HelpCommand.cs index 0d81d39..dce4fbc 100644 --- a/src/Steeltoe.Cli/ShowTopicCommand.cs +++ b/src/Steeltoe.Cli/HelpCommand.cs @@ -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) { } diff --git a/src/Steeltoe.Cli/Program.cs b/src/Steeltoe.Cli/Program.cs index cc735be..031cd1d 100644 --- a/src/Steeltoe.Cli/Program.cs +++ b/src/Steeltoe.Cli/Program.cs @@ -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 diff --git a/test/Steeltoe.Cli.Test/ShowTopicFeature.cs b/test/Steeltoe.Cli.Test/HelpFeature.cs similarity index 69% rename from test/Steeltoe.Cli.Test/ShowTopicFeature.cs rename to test/Steeltoe.Cli.Test/HelpFeature.cs index 46395d0..006b774 100644 --- a/test/Steeltoe.Cli.Test/ShowTopicFeature.cs +++ b/test/Steeltoe.Cli.Test/HelpFeature.cs @@ -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[] { diff --git a/test/Steeltoe.Cli.Test/ProgramFeature.cs b/test/Steeltoe.Cli.Test/ProgramFeature.cs index 56b3c4f..e74c9b3 100644 --- a/test/Steeltoe.Cli.Test/ProgramFeature.cs +++ b/test/Steeltoe.Cli.Test/ProgramFeature.cs @@ -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.",