lib/milc/base.rb in milc-0.1.1 vs lib/milc/base.rb in milc-0.1.2

- old
+ new

@@ -67,10 +67,15 @@ def command_options "nVc:" # n と V と c: は必須 end def load_options(options) + if options["c"] + load_from_yaml(options["c"]) + else + show_help_and_exit1 + end end def setup(args) # ARGV.getopts については以下を参照 # http://d.hatena.ne.jp/zariganitosh/20140819/ruby_optparser_true_power @@ -80,15 +85,10 @@ show_help_and_exit1 unless args.empty? Milc.dry_run = !!options["n"] Milc.verbose = !!options["V"] - if options["c"] - load_from_yaml(options["c"]) - load_options(options) - else - show_help_and_exit1 - end + load_options(options) end def run(args) setup(args) process