diff options
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs index 6872498f..2542b106 100644 --- a/src/main.rs +++ b/src/main.rs @@ -56,7 +56,15 @@ fn main() -> error::Result<()> { //.after_help("Themes:") // TODO: This and others disabled for now .get_matches(); - let update_rate_in_milliseconds : u128 = matches.value_of("RATE_MILLIS").unwrap_or("1000").parse::<u128>()?; + let update_rate_in_milliseconds : u128 = if matches.is_present("RATE_MILLIS") { + matches + .value_of("RATE_MILLIS") + .unwrap_or(&constants::DEFAULT_REFRESH_RATE_IN_MILLISECONDS.to_string()) + .parse::<u128>()? + } + else { + constants::DEFAULT_REFRESH_RATE_IN_MILLISECONDS + }; if update_rate_in_milliseconds < 250 { return Err(RustopError::InvalidArg { |