webgraph_cli/perm/
mod.rs

1/*
2 * SPDX-FileCopyrightText: 2024 Tommaso Fontana
3 *
4 * SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
5 */
6
7use anyhow::Result;
8use clap::Subcommand;
9
10use super::GlobalArgs;
11
12pub mod bfs;
13pub mod comp;
14pub mod rand;
15
16#[derive(Subcommand, Debug)]
17#[command(name = "perm")]
18/// Permutations related things.
19pub enum SubCommands {
20    Bfs(bfs::CliArgs),
21    Comp(comp::CliArgs),
22    Rand(rand::CliArgs),
23}
24
25pub fn main(global_args: GlobalArgs, subcommand: SubCommands) -> Result<()> {
26    match subcommand {
27        SubCommands::Bfs(args) => bfs::main(global_args, args),
28        SubCommands::Comp(args) => comp::main(global_args, args),
29        SubCommands::Rand(args) => rand::main(global_args, args),
30    }
31}