added graph and todo commands, and reorganized project structure

This commit is contained in:
2026-02-21 14:34:05 +01:00
parent 0ca4161e03
commit d1040954cb
5 changed files with 388 additions and 233 deletions

44
src/cli.rs Normal file
View File

@@ -0,0 +1,44 @@
use std::path::PathBuf;
use clap::{Parser, Subcommand};
#[derive(Parser)]
#[command(author, version, about = "A simple wiki server/builder")]
pub struct Cli {
#[command(subcommand)]
pub command: Commands,
}
#[derive(Subcommand)]
pub enum Commands {
/// Serve the wiki locally
Serve {
#[arg(short, long)]
path: PathBuf,
#[arg(short, long)]
no_navigation: bool,
#[arg(short = 'P', long, default_value = "8090")]
port: u16,
#[arg(short = 'H', long)]
host: bool,
},
/// Build the static site
Build {
#[arg(short, long)]
path: PathBuf,
#[arg(short, long)]
no_navigation: bool,
#[arg(short, long)]
out_dir: Option<PathBuf>,
},
/// Output a DOT graph of the wiki connections
Graph {
#[arg(short, long)]
path: PathBuf,
},
/// List broken links
Todo {
#[arg(short, long)]
path: PathBuf,
},
}