Class: RBS::Trace::CLI

Inherits:
Object
  • Object
show all
Defined in:
lib/rbs/trace/cli.rb,
lib/rbs/trace/cli/merge.rb,
lib/rbs/trace/cli/inline.rb

Defined Under Namespace

Classes: Inline, Merge

Constant Summary collapse

<<~USAGE
  Usage: rbs-trace <command> [<args>]

  Available commands: inline, merge
USAGE

Instance Method Summary collapse

Instance Method Details

#run(args = ARGV) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/rbs/trace/cli.rb', line 13

def run(args = ARGV)
  opts = OptionParser.new(BANNER)
  opts.version = RBS::Trace::VERSION
  opts.order!(args)
  command = args.shift&.to_sym

  klass = command_class(command)
  if klass
    klass.new.run(args)
  else
    puts opts.help
  end
end