diff --git a/CHANGELOG.md b/CHANGELOG.md index 76dccee..470885b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,17 @@ # Changelog - [Changelog](#changelog) + - [0.1.1](#011) - [0.1.0](#010) --- +## 0.1.1 + +Work in progress + +- password prompt: ask before performing terminal clear + ## 0.1.0 Released on 06/12/2020 diff --git a/src/main.rs b/src/main.rs index 8dfb30b..37116f6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -134,17 +134,9 @@ fn main() { Ok(dir) => dir, Err(_) => PathBuf::from("/"), }; - // Create activity manager - let mut manager: ActivityManager = match ActivityManager::new(&wrkdir, ticks) { - Ok(m) => m, - Err(_) => { - eprintln!("Invalid directory '{}'", wrkdir.display()); - std::process::exit(255); - } - }; // Initialize client if necessary let mut start_activity: NextActivity = NextActivity::Authentication; - if let Some(address) = address { + if address.is_some() { if password.is_none() { // Ask password if unspecified password = match rpassword::read_password_from_tty(Some("Password: ")) { @@ -163,6 +155,17 @@ fn main() { } // In this case the first activity will be FileTransfer start_activity = NextActivity::FileTransfer; + } + // Create activity manager (and context too) + let mut manager: ActivityManager = match ActivityManager::new(&wrkdir, ticks) { + Ok(m) => m, + Err(_) => { + eprintln!("Invalid directory '{}'", wrkdir.display()); + std::process::exit(255); + } + }; + // Set file transfer params if set + if let Some(address) = address { manager.set_filetransfer_params(address, port, protocol, username, password); } // Run