Class: CodeownersValidator::MainCli

Inherits:
Object
  • Object
show all
Defined in:
lib/codeowners_validator/cli/main_cli.rb

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ MainCli

Returns a new instance of MainCli.



7
8
9
# File 'lib/codeowners_validator/cli/main_cli.rb', line 7

def initialize(argv)
  @argv = argv.dup
end

Instance Method Details

#runObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/codeowners_validator/cli/main_cli.rb', line 11

def run
  subcommand = @argv.shift
  case subcommand
  when "duplicate" then run_subcommand(DuplicateCli)
  when "ghost" then run_subcommand(GhostCli)
  when "uncovered" then run_subcommand(UncoveredCli)
  when "-h", "--help"
    puts usage
    0
  else
    warn usage
    1
  end
end