Make timeout configurable

This commit is contained in:
timvisee 2018-11-20 12:42:27 +01:00
parent 0054daadff
commit f693ff42d3
No known key found for this signature in database
GPG key ID: 109CBA0BF74036C2
12 changed files with 99 additions and 22 deletions

View file

@ -49,6 +49,22 @@ impl<'a: 'b, 'b> MainMatcher<'a> {
}
}
/// Get the timeout in seconds
pub fn timeout(&self) -> u64 {
self.matches
.value_of("timeout")
.and_then(|arg| arg.parse().ok())
.expect("invalid timeout value")
}
/// Get the transfer timeout in seconds
pub fn transfer_timeout(&self) -> u64 {
self.matches
.value_of("transfer-timeout")
.and_then(|arg| arg.parse().ok())
.expect("invalid transfer-timeout value")
}
/// Check whether we are incognito from the file history.
#[cfg(feature = "history")]
pub fn incognito(&self) -> bool {