bin/trema in trema-0.5.1 vs bin/trema in trema-0.6.0

- old
+ new

@@ -6,12 +6,10 @@ require 'phut' require 'pio' require 'rake' require 'trema' -ENV['GLI_DEBUG'] = 'true' - # OpenFlow controller framework. module Trema # trema command. module App extend GLI::App @@ -35,10 +33,13 @@ c.switch :openflow13, default_value: false c.desc 'Overrides the default openflow channel port' c.flag [:p, :port] + c.desc 'Set logging level' + c.flag [:l, :logging_level], default_value: :info + c.desc 'Location to put pid files' c.flag [:P, :pid_dir], default_value: Trema::DEFAULT_PID_DIR c.desc 'Location to put log files' c.flag [:L, :log_dir], default_value: Trema::DEFAULT_LOG_DIR c.desc 'Location to put socket files' @@ -231,9 +232,23 @@ end end end default_command :help + + on_error do |e| + case e + when OptionParser::ParseError, + Trema::NoControllerDefined, + Trema::InvalidLoggingLevel, + Phut::OpenVswitch::AlreadyRunning, + GLI::UnknownCommandArgument + true + else + # show backtrace + fail e + end + end exit run(ARGV) end end