Skip to content

Commit 8e9155b

Browse files
author
Flavio Oliveira
authored
Merge pull request #1 from snake66/option-to-be-less-verbose
Add option to be less verbose.
2 parents 86de433 + f8daaf1 commit 8e9155b

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

src/main.rs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,11 @@ fn main() {
100100
Arg::with_name("input")
101101
.help("the input file to use")
102102
.index(1)
103-
.required(true)
103+
.required(true),
104+
Arg::with_name("quiet")
105+
.help("Be less verbose")
106+
.short("q")
107+
.long("quiet")
104108
]).get_matches();
105109

106110
if let Some(file_name) = matches.value_of("input") {
@@ -118,11 +122,13 @@ fn main() {
118122
});
119123

120124
if let Ok(Event::Connect(_sender)) = rx.recv() {
121-
println!("{} {} Fetching Certificates ...", style("[Nettfiske]").bold().dim(), LOOKING_GLASS);
125+
if !matches.is_present("quiet") {
126+
println!("{} {} Fetching Certificates ...", style("[Nettfiske]").bold().dim(), LOOKING_GLASS);
127+
}
122128
}
123129

124130
// Ensure the client has a chance to finish up
125-
client.join().unwrap();
131+
client.join().unwrap();
126132
}
127133
}
128134

@@ -135,6 +141,6 @@ fn open_json_config(file_name: &str) -> Result<String, IOError> {
135141
let mut buf_reader = BufReader::new(file);
136142
let mut contents = String::new();
137143
buf_reader.read_to_string(&mut contents)?;
138-
139-
Ok(contents)
140-
}
144+
145+
Ok(contents)
146+
}

0 commit comments

Comments
 (0)