42 lines
1.5 KiB
Rust
42 lines
1.5 KiB
Rust
// Gather and display system information
|
|
// Copyright (C) 2021 Lucien Cartier-Tilet <lucien@phundrak.com>
|
|
//
|
|
// This program is free software: you can redistribute it and/or modify
|
|
// it under the terms of the GNU General Public License as published by
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
// (at your option) any later version.
|
|
//
|
|
// This program is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
// GNU General Public License for more details.
|
|
//
|
|
// You should have received a copy of the GNU General Public License
|
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
use clap::Parser;
|
|
|
|
const AFTER_HELP: &str = r#"This programm comes with ABSOLUTELY NO WARRANTY. This is free
|
|
software, and you are welcome to redistribute it under certain
|
|
conditions; see the GPL-3.0 license or newer
|
|
<https://www.gnu.org/licenses/>"#;
|
|
|
|
#[derive(Parser, Debug)]
|
|
#[clap(name="Pumo System Info",about,version,author,after_long_help=AFTER_HELP)]
|
|
pub struct Args {
|
|
#[clap(short, long, help="JSON output")]
|
|
pub json: bool,
|
|
|
|
#[clap(short, long, default_value_t = 75)]
|
|
pub warning_level: u8,
|
|
|
|
#[clap(short, long, default_value_t = 90)]
|
|
pub critical_level: u8,
|
|
|
|
#[clap(short = 'W', long, default_value_t = 72, help="Width of the console output")]
|
|
pub width: usize,
|
|
|
|
#[clap(short, long, help="Display seconds in uptime")]
|
|
pub seconds: bool,
|
|
}
|