use facet::Facet;
#[derive(Facet)]
pub struct Args {
#[facet(positional, default = "src".to_string())]
pub source: String,
#[facet(named, short = 'd', long, default)]
pub docs: Option<String>,
#[facet(named, short = 'm', long, default)]
pub migrate: bool,
#[facet(named, rename = "cut", short = 'c', long, default)]
pub strip_docs: bool,
#[facet(named, rename = "add", short = 'a', long, default)]
pub annotate: bool,
#[facet(named, short = 't', long, default)]
pub touch: bool,
#[facet(named, short = 'r', long, default)]
pub restore: bool,
#[facet(named, short = 'n', long, default)]
pub dry_run: bool,
#[facet(named, long, default)]
pub inline_paths: bool,
#[facet(named, short = 'v', long, default)]
pub verbose: bool,
#[facet(named, short = 'h', long, default)]
pub help: bool,
}
pub fn print_usage() {
println!("Usage: syncdoc [OPTIONS] <SOURCE>");
println!();
println!("Migrate Rust documentation to external markdown files.");
println!();
println!("Arguments:");
println!(" <SOURCE> Path to source directory to process (default: 'src')");
println!();
println!("Options:");
println!(
" -d, --docs <dir> Path to docs directory (default: 'docs' or from Cargo.toml if set)"
);
println!(" -m, --migrate Swap doc comments for #[omnidoc] (cut + add + touch)");
println!(" -c, --cut Cut out doc comments from source files");
println!(" -a, --add Rewrite code with #[omnidoc] attributes");
println!(" -t, --touch Touch empty markdown files for any that don't exist");
println!(" --inline-paths Use inline path= parameters instead of Cargo.toml");
println!(" -r, --restore Restore inline doc comments from markdown files");
println!(" -n, --dry-run Preview changes without writing files");
println!(" -v, --verbose Show verbose output");
println!(" -h, --help Show this help message");
println!();
println!("Examples:");
println!(" # 'Sync' the docs dir with the docstrings in src/");
println!(" syncdoc");
println!();
println!(" # Preview a full migration without running it");
println!(" syncdoc --migrate --dry-run (or `-m -n` for short)");
println!();
println!(" # Full migration: cut docs, add attributes, and touch missing files");
println!(" syncdoc --migrate (or `-m` for short, equal to `--cut --add --touch`)");
println!();
println!(" # Migrate with inline paths instead of Cargo.toml config");
println!(" syncdoc --migrate --inline-paths");
println!();
println!(" # Restore documentation from markdown back to source");
println!(" syncdoc --restore");
}