feat: use actual project data, real usage examples, dry-run/verbose flags, skip-unchanged optimization
- renderer: render_architecture_md accepts Config, uses project name and current date - renderer: generate real Python usage examples from analyzed symbols - writer: skip writing files when content unchanged (optimization) - cli: add --dry-run flag to generate command (lists files without writing) - cli: add verbose logging for file/module/symbol generation progress
This commit is contained in:
@@ -34,6 +34,9 @@ enum Commands {
|
||||
out: String,
|
||||
#[arg(short, long, default_value = "archdoc.toml")]
|
||||
config: String,
|
||||
/// Show what would be generated without writing files
|
||||
#[arg(long)]
|
||||
dry_run: bool,
|
||||
},
|
||||
/// Check if documentation is up to date
|
||||
Check {
|
||||
@@ -58,10 +61,14 @@ fn main() -> Result<()> {
|
||||
Commands::Init { root, out } => {
|
||||
commands::init::init_project(root, out)?;
|
||||
}
|
||||
Commands::Generate { root, out, config } => {
|
||||
Commands::Generate { root, out, config, dry_run } => {
|
||||
let config = commands::generate::load_config(config)?;
|
||||
let model = commands::generate::analyze_project(root, &config)?;
|
||||
commands::generate::generate_docs(&model, out, cli.verbose)?;
|
||||
if *dry_run {
|
||||
commands::generate::dry_run_docs(&model, out, &config)?;
|
||||
} else {
|
||||
commands::generate::generate_docs(&model, out, cli.verbose, &config)?;
|
||||
}
|
||||
output::print_generate_summary(&model);
|
||||
}
|
||||
Commands::Check { root, config } => {
|
||||
|
||||
Reference in New Issue
Block a user