Skip to content

Commit

Permalink
main: Make supplying the commandline optional
Browse files Browse the repository at this point in the history
If no commandline is supplied replace with an empty string. No kernel
commandline is needed when using the firmware to boot.

Signed-off-by: Rob Bradford <[email protected]>
  • Loading branch information
rbradford authored and Samuel Ortiz committed May 10, 2019
1 parent 2c94529 commit adb0abf
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,21 @@ fn main() {
.expect("Missing argument: kernel");
let kernel_path = kernel_arg.as_path();

let cmdline = cmd_arguments
.value_of("cmdline")
.map(std::string::ToString::to_string)
.expect("Missing argument: cmdline");

let disk_arg = cmd_arguments
.value_of("disk")
.map(PathBuf::from)
.expect("Missing argument: disk");
let disk_path = disk_arg.as_path();

let cmdline = if cmd_arguments.is_present("cmdline") {
cmd_arguments
.value_of("cmdline")
.map(std::string::ToString::to_string)
.unwrap()
} else {
String::new()
};

let mut net_params = None;
if cmd_arguments.is_present("net") {
if let Some(net) = cmd_arguments.value_of("net") {
Expand Down

0 comments on commit adb0abf

Please sign in to comment.