diff --git a/lib/bolt/application.rb b/lib/bolt/application.rb index 2021a3cf2..672389249 100644 --- a/lib/bolt/application.rb +++ b/lib/bolt/application.rb @@ -148,10 +148,8 @@ def list_groups # Show available guides. # - # @param guides [Hash] A map of topics to paths to guides. - # @param outputter [Bolt::Outputter] An outputter instance. - # @return [Boolean] - # + # @return [Hash] A map of topics of guides + # Currently, the map is structured as `:topics => [Array] of guide names` def list_guides { topics: load_guides.keys } end diff --git a/lib/bolt/outputter/human.rb b/lib/bolt/outputter/human.rb index 54a6b1419..5df91fa4c 100644 --- a/lib/bolt/outputter/human.rb +++ b/lib/bolt/outputter/human.rb @@ -486,7 +486,7 @@ def print_plans(plans:, modulepath:) # # @param topics [Array] The available topics. # - def print_topics(topics:, **_kwargs) + def print_topics(topics:) info = +"#{colorize(:cyan, 'Topics')}\n" info << indent(2, topics.join("\n")) info << "\n\n#{colorize(:cyan, 'Additional information')}\n" diff --git a/lib/bolt/outputter/json.rb b/lib/bolt/outputter/json.rb index ba7a4c610..de5b06e49 100644 --- a/lib/bolt/outputter/json.rb +++ b/lib/bolt/outputter/json.rb @@ -122,8 +122,8 @@ def print_result_set(result_set) # # @param topics [Array] The available topics. # - def print_topics(**kwargs) - print_table(kwargs) + def print_topics(topics:) + print_table({ topics: topics }) end # Print the guide for the specified topic. diff --git a/lib/bolt/outputter/rainbow.rb b/lib/bolt/outputter/rainbow.rb index f1d4915e8..9a0cbf091 100644 --- a/lib/bolt/outputter/rainbow.rb +++ b/lib/bolt/outputter/rainbow.rb @@ -104,7 +104,11 @@ def print_guide(guide, _topic) @stream.puts colorize(:rainbow, guide) end - def print_topics(topics) + # Print available guide topics. + # + # @param topics [Array] The available topics. + # + def print_topics(topics:) content = String.new("Available topics are:\n") content += topics.join("\n") content += "\n\nUse `bolt guide ` to view a specific guide." diff --git a/spec/unit/outputter/rainbow_spec.rb b/spec/unit/outputter/rainbow_spec.rb index e43539587..f8e6c6947 100644 --- a/spec/unit/outputter/rainbow_spec.rb +++ b/spec/unit/outputter/rainbow_spec.rb @@ -65,7 +65,7 @@ CONTENT expect(outputter).to receive(:colorize).with(:rainbow, content) - outputter.print_topics(%w[foo bar]) + outputter.print_topics(topics: %w[foo bar]) end it "colorizes a message" do