diff --git a/src/main.rs b/src/main.rs index 8fc9a36..8c1c390 100644 --- a/src/main.rs +++ b/src/main.rs @@ -173,6 +173,10 @@ struct Args { /// Path to wiki repository wiki_path: Option, + /// Print a tree of the wiki contents. + #[arg(long)] + print_tree: bool, + /// Render the wiki to a static website #[arg(long)] render_to: Option, @@ -205,7 +209,11 @@ async fn main() { if let Some(wiki_path) = args.wiki_path { let historian = Historian::new(wiki_path); - print_tree(&historian, &historian.resolve_to_page("").unwrap(), "*"); + + if args.print_tree { + print_tree(&historian, &historian.resolve_to_page("").unwrap(), "*"); + return; + } let renderer = if let Some(template_path) = args.template_path { PageRenderer::with_template_path(&template_path)