mirror of
https://github.com/inspec/inspec
synced 2025-02-17 06:28:40 +00:00
implement workaround for thor
This commit is contained in:
parent
b98c3e243e
commit
af04a0f5ba
3 changed files with 28 additions and 1 deletions
|
@ -9,7 +9,16 @@ module Compliance
|
||||||
class ComplianceCLI < Inspec::BaseCLI # rubocop:disable Metrics/ClassLength
|
class ComplianceCLI < Inspec::BaseCLI # rubocop:disable Metrics/ClassLength
|
||||||
namespace 'compliance'
|
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,
|
option :insecure, aliases: :k, type: :boolean,
|
||||||
desc: 'Explicitly allows InSpec to perform "insecure" SSL connections and transfers'
|
desc: 'Explicitly allows InSpec to perform "insecure" SSL connections and transfers'
|
||||||
option :user, type: :string, required: false,
|
option :user, type: :string, required: false,
|
||||||
|
|
|
@ -7,6 +7,15 @@ module Init
|
||||||
class CLI < Inspec::BaseCLI
|
class CLI < Inspec::BaseCLI
|
||||||
namespace 'init'
|
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
|
# read template directoy
|
||||||
template_dir = File.join(File.dirname(__FILE__), 'templates')
|
template_dir = File.join(File.dirname(__FILE__), 'templates')
|
||||||
Dir.glob(File.join(template_dir, '*')) do |template|
|
Dir.glob(File.join(template_dir, '*')) do |template|
|
||||||
|
|
|
@ -6,6 +6,15 @@ module Supermarket
|
||||||
class SupermarketCLI < Inspec::BaseCLI
|
class SupermarketCLI < Inspec::BaseCLI
|
||||||
namespace 'supermarket'
|
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'
|
desc 'profiles', 'list all available profiles in Chef Supermarket'
|
||||||
def profiles
|
def profiles
|
||||||
# display profiles in format user/profile
|
# display profiles in format user/profile
|
||||||
|
|
Loading…
Add table
Reference in a new issue