Skip to content

Commit

Permalink
cli: Add an alias update for upgrade
Browse files Browse the repository at this point in the history
yum/dnf does this, I think it's a friendly thing to do.  I actually
typed `bootc update` and got reminded to do this.

Signed-off-by: Colin Walters <walters@verbum.org>
  • Loading branch information
cgwalters committed Mar 28, 2023
1 parent 1230755 commit d4ba2f5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions lib/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ pub(crate) enum TestingOpts {
#[allow(clippy::large_enum_variant)]
pub(crate) enum Opt {
/// Look for updates to the booted container image.
#[clap(alias = "update")]
Upgrade(UpgradeOpts),
/// Target a new container image reference to boot.
Switch(SwitchOpts),
Expand Down
12 changes: 7 additions & 5 deletions lib/src/privtests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,13 @@ pub(crate) fn impl_run_container() -> Result<()> {
let stout = cmd!(sh, "bootc status").read()?;
assert!(stout.contains("Running in a container (ostree base)."));
drop(stout);
let o = Command::new("bootc").arg("upgrade").output()?;
let st = o.status;
assert!(!st.success());
let stderr = String::from_utf8(o.stderr)?;
assert!(stderr.contains("this command requires a booted host system"));
for c in ["upgrade", "update"] {
let o = Command::new("bootc").arg(c).output()?;
let st = o.status;
assert!(!st.success());
let stderr = String::from_utf8(o.stderr)?;
assert!(stderr.contains("this command requires a booted host system"));
}
println!("ok container integration testing");
Ok(())
}
Expand Down

0 comments on commit d4ba2f5

Please sign in to comment.