Class: Spanx::CLI

Inherits:
Object
  • Object
show all
Includes:
Mixlib::CLI, Helper::Exit, Helper::Subclassing
Defined in:
lib/spanx/cli.rb

Direct Known Subclasses

Analyze, Api, Disable, Enable, Flush, Report, Watch

Defined Under Namespace

Classes: Analyze, Api, Disable, Enable, Flush, Report, Watch

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helper::Subclassing

included

Methods included from Helper::Exit

#error_exit_with_msg, #help_exit

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



10
11
12
# File 'lib/spanx/cli.rb', line 10

def args
  @args
end

Instance Method Details

#run(args = ARGV) ⇒ Object

the first element of ARGV should be a subcommand, which maps to a class in spanx/cli/



14
15
16
17
18
# File 'lib/spanx/cli.rb', line 14

def run(args = ARGV)
  @args = args
  validate!
  Spanx::CLI.subclass_class(args.shift).new.run(args)
end