diff --git a/lib/core/conf/keys.rs b/lib/core/conf/keys.rs index 32f7850736f7fd6ef1cfab3b6b434385afb9019d..0adb90d94e27d849557dc3e41b97b7ca18b27b28 100644 --- a/lib/core/conf/keys.rs +++ b/lib/core/conf/keys.rs @@ -81,10 +81,10 @@ pub fn clear_keys(network: bool, member: bool, mut key_pairs: DuniterKeyPairs) - /// Show keys command pub fn show_keys(key_pairs: DuniterKeyPairs) { - println!("Network key : {}", key_pairs.network_keypair); + println!("Network key: {}", key_pairs.network_keypair); match key_pairs.member_keypair { None => println!("No member key configured"), - Some(key) => println!("Member key : {}", key), + Some(key) => println!("Member key: {}", key), } } @@ -97,7 +97,7 @@ pub fn save_keypairs(profile: &str, key_pairs: DuniterKeyPairs) { fn question_prompt(question: &str, answers: Vec<String>) -> Result<String, WizardError> { let mut buf = String::new(); - println!("{} ({}) :", question, answers.join("/")); + println!("{} ({}):", question, answers.join("/")); let res = io::stdin().read_line(&mut buf); match res { @@ -113,9 +113,9 @@ fn question_prompt(question: &str, answers: Vec<String>) -> Result<String, Wizar } fn salt_password_prompt() -> Result<KeyPairEnum, WizardError> { - let salt = rpassword::prompt_password_stdout("? Salt: ")?; + let salt = rpassword::prompt_password_stdout("Salt: ")?; if !salt.is_empty() { - let password = rpassword::prompt_password_stdout("? Password: ")?; + let password = rpassword::prompt_password_stdout("Password: ")?; if !password.is_empty() { let generator = ed25519::KeyPairFromSaltedPasswordGenerator::with_default_parameters(); let key_pairs = KeyPairEnum::Ed25519(generator.generate( @@ -134,7 +134,7 @@ fn salt_password_prompt() -> Result<KeyPairEnum, WizardError> { /// The wizard key function pub fn key_wizard(mut key_pairs: DuniterKeyPairs) -> Result<DuniterKeyPairs, WizardError> { let mut answer = question_prompt( - "? Modify your network keypair?", + "Modify your network keypair?", vec!["y".to_string(), "n".to_string()], )?; if answer == "y" { @@ -142,13 +142,13 @@ pub fn key_wizard(mut key_pairs: DuniterKeyPairs) -> Result<DuniterKeyPairs, Wiz } answer = question_prompt( - "? Modify your member keypair?", + "Modify your member keypair?", vec!["y".to_string(), "n".to_string(), "d".to_string()], )?; if answer == "y" { key_pairs.member_keypair = Some(salt_password_prompt()?); } else if answer == "d" { - println!("Deleting member keypair !"); + println!("Deleting member keypair!"); key_pairs.member_keypair = None; } diff --git a/lib/core/core/cli/keys.rs b/lib/core/core/cli/keys.rs index 14cfa8ac849e390e9a20694185b1e7b583fcc66f..bcc1aa0a2def54487869afcfc34b49eca89a4559 100644 --- a/lib/core/core/cli/keys.rs +++ b/lib/core/core/cli/keys.rs @@ -13,7 +13,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. -//! Durs-core cli : dbex subcommands. +//! Durs-core cli : keys subcommands. #[derive(StructOpt, Debug, Clone)] #[structopt( @@ -21,7 +21,7 @@ author = "inso <inso@tuta.io>", raw(setting = "structopt::clap::AppSettings::ColoredHelp") )] -/// durs databases explorer +/// keys management pub struct KeysOpt { #[structopt(subcommand)] /// KeysSubCommand @@ -31,7 +31,7 @@ pub struct KeysOpt { #[derive(StructOpt, Debug, Clone)] /// keys subcommands pub enum KeysSubCommand { - /// modify durs keys + /// Modify keys #[structopt( name = "modify", author = "inso <inso@tuta.io>", @@ -39,7 +39,7 @@ pub enum KeysSubCommand { )] Modify(ModifyOpt), - /// clear durs keys + /// Clear keys #[structopt( name = "clear", author = "inso <inso@tuta.io>", @@ -47,7 +47,7 @@ pub enum KeysSubCommand { )] Clear(ClearOpt), - /// show durs keys + /// Show keys #[structopt( name = "show", author = "inso <inso@tuta.io>", @@ -60,7 +60,7 @@ pub enum KeysSubCommand { author = "inso <inso@tuta.io>", raw(setting = "structopt::clap::AppSettings::ColoredHelp") )] - /// wizard to help user generate durs keys + /// Keys generator wizard Wizard(WizardOpt), }