Project

General

Profile

« Previous | Next » 

Revision b2e88b7c

Added by Thomas McKay about 8 years ago

fixes #14162 - hide unsupported sub-commands and options

+ updated for ruby 2.0.0
+ updated README
+ fixed rubocop
+ updated tests
+ based on feedback switched to default being unsupported for new commands

View differences:

lib/hammer_cli_csv/csv.rb
module HammerCLICsv
class CsvCommand < HammerCLI::AbstractCommand
def help
self.class.help(invocation_path, CsvSortedBuilder.new)
end
class CsvSortedBuilder < SortedBuilder
def add_list(heading, items)
items.delete_if do |item|
if item.class == Clamp::Subcommand::Definition
!item.subcommand_class.supported?
else
false
end
end
super(heading, items)
end
end
end
HammerCLI::MainCommand.subcommand('csv',
_('import to, or export from a running foretello server'),
_('import to or export from a running foreman server'),
HammerCLICsv::CsvCommand)
end

Also available in: Unified diff