Add print-tree command.
This commit is contained in:
10
src/main.rs
10
src/main.rs
@@ -173,6 +173,10 @@ struct Args {
|
||||
/// Path to wiki repository
|
||||
wiki_path: Option<String>,
|
||||
|
||||
/// Print a tree of the wiki contents.
|
||||
#[arg(long)]
|
||||
print_tree: bool,
|
||||
|
||||
/// Render the wiki to a static website
|
||||
#[arg(long)]
|
||||
render_to: Option<String>,
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user