~deadjakk/RiceStats

7f58b67d0ec7216ed5235980676feec8fde6a3e1 — deadjakk 3 years ago 4080c9f
added uptime
1 files changed, 10 insertions(+), 0 deletions(-)

M src/main.rs
M src/main.rs => src/main.rs +10 -0
@@ 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);
}