imsg 0.4.0

Read and send iMessages from the command line over Bluetooth MAP/PBAP — no Apple hardware required
Documentation
//! Regenerates `docs/cli.md` from the `imsg` CLI's clap definition.
//!
//! Run via `just docs`. Keeps the CLI reference in sync with `cli.rs` without hand-maintaining
//! a duplicate table.

use std::path::Path;

use imsg::cli::Cli;

const HEADER: &str = "<!-- Generated by `just docs` — do not edit by hand. -->\n\n";

fn main() -> anyhow::Result<()> {
    let opts = clap_markdown::MarkdownOptions::new().show_footer(false);
    let generated = clap_markdown::help_markdown_custom::<Cli>(&opts);

    let workspace_root = Path::new(env!("CARGO_MANIFEST_DIR")).join("../..");
    let docs_dir = workspace_root.join("docs");
    std::fs::create_dir_all(&docs_dir)?;
    std::fs::write(docs_dir.join("cli.md"), format!("{HEADER}{generated}"))?;
    Ok(())
}