Class: Onering::CLI::Fact

Inherits:
Plugin
  • Object
show all
Defined in:
lib/onering/cli/fact.rb

Class Method Summary collapse

Methods inherited from Plugin

default_format, inherited, registered_plugins

Class Method Details

.configure(global = {}) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/onering/cli/fact.rb', line 4

def self.configure(global={})
  @opts = ::Trollop::options do
    banner <<-EOS
Return the value of an internal fact.

Usage:
    onering [global] fact [name]

EOS
  end
end

.run(args) ⇒ Object



16
17
18
19
# File 'lib/onering/cli/fact.rb', line 16

def self.run(args)
  args[0] = :hardwareid if args[0] and args[0] == 'id'
  return Onering::Util.fact(args[0])
end