Class: Git::Duet::Cli

Inherits:
Object
  • Object
show all
Defined in:
lib/git/duet/cli.rb

Class Method Summary collapse

Class Method Details

.run(prog, argv) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/git/duet/cli.rb', line 7

def run(prog, argv)
  case prog
  when /solo$/
    solo(parse_solo_options(argv.clone))
    return 0
  when /duet$/
    duet(parse_duet_options(argv.clone))
    return 0
  when /pre-commit$/
    pre_commit(parse_generic_options(argv.clone))
    return 0
  when /install-hook$/
    install_hook(parse_generic_options(argv.clone))
    return 0
  when /commit$/
    commit(parse_commit_options(argv.clone))
    return 0
  else
    raise ScriptError.new('How did you get here???')
  end
rescue Git::Duet::ScriptDieError => e
  return e.exit_code
end