Class: Dribbled::CLI
Constant Summary collapse
- COMMANDS =
%w(show check snap)
- COMPONENTS =
%w(resources)
- DEFAULT_CONFIG_FILE =
File.join(ENV['HOME'],"/.senedsa/config")
Instance Method Summary collapse
-
#initialize(arguments) ⇒ CLI
constructor
A new instance of CLI.
- #run ⇒ Object
Constructor Details
#initialize(arguments) ⇒ CLI
Returns a new instance of CLI.
18 19 20 21 22 23 24 25 |
# File 'lib/dribbled/cli.rb', line 18 def initialize(arguments) @arguments = arguments @whoami = File.basename($PROGRAM_NAME).to_sym @global_options = { :debug => false, :drbdadm => 'drbdadm', :xmldump => nil, :procdrbd => '/proc/drbd', :hostname => nil } @action_options = { :monitor => :nagios, :mode => :active, :suffix => nil, :directory => '/tmp' } @action = nil end |
Instance Method Details
#run ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/dribbled/cli.rb', line 27 def run begin @log = Dribbled::Logger.instance.log @log.level = Log4r::INFO unless @global_options[:debug] @global_options[:log] = @log arguments_valid? process_arguments process_command rescue => e if @global_options[:debug] "#{e.}\n #{e.backtrace.join("\n ")}",3 else e.,3 end end end |