webgraph_cli/build/
mod.rs1use anyhow::Result;
9use clap::{Command, Parser, Subcommand};
10use clap_complete::shells::Shell;
11
12pub mod dcf;
13pub mod ef;
14pub mod offsets;
15
16#[derive(Subcommand, Debug)]
18#[command(name = "build")]
19pub enum SubCommands {
20 Ef(ef::CliArgs),
21 Dcf(dcf::CliArgs),
22 Offsets(offsets::CliArgs),
23 Complete(CompleteArgs),
24}
25
26#[derive(Parser, Debug)]
30#[command(next_line_help = true)]
31pub struct CompleteArgs {
32 shell: Shell,
33}
34
35pub fn main(subcommand: SubCommands, mut top_command: Command) -> Result<()> {
36 match subcommand {
37 SubCommands::Ef(args) => ef::main(args),
38 SubCommands::Dcf(args) => dcf::main(args),
39 SubCommands::Offsets(args) => offsets::main(args),
40 SubCommands::Complete(args) => {
41 clap_complete::generate(
42 args.shell,
43 &mut top_command,
44 "webgraph",
45 &mut std::io::stdout(),
46 );
47 Ok(())
48 }
49 }
50}