mirror of
https://github.com/rwinkhart/MUTN.git
synced 2026-08-28 04:46:41 -04:00
Merge EditEntryNote into EditEntryField
This commit is contained in:
+3
-14
@@ -35,21 +35,9 @@ func EditEntryField(targetLocation string, hidePassword bool, field int) {
|
||||
unencryptedEntry[field] = input("Username:")
|
||||
case 2:
|
||||
unencryptedEntry[field] = input("URL:")
|
||||
}
|
||||
|
||||
// write and preview the modified entry
|
||||
writeEntryCLI(targetLocation, unencryptedEntry, hidePassword)
|
||||
}
|
||||
|
||||
// EditEntryNote edits the note of an entry at targetLocation (user input)
|
||||
func EditEntryNote(targetLocation string, hidePassword bool) {
|
||||
// fetch old entry data (with all required lines present)
|
||||
unencryptedEntry := backend.GetOldEntryData(targetLocation, 2)
|
||||
|
||||
// store non-note data separately
|
||||
case 3: // edit notes fields
|
||||
// store note and non-note data separately
|
||||
nonNoteData := unencryptedEntry[:3]
|
||||
|
||||
// store note data separately
|
||||
noteData := unencryptedEntry[3:]
|
||||
|
||||
// edit the note
|
||||
@@ -59,6 +47,7 @@ func EditEntryNote(targetLocation string, hidePassword bool) {
|
||||
os.Exit(1)
|
||||
}
|
||||
unencryptedEntry = append(nonNoteData, editedNote...)
|
||||
}
|
||||
|
||||
// write and preview the modified entry
|
||||
writeEntryCLI(targetLocation, unencryptedEntry, hidePassword)
|
||||
|
||||
Reference in New Issue
Block a user