1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
//! # python-proto-importer
//!
//! A Rust-powered CLI that brings production-grade reliability to Python gRPC/Protobuf code generation.
//! Generate, validate, and maintain protobuf-based Python code with confidence.
//!
//! ## Core Features
//!
//! - **Automatic Import Rewriting**: Converts absolute imports to relative imports for better portability
//! - **Built-in Quality Assurance**: Validates generated code before it reaches your project
//! - **Comprehensive Verification**: Import testing and optional type checking with optimal settings
//! - **Production-Ready Workflow**: Single command for generation, postprocessing, and validation
//!
//! ## Quick Start
//!
//! ```toml
//! # pyproject.toml
//! [tool.python_proto_importer]
//! inputs = ["proto/**/*.proto"]
//! out = "generated"
//! ```
//!
//! Then run: `proto-importer build`
// Module declarations
pub
pub
pub
pub
// Re-export main CLI functions
use Result;
/// Main entry point for CLI usage.
///
/// This function initializes the CLI application and processes command-line arguments
/// using the standard argument parsing. It's the primary entry point when using
/// this library as a CLI tool.
///
/// # Returns
///
/// Returns `Ok(())` on successful execution, or an `anyhow::Error` if any step
/// in the process fails.
///
/// # Example
///
/// ```no_run
/// use python_proto_importer::run_cli;
///
/// fn main() -> anyhow::Result<()> {
/// run_cli()
/// }
/// ```
/// 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
///
/// ```no_run
/// use python_proto_importer::run_cli_with;
///
/// fn main() -> anyhow::Result<()> {
/// let args = vec!["proto-importer", "build", "--no-verify"];
/// run_cli_with(args)
/// }
/// ```