Allow optionally adding notes to new password entries

This commit is contained in:
2024-03-07 12:01:49 -05:00
parent 14b3d7bd45
commit 56ffe7e36f
2 changed files with 22 additions and 7 deletions
+9 -5
View File
@@ -17,11 +17,15 @@ func AddEntry(targetLocation string, hidePassword bool, isNote bool) {
var unencryptedEntry []string
if !isNote {
username := input("Username: ")
password := inputHidden("Password: ")
url := input("URL: ")
// TODO prompt for optional note
unencryptedEntry = []string{password, username, url}
username := input("Username:")
password := inputHidden("Password:")
url := input("URL:")
if inputBinary("Add a note to this entry?") {
note := newNote()
unencryptedEntry = append([]string{password, username, url}, note...)
} else {
unencryptedEntry = []string{password, username, url}
}
} else {
note := newNote()
unencryptedEntry = append([]string{"", "", ""}, note...)