Module: Docscribe::CLI

Defined in:
lib/docscribe/cli.rb,
lib/docscribe/cli/run.rb,
lib/docscribe/cli/init.rb,
lib/docscribe/cli/sigs.rb,
lib/docscribe/cli/server.rb,
lib/docscribe/cli/options.rb,
lib/docscribe/cli/rbs_gen.rb,
lib/docscribe/cli/generate.rb,
lib/docscribe/cli/formatters.rb,
lib/docscribe/cli/update_types.rb,
lib/docscribe/cli/config_builder.rb,
lib/docscribe/cli/formatters/json.rb,
lib/docscribe/cli/formatters/text.rb,
lib/docscribe/cli/formatters/sarif.rb,
lib/docscribe/cli/check_for_comments.rb

Overview

CLI entry point and command dispatch.

Defined Under Namespace

Modules: CheckForComments, ConfigBuilder, Formatters, Generate, Init, Options, RbsGen, Run, ServerCmd, Sigs, UpdateTypes

Constant Summary collapse

COMMANDS =
{
  'init' => :Init,
  'generate' => :Generate,
  'sigs' => :Sigs,
  'rbs' => :RbsGen,
  'update_types' => :UpdateTypes,
  'check_for_comments' => :CheckForComments,
  'server' => :ServerCmd
}.freeze

Class Method Summary collapse

Class Method Details

.run(argv) ⇒ Integer

Parameters:

  • argv (Array<String>)

Returns:

  • (Integer)


12
13
14
15
16
17
18
# File 'lib/docscribe/cli.rb', line 12

def run(argv)
  argv = argv.dup
  return dispatch_subcommand(argv) if subcommand?(argv.first)

  options = Docscribe::CLI::Options.parse!(argv)
  Docscribe::CLI::Run.run(options: options, argv: argv)
end