@@ 1,8 1,10 @@
mod updates_utils;
mod network;
+mod oneliners;
use updates_utils::get_updates;
use network::usage;
use structopt::StructOpt;
+use oneliners::{get_uptime};
#[derive(Debug,StructOpt)]
struct UserOptions {
@@ 28,6 30,9 @@ struct UserOptions {
/// Return the current network usage for the primary interface
usage: bool,
+ #[structopt(short,long)]
+ /// Return the system uptime in days
+ sys_uptime: bool,
}
fn main() {
@@ 46,5 51,10 @@ fn main() {
}
}
+ if args.sys_uptime == true {
+ if let Err(e) = get_uptime(&mut output_line){
+ eprintln!("Error received attempting show_updates: {}",e);
+ }
+ }
print!("{}",output_line);
}