Implement entry/directory renaming/moving

This commit is contained in:
2024-03-07 17:40:57 -05:00
parent 5bc0ff96c0
commit e729953cab
2 changed files with 16 additions and 1 deletions
+15
View File
@@ -0,0 +1,15 @@
package cli
import "github.com/rwinkhart/MUTN/src/offline"
// RenameCli renames an entry at oldLocation to a new location (user input)
func RenameCli(oldLocation string) {
// ensure targetLocation exists
offline.TargetIsFile(oldLocation, true, 0)
// prompt user for new location and rename
newLocation := offline.EntryRoot + offline.PathSeparator + input("New location:")
offline.Rename(oldLocation, newLocation)
// exit is done from offline.Rename
}
+1 -1
View File
@@ -37,7 +37,7 @@ This program comes with absolutely no warranty; type "mutn version" for details.
note/-n Add a note entry note/-n Add a note entry
folder/-f Add a new folder for entries folder/-f Add a new folder for entries
edit: edit:
rename/relocate/-r Rename or relocate an entry rename/-r Rename or relocate an entry
username/-u Change the username of an entry username/-u Change the username of an entry
password/-p Change the password of an entry password/-p Change the password of an entry
url/-l Change the url attached to an entry url/-l Change the url attached to an entry