Class: CallMap::CLI

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

Overview

Command-line entry point: parses the target and options, builds the index, and prints the call tree.

call_map OrdersController#destroy --depth=3 --include-comments

Constant Summary collapse

DEFAULT_DEPTH =
3

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.start(argv) ⇒ Object



16
17
18
# File 'lib/call_map/cli.rb', line 16

def self.start(argv)
  new.start(argv)
end

Instance Method Details

#start(argv) ⇒ Object



20
21
22
23
24
25
26
27
# File 'lib/call_map/cli.rb', line 20

def start(argv)
  options = parse_options!(argv)
  target = argv.first
  validate_target!(target)

  tree = build_tree(target, options)
  puts Formatters::TextTree.format(tree, include_comments: options.fetch(:include_comments, false))
end