run_cli_with

Function run_cli_with 

Source
pub fn run_cli_with<I, S>(args: I) -> Result<()>
where I: IntoIterator<Item = S>, S: Into<String>,
Expand description

Entry point for CLI usage with custom arguments.

This function allows programmatic invocation of the CLI with custom arguments, useful for testing or when integrating the tool into other applications.

§Arguments

  • args - An iterator of arguments where each item can be converted to String. The first argument should typically be the program name.

§Returns

Returns Ok(()) on successful execution, or an anyhow::Error if any step in the process fails.

§Example

use python_proto_importer::run_cli_with;

fn main() -> anyhow::Result<()> {
    let args = vec!["proto-importer", "build", "--no-verify"];
    run_cli_with(args)
}