Method: MiddlemanEmberScaffold::Cli::Base.start

Defined in:
lib/middleman_ember_scaffold/cli.rb

.start(*args) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/middleman_ember_scaffold/cli.rb', line 13

def start(*args)
  # Change flag to a module
  ARGV.unshift("help") if ARGV.delete("--help")

  unless ARGV[1].nil? || ARGV[1].start_with?("-")
  	ARGV.push ARGV[1]
  	ARGV[1] = '-p'
  end

  unless ARGV[3].nil? || ARGV[3].start_with?("-")
    ARGV.push ARGV[3]
    ARGV[3] = '-f'
  end

  # Default command is server
  if ARGV[0] != "help" && (ARGV.length < 1 || ARGV.first.include?("-"))
    ARGV.unshift("help")
  end
  super
end