Skip to content

Commit de988f0

Browse files
jeckersbcgwalters
authored andcommitted
install: Hoist InstallResetOpts kargs parsing up into clap
Signed-off-by: John Eckersberg <[email protected]>
1 parent b01ffa8 commit de988f0

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

crates/lib/src/install.rs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use std::time::Duration;
2727

2828
use aleph::InstallAleph;
2929
use anyhow::{anyhow, ensure, Context, Result};
30-
use bootc_kernel_cmdline::utf8::{Cmdline, Parameter};
30+
use bootc_kernel_cmdline::utf8::{Cmdline, CmdlineOwned};
3131
use bootc_utils::CommandRunExt;
3232
use camino::Utf8Path;
3333
use camino::Utf8PathBuf;
@@ -434,7 +434,7 @@ pub(crate) struct InstallResetOpts {
434434
///
435435
/// Example: --karg=nosmt --karg=console=ttyS0,114800n8
436436
#[clap(long)]
437-
karg: Option<Vec<String>>,
437+
karg: Option<Vec<CmdlineOwned>>,
438438
}
439439

440440
/// Global state captured from the container.
@@ -2335,15 +2335,10 @@ pub(crate) async fn install_reset(opts: InstallResetOpts) -> Result<()> {
23352335
}
23362336

23372337
// Extend with user-provided kargs
2338-
if let Some(user_kargs) = opts.karg {
2339-
let user_kargs = user_kargs
2340-
.iter()
2341-
.map(|arg| {
2342-
Parameter::parse(arg).ok_or_else(|| anyhow!("Unable to parse parameter: {arg}"))
2343-
})
2344-
.collect::<Result<Vec<_>>>()?;
2345-
2346-
kargs.extend(user_kargs);
2338+
if let Some(user_kargs) = opts.karg.as_ref() {
2339+
for karg in user_kargs {
2340+
kargs.extend(karg);
2341+
}
23472342
}
23482343

23492344
let from = MergeState::Reset {

0 commit comments

Comments
 (0)