Class: Rascal::CLI::Main

Inherits:
Thor
  • Object
show all
Defined in:
lib/rascal/cli/main.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.exit_on_failure?Boolean

Returns:

  • (Boolean)


20
21
22
23
# File 'lib/rascal/cli/main.rb', line 20

def self.exit_on_failure?
  # return non-zero exit code for failures
  true
end

.startObject



25
26
27
28
# File 'lib/rascal/cli/main.rb', line 25

def self.start(*)
  IOHelper.setup
  super
end

Instance Method Details

#_shell(environment_name = nil) ⇒ Object



33
34
35
36
37
# File 'lib/rascal/cli/main.rb', line 33

def _shell(environment_name = nil)
  handle_error do
    Shell.new(self, options, environment_name).run
  end
end

#clean(environment_name = nil) ⇒ Object



42
43
44
45
46
# File 'lib/rascal/cli/main.rb', line 42

def clean(environment_name = nil)
  handle_error do
    Clean.new(self, options, environment_name).run
  end
end

#help(subcommand = false) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/rascal/cli/main.rb', line 4

def help(subcommand = false)
  if subcommand
    super
  else
    say
    say 'Usage:'
    say '  rascal <command> <args>'
    say 'For example:'
    say '  rascal shell 2.6'
    say
    super
    say 'For Further information about the commands, you can use "rascal help <command>".'
    say
  end
end

#update(environment_name = nil) ⇒ Object



50
51
52
53
54
# File 'lib/rascal/cli/main.rb', line 50

def update(environment_name = nil)
  handle_error do
    Update.new(self, options, environment_name).run
  end
end