diff --git a/lib/src/cli.rs b/lib/src/cli.rs index f92fe677..06075c36 100644 --- a/lib/src/cli.rs +++ b/lib/src/cli.rs @@ -916,6 +916,9 @@ impl Opt { InternalsOpts::GENERATOR_BIN => { Some(["bootc", "internals", "systemd-generator"].as_slice()) } + "ostree-container" | "ostree-ima-sign" | "ostree-provisional-repair" => { + Some(["bootc", "internals", "ostree-ext"].as_slice()) + } _ => None, }; if let Some(base_args) = mapped { @@ -1136,4 +1139,28 @@ fn test_parse_ostree_ext() { Opt::parse_including_static(["bootc", "internals", "ostree-container"]), Opt::Internals(InternalsOpts::OstreeContainer { .. }) )); + + fn peel(o: Opt) -> Vec { + match o { + Opt::Internals(InternalsOpts::OstreeExt { args }) => args, + o => panic!("unexpected {o:?}"), + } + } + let args = peel(Opt::parse_including_static([ + "/usr/libexec/libostree/ext/ostree-ima-sign", + "ima-sign", + "--repo=foo", + "foo", + "bar", + "baz", + ])); + assert_eq!(args.as_slice(), ["--repo=foo", "foo", "bar", "baz"]); + + let args = peel(Opt::parse_including_static([ + "/usr/libexec/libostree/ext/ostree-container", + "container", + "image", + "pull", + ])); + assert_eq!(args.as_slice(), ["image", "pull"]); }