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