aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2018-03-14 12:41:49 +0100
committerHarald Eilertsen <haraldei@anduin.net>2018-03-14 12:41:49 +0100
commitfcbc8709c44b9e295fc702035861de90ea593ef6 (patch)
treef093b7343c28d23da9fc9c3c3c35dd607e70855f /src
parent1ce10e19a2b07322e49f885efc4115e0ded8f459 (diff)
downloadcheckpw-fcbc8709c44b9e295fc702035861de90ea593ef6.tar.gz
checkpw-fcbc8709c44b9e295fc702035861de90ea593ef6.tar.bz2
checkpw-fcbc8709c44b9e295fc702035861de90ea593ef6.zip
Split main loop, first parse args then check passwords.
Diffstat (limited to 'src')
-rw-r--r--src/main.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs
index ffe811e..9450068 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -111,10 +111,12 @@ fn check(pw: Password) -> Result<(), Box<::std::error::Error>> {
}
fn main() {
+ let mut passwords = Vec::new();
for arg in env::args().skip(1) {
- let pw = Password::new(&arg);
- println!("{}:{}:{}:", &arg, pw.range, pw.rest);
+ passwords.push(Password::new(&arg));
+ };
+ for pw in passwords {
check(pw).unwrap();
- };
+ }
}