webgraph_cli/run/
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 llp;
13pub mod llp_combine;
14pub mod pad;
15
16#[derive(Subcommand, Debug)]
17#[command(name = "transform")]
18/// Apply a transformation to a graph.
19pub enum SubCommands {
20    Llp(llp::CliArgs),
21    LlpCombine(llp_combine::CliArgs),
22    Pad(pad::CliArgs),
23}
24
25pub fn main(global_args: GlobalArgs, subcommand: SubCommands) -> Result<()> {
26    match subcommand {
27        SubCommands::Llp(args) => llp::main(global_args, args),
28        SubCommands::LlpCombine(args) => llp_combine::main(global_args, args),
29        SubCommands::Pad(args) => pad::main(global_args, args),
30    }
31}