Module: Docscribe::CLI

Defined in:
lib/docscribe/cli.rb,
lib/docscribe/cli/run.rb,
lib/docscribe/cli/init.rb,
lib/docscribe/cli/options.rb,
lib/docscribe/cli/generate.rb,
lib/docscribe/cli/config_builder.rb

Overview

CLI entry point and command dispatch.

Defined Under Namespace

Modules: ConfigBuilder, Generate, Init, Options, Run

Class Method Summary collapse

Class Method Details

.run(argv) ⇒ Integer

Main CLI entry point.

Dispatches:

  • ‘docscribe init …` to the config-template generator

  • ‘docscribe generate …` to the plugin skeleton generator

  • all other commands to the main option parser and runner

Parameters:

  • argv (Array<String>)

    raw command-line arguments

Returns:

  • (Integer)

    process exit code



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

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