Module: Thor::StartOverride::ClassMethods

Defined in:
lib/jets/thor/base.rb

Instance Method Summary collapse

Instance Method Details

#start(given_args = ARGV, config = {}) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/jets/thor/base.rb', line 13

def start(given_args = ARGV, config = {})
  # Trap ^C
  Signal.trap("INT") {
    puts "\nCtrl-C detected. Exiting..."
    sleep 0.1
    exit
  }

  # Namespace subcommands separate by colon instead of space
  if given_args && given_args[0]&.include?(":")
    commands = given_args.shift.split(":")
    given_args.unshift(commands)
    given_args.flatten!
  end

  super
end