Class: Guignol::Shell

Inherits:
Thor
  • Object
show all
Defined in:
lib/guignol/shell.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.add_force_optionObject



29
30
31
32
33
# File 'lib/guignol/shell.rb', line 29

def self.add_force_option
  method_option :force,
    :aliases => %w(-f), :type => :boolean, :default => false,
    :desc => 'Do not ask for confirmation'
end

.exit_on_failure?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/guignol/shell.rb', line 24

def self.exit_on_failure?
  true
end

.shared_shellObject



16
17
18
19
20
21
22
# File 'lib/guignol/shell.rb', line 16

def self.shared_shell
  @shared_shell ||= if $stdout.tty?
    Thor::Shell::Color.new
  else
    Thor::Shell::Basic.new
  end
end

.startObject



12
13
14
# File 'lib/guignol/shell.rb', line 12

def self.start
  super(ARGV, :shell => shared_shell)
end

Instance Method Details

#help(*args) ⇒ Object



5
6
7
8
9
10
# File 'lib/guignol/shell.rb', line 5

def help(*args)
  shell.say
  shell.say "Guignol -- manipulate EC2 instances from your command line.", :cyan
  shell.say
  super
end