aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/create.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/cmd/create.go b/cmd/create.go
index 95bbdc9..3f24d12 100644
--- a/cmd/create.go
+++ b/cmd/create.go
@@ -113,6 +113,7 @@ func Create(argv []string, conf *Configuration) {
cmd.Run()
if cmd.ProcessState.Success() {
+ again:
fmt.Printf("\nSave message? ([(y)es], (r)enamed, (d)raft, (n)o): ")
reader := bufio.NewReader(os.Stdin)
response, err := reader.ReadString('\n')
@@ -134,10 +135,14 @@ func Create(argv []string, conf *Configuration) {
dst, err = copyFile(tmpFile.Name(), dst, false)
saved = true
case "r", "renamed":
- fmt.Printf("\nSpecify new name: ")
+ fmt.Printf("\nSpecify new name (leave empty to return to previous menu): ")
reader := bufio.NewReader(os.Stdin)
response, err := reader.ReadString('\n')
+ if strings.TrimSpace(response) == "" {
+ goto again
+ }
+
if err != nil {
fmt.Printf("Error when reading response: %s\n", err.Error())
os.Exit(1)