Class: MiGA::Cli::Action::Generic

Inherits:
MiGA::Cli::Action show all
Defined in:
lib/miga/cli/action/generic.rb

Instance Attribute Summary

Attributes inherited from MiGA::Cli::Action

#cli

Instance Method Summary collapse

Methods inherited from MiGA::Cli::Action

#empty_action, #initialize, #launch, load

Constructor Details

This class inherits a constructor from MiGA::Cli::Action

Instance Method Details

#completeObject



38
39
# File 'lib/miga/cli/action/generic.rb', line 38

def complete
end

#nameObject



41
42
43
# File 'lib/miga/cli/action/generic.rb', line 41

def name
  '{action}'
end

#parse_cliObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/miga/cli/action/generic.rb', line 7

def parse_cli
  cli.opt_common = false
  cli.parse do |opt|
    descriptions = cli.class.TASK_DESC.keep_if { |k, v| k != :generic }
    opt.separator MiGA::MiGA.tabulate(
      [:action, :description], descriptions
    ).join("\n")
    opt.separator ''
    opt.separator 'generic options:'
    opt.on(
      '-h', '--help',
      'Display this screen'
    ) { puts opt; exit }
    opt.on(
      '-v', '--version',
      'Show MiGA version'
    ) { puts MiGA::MiGA.FULL_VERSION; exit }
    opt.on(
      '-V', '--long-version',
      'Show complete MiGA version'
    ) { |v| puts MiGA::MiGA.LONG_VERSION; exit }
    opt.on(
      '-C', '--citation',
      'How to cite MiGA'
    ) { |v| puts MiGA::MiGA.CITATION; exit }
  end
end

#performObject



35
36
# File 'lib/miga/cli/action/generic.rb', line 35

def perform
end