monitoring with repeat and defaults

defaults can also be toggled off
This commit is contained in:
Christoph J. Scherr 2023-07-09 13:45:01 +02:00
parent 763f734649
commit 02be0f5d15
No known key found for this signature in database
GPG key ID: 25B4ACF7D88186CC

View file

@ -15,6 +15,8 @@
#![warn(clippy::pedantic)] #![warn(clippy::pedantic)]
//// IMPORTS /////////////////////////////////////////////////////////////////////////////////////// //// IMPORTS ///////////////////////////////////////////////////////////////////////////////////////
use libpt;
use clap::{Args, Parser, Subcommand}; use clap::{Args, Parser, Subcommand};
use clap_num::number_range; use clap_num::number_range;
@ -85,14 +87,20 @@ pub enum Commands {
pub enum NetCommands { pub enum NetCommands {
/// monitor your network /// monitor your network
Monitor { Monitor {
#[clap(short, long)] /// repeat every N milliseconds, 0 means no repeat
repeat: bool, #[clap(short, long, default_value_t = 0, name = "N")]
repeat: u64,
/// At what percentage should the try be considered successful
#[clap(short, long, default_value_t = 100, value_parser=max100)] #[clap(short, long, default_value_t = 100, value_parser=max100)]
percentage_for_success: u8, success_ratio: u8,
#[arg(default_values_t = ["https://cloudflare.com".to_string()])] /// extra URLs to check with
additional_domains: Vec<String>, extra_urls: Vec<String>,
/// Don't check for default URLs
#[clap(short, long)]
no_default: bool
}, },
/// discover hosts in your network /// discover hosts in your network