Project

General

Profile

Revision 0bd50d7a

Added by Andrew Kofink about 5 years ago

Fixes #17223 - use HammerCLI's new help model (#135)

HammerCLICsv is broken due to
https://github.com/theforeman/hammer-cli/pull/222

View differences:

lib/hammer_cli_csv/csv.rb
4 4
module HammerCLICsv
5 5
  class CsvCommand < HammerCLI::AbstractCommand
6 6
    def help
7
      self.class.help(invocation_path, CsvSortedBuilder.new)
7
      self.class.help(invocation_path, HammerCLICsv::Help::Builder.new)
8 8
    end
9 9

  
10
    class CsvSortedBuilder < SortedBuilder
11
      def add_list(heading, items)
12
        items.delete_if do |item|
13
          if item.class == Clamp::Subcommand::Definition
14
            !item.subcommand_class.supported?
15
          else
16
            false
10
    module Help
11
      class Builder < HammerCLI::Help::Builder
12
        def add_list(heading, items)
13
          items.delete_if do |item|
14
            if item.class == Clamp::Subcommand::Definition
15
              !item.subcommand_class.supported?
16
            else
17
              false
18
            end
17 19
          end
20
          super(heading, items)
18 21
        end
19
        super(heading, items)
20 22
      end
21 23
    end
22 24
  end

Also available in: Unified diff