Implement quiet CLI flag, only report URLs for history with quiet

This commit is contained in:
timvisee 2018-11-21 21:55:19 +01:00
parent 3ea774e227
commit 5ac3cd4b15
No known key found for this signature in database
GPG key ID: 109CBA0BF74036C2
4 changed files with 64 additions and 41 deletions

View file

@ -71,6 +71,11 @@ impl<'a: 'b, 'b> MainMatcher<'a> {
self.matches.is_present("incognito") || env_var_present("FFSEND_INCOGNITO")
}
/// Check whether quiet mode is used.
pub fn quiet(&self) -> bool {
!self.verbose() && (self.matches.is_present("quiet") || env_var_present("FFSEND_QUIET"))
}
/// Check whether verbose mode is used.
pub fn verbose(&self) -> bool {
self.matches.is_present("verbose") || env_var_present("FFSEND_VERBOSE")