File tree Expand file tree Collapse file tree 3 files changed +12
-0
lines changed
framework_lib/src/commandline Expand file tree Collapse file tree 3 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -240,6 +240,9 @@ struct ClapCli {
240240 #[ arg( long) ]
241241 ec_hib_delay : Option < Option < u32 > > ,
242242
243+ #[ arg( long) ]
244+ uptimeinfo : bool ,
245+
243246 /// Hash a file of arbitrary data
244247 #[ arg( long) ]
245248 hash : Option < std:: path:: PathBuf > ,
@@ -454,6 +457,7 @@ pub fn parse(args: &[String]) -> Cli {
454457 console : args. console ,
455458 reboot_ec : args. reboot_ec ,
456459 ec_hib_delay : args. ec_hib_delay ,
460+ uptimeinfo : args. uptimeinfo ,
457461 hash : args. hash . map ( |x| x. into_os_string ( ) . into_string ( ) . unwrap ( ) ) ,
458462 driver : args. driver ,
459463 pd_addrs,
Original file line number Diff line number Diff line change @@ -211,6 +211,7 @@ pub struct Cli {
211211 pub console : Option < ConsoleArg > ,
212212 pub reboot_ec : Option < RebootEcArg > ,
213213 pub ec_hib_delay : Option < Option < u32 > > ,
214+ pub uptimeinfo : bool ,
214215 pub hash : Option < String > ,
215216 pub pd_addrs : Option < ( u16 , u16 , u16 ) > ,
216217 pub pd_ports : Option < ( u8 , u8 , u8 ) > ,
@@ -295,6 +296,7 @@ pub fn parse(args: &[String]) -> Cli {
295296 console : cli. console ,
296297 reboot_ec : cli. reboot_ec ,
297298 // ec_hib_delay
299+ uptimeinfo : cli. uptimeinfo ,
298300 hash : cli. hash ,
299301 pd_addrs : cli. pd_addrs ,
300302 pd_ports : cli. pd_ports ,
@@ -1174,6 +1176,8 @@ pub fn run_with_args(args: &Cli, _allupdate: bool) -> i32 {
11741176 print_err ( ec. set_ec_hib_delay ( * delay) ) ;
11751177 }
11761178 print_err ( ec. get_ec_hib_delay ( ) ) ;
1179+ } else if args. uptimeinfo {
1180+ print_err ( ec. get_uptime_info ( ) ) ;
11771181 } else if args. test {
11781182 println ! ( "Self-Test" ) ;
11791183 let result = selftest ( & ec) ;
Original file line number Diff line number Diff line change @@ -78,6 +78,7 @@ pub fn parse(args: &[String]) -> Cli {
7878 console : None ,
7979 reboot_ec : None ,
8080 ec_hib_delay : None ,
81+ uptimeinfo : false ,
8182 hash : None ,
8283 // This is the only driver that works on UEFI
8384 driver : Some ( CrosEcDriverType :: Portio ) ,
@@ -493,6 +494,9 @@ pub fn parse(args: &[String]) -> Cli {
493494 Some ( None )
494495 } ;
495496 found_an_option = true ;
497+ } else if arg == "--uptimeinfo" {
498+ cli. uptimeinfo = true ;
499+ found_an_option = true ;
496500 } else if arg == "-t" || arg == "--test" {
497501 cli. test = true ;
498502 found_an_option = true ;
You can’t perform that action at this time.
0 commit comments