1
0
Fork 0
mirror of https://github.com/nishiki/manage-password.git synced 2025-02-20 01:50:04 +00:00

feat: minor improve get_item interface

This commit is contained in:
Adrien Waksberg 2017-08-10 23:23:06 +02:00
parent 948db2e905
commit 65db261c00
3 changed files with 10 additions and 4 deletions

View file

@ -91,7 +91,9 @@ en:
wallet_dir: "Set the wallets folder"
form:
select: "Select the item: "
select:
choice: "Select the item: "
error: "No item selected"
add_key:
valid: "Key has been added!"
add_item:

View file

@ -91,7 +91,9 @@ fr:
wallet_dir: "Spécifie le répertoire des portefeuilles"
form:
select: "Sélectionner l'élément: "
select:
choice: "Sélectionner l'élément: "
error: "Aucun élément sélectionné"
add_key:
valid: "La clé a bien été ajoutée!"
add_item:

View file

@ -286,9 +286,11 @@ module MPW
return items[0] if items.length == 1
items.sort! { |a, b| a.group.to_s.downcase <=> b.group.to_s.downcase }
choice = ask(I18n.t('form.select')).to_i
choice = ask(I18n.t('form.select.choice')).to_i
choice >= 1 && choice <= items.length ? items[choice - 1] : nil
raise I18n.t('form.select.error') unless choice >= 1 && choice <= items.length
items[choice - 1]
end
# Print help message for clipboard mode