Skip to content

Commit 9ba1c13

Browse files
committed
Update to clap 4.2
Just keeping up with things. Signed-off-by: Colin Walters <[email protected]>
1 parent 5303993 commit 9ba1c13

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ platforms = ["x86_64-unknown-linux-gnu", "aarch64-unknown-linux-gnu", "powerpc64
1919
[dependencies]
2020
anyhow = "1.0"
2121
bootc-lib = { version = "0.1", path = "../lib" }
22-
clap = "3.2"
22+
clap = "4.2"
2323
libc = "0.2.92"
2424
tokio = { version = "1", features = ["macros"] }
2525
log = "0.4.0"

lib/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ rust-version = "1.64.0"
1212
anyhow = "1.0"
1313
camino = { version = "1.0.4", features = ["serde1"] }
1414
ostree-ext = "0.10.6"
15-
clap = { version= "3.2", features = ["derive"] }
16-
clap_mangen = { version = "0.1", optional = true }
15+
clap = { version= "4.2", features = ["derive"] }
16+
clap_mangen = { version = "0.2", optional = true }
1717
cap-std-ext = "1.0.1"
1818
hex = "^0.4"
1919
fn-error-context = "0.2.0"

lib/src/docgen.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ fn generate_one(directory: &Utf8Path, cmd: Command) -> Result<()> {
3636

3737
for subcmd in cmd.get_subcommands().filter(|c| !c.is_hide_set()) {
3838
let subname = format!("{}-{}", name, subcmd.get_name());
39+
// SAFETY: Latest clap 4 requires names are &'static - this is
40+
// not long-running production code, so we just leak the names here.
41+
let subname = &*std::boxed::Box::leak(subname.into_boxed_str());
42+
let subcmd = subcmd.clone().name(subname).alias(subname).version(version);
3943
generate_one(directory, subcmd.clone().name(subname).version(version))?;
4044
}
4145
Ok(())

lib/src/install/baseline.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use camino::Utf8Path;
1717
use camino::Utf8PathBuf;
1818
use cap_std::fs::Dir;
1919
use cap_std_ext::cap_std;
20-
use clap::ArgEnum;
20+
use clap::ValueEnum;
2121
use fn_error_context::context;
2222
use serde::{Deserialize, Serialize};
2323

0 commit comments

Comments
 (0)