Skip to main content

build_module_command

Function build_module_command 

Source
pub fn build_module_command(
    module_def: &ModuleDescriptor,
    executor: Arc<dyn ModuleExecutor>,
) -> Result<Command, CliError>
Expand description

Build a clap Command for a single module definition.

The resulting subcommand has:

  • its name set to module_def.name
  • its about derived from the module descriptor (empty if unavailable)
  • the 5 built-in flags: --input, --yes/-y, --large-input, --format, --sandbox
  • schema-derived flags from schema_to_clap_args (stub: empty vec)

executor is accepted for API symmetry with the Python counterpart but is not embedded in the clap::Command (clap has no user-data attachment). The executor is passed separately to the dispatch callback.

ยงErrors

Returns CliError::ReservedModuleId when module_def.name is one of the reserved built-in command names.