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