Cheer.Router (Cheer v0.1.5)

Copy Markdown View Source

Routes argv through the command tree and dispatches to the matched command.

Handles the full dispatch pipeline: subcommand matching, option parsing (via OptionParser), default/env-var application, validation (required fields, choices, custom validators, cross-param validators, groups), and lifecycle hook execution.

This module is called internally by Cheer.run/3 and is not typically invoked directly.

Summary

Functions

Dispatch argv through the command tree rooted at command.

Functions

dispatch(command, argv, opts \\ [])

@spec dispatch(module(), [String.t()], keyword()) :: term()

Dispatch argv through the command tree rooted at command.

Options:

  • :prog - program name for help/usage output
  • :parent_hooks - (internal) accumulated persistent hooks from parent commands