workspacer_cli/
bump.rs

1// ---------------- [ File: workspacer-cli/src/bump.rs ]
2crate::ix!();
3
4/// Our top-level subcommand for `ws bump`.
5/// We have three variants:
6///
7/// - **`Workspace`** => bump all crates in the workspace
8/// - **`SingleCrate`** => only that one crate
9/// - **`CrateAndDownstreams`** => that crate plus anything that depends on it
10#[derive(Debug, StructOpt)]
11pub enum BumpSubcommand {
12    /// Bump the entire workspace
13    #[structopt(name = "workspace")]
14    Workspace(BumpWorkspaceCommand),
15
16    /// Bump a single crate only (no downstream changes)
17    #[structopt(name = "crate")]
18    SingleCrate(BumpSingleCrateCommand),
19
20    /// Bump a single crate and all crates that depend on it (recursively)
21    #[structopt(name = "crate-downstreams")]
22    CrateDownstreams(BumpCrateDownstreamsCommand),
23}
24
25impl BumpSubcommand {
26    pub async fn run(&self) -> Result<(), WorkspaceError> {
27        match self {
28            BumpSubcommand::Workspace(cmd)        => cmd.run().await,
29            BumpSubcommand::SingleCrate(cmd)      => cmd.run().await,
30            BumpSubcommand::CrateDownstreams(cmd) => cmd.run().await,
31        }
32    }
33}