feat: Ability to enter password via stdin add&edit #15

Merged
awiteb merged 4 commits from awiteb/fix-6 into master 2024-04-25 00:27:56 +02:00 AGit
2 changed files with 11 additions and 10 deletions
Showing only changes of commit b4b467bdfc - Show all commits

View file

@ -44,10 +44,8 @@ impl RunCommand for Import {
{
let imported_passwords_len = match self.format {
Format::Lprs => {
let vaults = Vaults::try_reload(
self.path.to_path_buf(),
vault_manager.master_password.to_vec(),
)?;
let vaults =
Vaults::try_reload(self.path, vault_manager.master_password.to_vec())?;
let vaults_len = vaults.vaults.len();
vault_manager.vaults.extend(vaults.vaults);

View file

@ -187,11 +187,14 @@ impl Vaults<Plain> {
}
}
impl ToString for Format {
fn to_string(&self) -> String {
impl std::fmt::Display for Format {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(
f,
"{}",
self.to_possible_value()
.expect("There is no skiped values")
.get_name()
.to_owned()
)
}
}