rename on_options -> extra_options
This commit is contained in:
parent
1f809c68c8
commit
108e732274
3 changed files with 5 additions and 5 deletions
|
@ -35,7 +35,7 @@ describe "Config" do
|
||||||
ARGV.push("FOOBAR")
|
ARGV.push("FOOBAR")
|
||||||
$test_option = nil
|
$test_option = nil
|
||||||
|
|
||||||
config.on_options = ->(parser : OptionParser) {
|
config.extra_options = ->(parser : OptionParser) {
|
||||||
parser.on("--test TEST_OPTION", "Test an option") do |opt|
|
parser.on("--test TEST_OPTION", "Test an option") do |opt|
|
||||||
$test_option = opt
|
$test_option = opt
|
||||||
end
|
end
|
||||||
|
|
|
@ -35,8 +35,8 @@ module Kemal
|
||||||
puts opts
|
puts opts
|
||||||
exit 0
|
exit 0
|
||||||
end
|
end
|
||||||
unless @config.on_options.nil?
|
unless @config.extra_options.nil?
|
||||||
c = @config.on_options.not_nil!
|
c = @config.extra_options.not_nil!
|
||||||
c.call opts
|
c.call opts
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,7 +3,7 @@ module Kemal
|
||||||
INSTANCE = Config.new
|
INSTANCE = Config.new
|
||||||
HANDLERS = [] of HTTP::Handler
|
HANDLERS = [] of HTTP::Handler
|
||||||
property host_binding, ssl, port, env, public_folder, logging,
|
property host_binding, ssl, port, env, public_folder, logging,
|
||||||
always_rescue, error_handler, serve_static, run, on_options
|
always_rescue, error_handler, serve_static, run, extra_options
|
||||||
|
|
||||||
def initialize
|
def initialize
|
||||||
@host_binding = "0.0.0.0"
|
@host_binding = "0.0.0.0"
|
||||||
|
@ -16,7 +16,7 @@ module Kemal
|
||||||
@always_rescue = true
|
@always_rescue = true
|
||||||
@error_handler = nil
|
@error_handler = nil
|
||||||
@run = false
|
@run = false
|
||||||
@on_options = nil
|
@extra_options = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
def logger
|
def logger
|
||||||
|
|
Loading…
Reference in a new issue