module TeslaCam::CLI

Command-line interface.

Constants

LIB_DIR

Public Class Methods

run(app, args) click to toggle source

Run from command-line.

# File lib/teslacam/cli.rb, line 15
def self.run(app, args)
  # get config from command-line, build model
  config = ::TeslaCam::CLI::Config.new(app, args)

  # create logger from config
  log = ::Logger.new(config.quiet ? nil : STDERR)

  # create model from config and log
  model = ::TeslaCam::Model.new(config, log)

  # exec command
  log.debug { 'exec: %p' % [model.command] }
  ::Kernel.exec(*model.command)
end