cut/
main.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Copyright (c) Mysten Labs, Inc.
// SPDX-License-Identifier: Apache-2.0

use args::Args;
use clap::Parser;
use plan::CutPlan;

mod args;
mod path;
mod plan;

fn main() -> anyhow::Result<()> {
    let args = Args::parse();
    let dry_run = args.dry_run;
    let plan = CutPlan::discover(args)?;

    if dry_run {
        println!("{plan}");
    } else {
        plan.execute()?;
    }

    Ok(())
}