Skip to content

Commit

Permalink
experimental: Add build-chunked-oci
Browse files Browse the repository at this point in the history
Closes: coreos#5221

Signed-off-by: Colin Walters <[email protected]>
  • Loading branch information
cgwalters committed Jan 15, 2025
1 parent acc37dc commit 6d58780
Show file tree
Hide file tree
Showing 2 changed files with 349 additions and 4 deletions.
31 changes: 29 additions & 2 deletions rust/src/cli_experimental.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,38 @@ enum Cmd {
/// This command does nothing, it's a placeholder for future expansion.
#[clap(hide = true)]
Stub,
/// Options for building.
Compose {
#[clap(subcommand)]
cmd: ComposeCmd,
},
}

#[derive(Debug, clap::Subcommand)]
enum ComposeCmd {
BuildChunkedOCI {
#[clap(flatten)]
opts: crate::compose::BuildChunkedOCI,
},
}

impl ComposeCmd {
fn run(self) -> Result<()> {
match self {
ComposeCmd::BuildChunkedOCI { opts } => opts.run(),
}
}
}

impl Cmd {
fn run(self) -> Result<()> {
match self {
Cmd::Stub => println!("Did nothing successfully."),
Cmd::Stub => {
println!("Did nothing successfully.");
Ok(())
}
Cmd::Compose { cmd } => cmd.run(),
}
Ok(())
}
}

Expand All @@ -45,6 +69,9 @@ mod tests {
let opt = Experimental::try_parse_from(["experimental", "stub"]).unwrap();
match opt.cmd {
Cmd::Stub => {}
o => {
panic!("Unexpected {o:?}")
}
}
Ok(())
}
Expand Down
Loading

0 comments on commit 6d58780

Please sign in to comment.