exec_dispatch

Function exec_dispatch 

Source
pub(crate) fn exec_dispatch(cli: Cli) -> Result<(), AppError>
Expand description

Dispatches the parsed command to the appropriate handler.

§Arguments

  • cli - The parsed command-line options.

§Returns

  • Ok(()) on success.
  • Err(AppError) if the chosen sub-command handler fails.

The function matches on the TopLevelCmd variant and calls the corresponding handler in the commands module. Any error is propagated to the caller, which in main will be shown to stdout and returned as a miette::Result<()>.