implement workaround for thor

This commit is contained in:
Christoph Hartmann 2016-08-18 20:10:09 +02:00
parent b98c3e243e
commit af04a0f5ba
3 changed files with 28 additions and 1 deletions

View file

@ -9,7 +9,16 @@ module Compliance
class ComplianceCLI < Inspec::BaseCLI # rubocop:disable Metrics/ClassLength
namespace 'compliance'
desc "compliance login SERVER --insecure --user='USER' --token='TOKEN'", 'Log in to a Chef Compliance SERVER'
# TODO: find another solution, once https://github.com/erikhuda/thor/issues/261 is fixed
def self.banner(command, _namespace = nil, _subcommand = false)
"#{basename} #{subcommand_prefix} #{command.usage}"
end
def self.subcommand_prefix
namespace
end
desc "login SERVER --insecure --user='USER' --token='TOKEN'", 'Log in to a Chef Compliance SERVER'
option :insecure, aliases: :k, type: :boolean,
desc: 'Explicitly allows InSpec to perform "insecure" SSL connections and transfers'
option :user, type: :string, required: false,

View file

@ -7,6 +7,15 @@ module Init
class CLI < Inspec::BaseCLI
namespace 'init'
# TODO: find another solution, once https://github.com/erikhuda/thor/issues/261 is fixed
def self.banner(command, _namespace = nil, _subcommand = false)
"#{basename} #{subcommand_prefix} #{command.usage}"
end
def self.subcommand_prefix
namespace
end
# read template directoy
template_dir = File.join(File.dirname(__FILE__), 'templates')
Dir.glob(File.join(template_dir, '*')) do |template|

View file

@ -6,6 +6,15 @@ module Supermarket
class SupermarketCLI < Inspec::BaseCLI
namespace 'supermarket'
# TODO: find another solution, once https://github.com/erikhuda/thor/issues/261 is fixed
def self.banner(command, _namespace = nil, _subcommand = false)
"#{basename} #{subcommand_prefix} #{command.usage}"
end
def self.subcommand_prefix
namespace
end
desc 'profiles', 'list all available profiles in Chef Supermarket'
def profiles
# display profiles in format user/profile