Class: OsVm::Cli::Command

Inherits:
OsCtl::Lib::Cli::Command
  • Object
show all
Defined in:
lib/osvm/cli/command.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.run(method) ⇒ Object



5
6
7
8
9
10
# File 'lib/osvm/cli/command.rb', line 5

def self.run(method)
  proc do |global_opts, opts, args|
    cmd = new(global_opts, opts, args)
    cmd.method(method).call
  end
end

Instance Method Details

#scriptObject



12
13
14
15
16
17
18
19
20
21
# File 'lib/osvm/cli/command.rb', line 12

def script
  require_args!('file', strict: false)

  # Remove osvm command-line arguments, so that ARGV contains only arguments
  # for the script.
  ARGV.shift # script
  ARGV.shift # <name>

  load(args[0])
end