From 43cf870c98c98d2c818178cc4b9d14810a3cc7a9 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Thu, 1 Mar 2018 01:32:32 +0100 Subject: Try to match `-i` argument Turn on a `hide_password` boolean variable if an `-i` argument is passed in (haven't tested this yet). This tells us whether the user wants us to hide the password in the selection interface. --- src/main.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/main.rs b/src/main.rs index 9b1fe59..ffe6329 100644 --- a/src/main.rs +++ b/src/main.rs @@ -92,6 +92,12 @@ fn is_password_line(line: &str) -> bool { fn main() { let args: Vec = env::args().collect(); + let hide_password = match args.first() { + Some(arg) if arg == "-i" => true, + Some(_) => false, + None => false, + }; + let input = if args.len() > 1 { &args[1] } else { -- cgit v1.2.3