aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTeddy Wing2018-03-01 01:32:32 +0100
committerTeddy Wing2018-03-01 01:32:32 +0100
commit43cf870c98c98d2c818178cc4b9d14810a3cc7a9 (patch)
treec7a9a6a1e73e59b94e8ee551bbea6cb253076a41 /src
parent8c9c211c249b9f2a4616b341e6378177129f3a4e (diff)
downloadPassextract-43cf870c98c98d2c818178cc4b9d14810a3cc7a9.tar.bz2
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.
Diffstat (limited to 'src')
-rw-r--r--src/main.rs6
1 files changed, 6 insertions, 0 deletions
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<String> = 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 {