mirror of
https://github.com/nishiki/manage-password.git
synced 2025-03-19 12:59:30 +00:00
quit if delete item
This commit is contained in:
parent
e7956b2006
commit
a8a083250b
1 changed files with 7 additions and 2 deletions
|
@ -260,7 +260,7 @@ class Cli
|
||||||
puts I18n.t('form.clipboard.otp', time: @mpw.get_otp_remaining_time).yellow
|
puts I18n.t('form.clipboard.otp', time: @mpw.get_otp_remaining_time).yellow
|
||||||
|
|
||||||
when 'd', 'delete'
|
when 'd', 'delete'
|
||||||
delete(item)
|
break if delete(item)
|
||||||
|
|
||||||
when 'u', 'update', 'e', 'edit'
|
when 'u', 'update', 'e', 'edit'
|
||||||
update(item)
|
update(item)
|
||||||
|
@ -270,6 +270,8 @@ class Cli
|
||||||
puts I18n.t('form.clipboard.help.login')
|
puts I18n.t('form.clipboard.help.login')
|
||||||
puts I18n.t('form.clipboard.help.password')
|
puts I18n.t('form.clipboard.help.password')
|
||||||
puts I18n.t('form.clipboard.help.otp_code')
|
puts I18n.t('form.clipboard.help.otp_code')
|
||||||
|
puts I18n.t('form.clipboard.help.update')
|
||||||
|
puts I18n.t('form.clipboard.help.delete')
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -405,7 +407,7 @@ class Cli
|
||||||
confirm = ask("#{I18n.t('form.delete_item.ask')} (y/N) ").to_s
|
confirm = ask("#{I18n.t('form.delete_item.ask')} (y/N) ").to_s
|
||||||
|
|
||||||
if not confirm =~ /^(y|yes|YES|Yes|Y)$/
|
if not confirm =~ /^(y|yes|YES|Yes|Y)$/
|
||||||
return
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
item.delete
|
item.delete
|
||||||
|
@ -413,8 +415,11 @@ class Cli
|
||||||
@mpw.sync(true) if @sync
|
@mpw.sync(true) if @sync
|
||||||
|
|
||||||
puts "#{I18n.t('form.delete_item.valid')}".green
|
puts "#{I18n.t('form.delete_item.valid')}".green
|
||||||
|
|
||||||
|
return true
|
||||||
rescue Exception => e
|
rescue Exception => e
|
||||||
puts "#{I18n.t('display.error')} #16: #{e}".red
|
puts "#{I18n.t('display.error')} #16: #{e}".red
|
||||||
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
# Export the items in a CSV file
|
# Export the items in a CSV file
|
||||||
|
|
Loading…
Add table
Reference in a new issue