1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//! Crate that combines several development utilities.
//!
//! To get an overview over all tools run `pixi run dev-tools --help`.
use argh::FromArgs;

mod build_examples;
mod build_search_index;
mod build_web_viewer;

#[derive(FromArgs)]
#[argh(subcommand)]
enum Commands {
    BuildExamples(build_examples::Args),
    BuildWebViewer(build_web_viewer::Args),
    SearchIndex(build_search_index::Args),
}

/// Various development tools for Rerun.
#[derive(FromArgs)]
struct TopLevel {
    #[argh(subcommand)]
    cmd: Commands,
}

fn main() -> anyhow::Result<()> {
    let args: TopLevel = argh::from_env();

    match args.cmd {
        Commands::BuildExamples(args) => build_examples::main(args),
        Commands::SearchIndex(args) => build_search_index::main(args),
        Commands::BuildWebViewer(args) => build_web_viewer::main(args),
    }
}