Add --bootstrap-current and --debug-bootstrap options
This commit is contained in:
Родитель
68b49772ca
Коммит
978cabaa23
|
@ -0,0 +1,13 @@
|
|||
# Option to bootstrap the current directory (by default, the bootstrap script is NOT
|
||||
# run when the catalog builds in the current directory).
|
||||
# @param parser [OptionParser object] The OptionParser argument
|
||||
# @param options [Hash] Options hash being constructed; this is modified in this method.
|
||||
OctocatalogDiff::CatalogDiff::Cli::Options::Option.newoption(:bootstrap_current) do
|
||||
has_weight 48
|
||||
|
||||
def parse(parser, options)
|
||||
parser.on('--bootstrap-current', 'Run bootstrap script for the current directory too') do
|
||||
options[:bootstrap_current] = true
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,14 @@
|
|||
# Option to print debugging output for the bootstrap script in addition to the normal
|
||||
# debugging output. Note that `--debug` must also be enabled for this option to have
|
||||
# any effect.
|
||||
# @param parser [OptionParser object] The OptionParser argument
|
||||
# @param options [Hash] Options hash being constructed; this is modified in this method.
|
||||
OctocatalogDiff::CatalogDiff::Cli::Options::Option.newoption(:debug_bootstrap) do
|
||||
has_weight 49
|
||||
|
||||
def parse(parser, options)
|
||||
parser.on('--debug-bootstrap', 'Print debugging output for bootstrap script') do
|
||||
options[:debug_bootstrap] = true
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,10 @@
|
|||
require_relative '../options_helper'
|
||||
|
||||
describe OctocatalogDiff::CatalogDiff::Cli::Options do
|
||||
describe '#opt_bootstrap_current' do
|
||||
it 'should handle --bootstrap-current' do
|
||||
result = run_optparse(['--bootstrap-current'])
|
||||
expect(result[:bootstrap_current]).to eq(true)
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,10 @@
|
|||
require_relative '../options_helper'
|
||||
|
||||
describe OctocatalogDiff::CatalogDiff::Cli::Options do
|
||||
describe '#opt_debug_bootstrap' do
|
||||
it 'should handle --debug-bootstrap' do
|
||||
result = run_optparse(['--debug-bootstrap'])
|
||||
expect(result[:debug_bootstrap]).to eq(true)
|
||||
end
|
||||
end
|
||||
end
|
Загрузка…
Ссылка в новой задаче