MCPcopy Index your code
hub / github.com/FrameworkComputer/framework-system / get_args

Function get_args

framework_lib/src/commandline/uefi.rs:17–30  ·  view source on GitHub ↗

Get commandline arguments from UEFI environment

()

Source from the content-addressed store, hash-verified

15
16/// Get commandline arguments from UEFI environment
17pub fn get_args() -> Vec<String> {
18 let shell_params = uefi::boot::open_protocol_exclusive::<ShellParameters>(boot::image_handle());
19 let shell_params = match shell_params {
20 Ok(s) => s,
21 Err(_e) => {
22 error!("Failed to get ShellParameters protocol");
23 // TODO: Return result
24 // return e.status();
25 return vec![];
26 }
27 };
28 let args: Vec<String> = shell_params.args().map(|x| x.to_string()).collect();
29 args
30}
31
32pub fn parse(args: &[String]) -> Cli {
33 let mut cli = Cli {

Callers 1

mainFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected