Class: Duty::CLI

Inherits:
Object
  • Object
show all
Defined in:
lib/duty/cli.rb

Defined Under Namespace

Classes: Input, Output, VerboseView, View

Constant Summary collapse

DUTY_CONFIG_FILENAME =
'.duty.yml'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ CLI



10
11
12
13
14
# File 'lib/duty/cli.rb', line 10

def initialize(args)
  @input = Input.new(args)
  @output = Output.new
  @registry = Duty::Registry.load(plugins)
end

Instance Attribute Details

#registryObject (readonly)

Returns the value of attribute registry.



8
9
10
# File 'lib/duty/cli.rb', line 8

def registry
  @registry
end

Instance Method Details

#execObject



16
17
18
19
20
# File 'lib/duty/cli.rb', line 16

def exec
  stdout usage if help?
  stdout completion if completion?
  run_task
end