From eaf8036330d626116e9ff757f65bc81048ae20eb Mon Sep 17 00:00:00 2001 From: HikariKnight <2557889+HikariKnight@users.noreply.github.com> Date: Sun, 29 Oct 2023 12:08:37 +0100 Subject: [PATCH] add OkBack --- pkg/menu/ok.go | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/pkg/menu/ok.go b/pkg/menu/ok.go index fd750ac..6a12bfa 100644 --- a/pkg/menu/ok.go +++ b/pkg/menu/ok.go @@ -2,7 +2,7 @@ package menu import "github.com/nexidian/gocliselect" -// Make a YesNo menu +// Make an OK menu func Ok(msg string) string { // Make the menu menu := gocliselect.NewMenu(msg) @@ -14,3 +14,17 @@ func Ok(msg string) string { // Return the value selected return choice } + +// Make an OK & Go Back menu +func OkBack(msg string) string { + // Make the menu + menu := gocliselect.NewMenu(msg) + menu.AddItem("OK", "next") + menu.AddItem("Go Back", "back") + + // Display the menu + choice := menu.Display() + + // Return the value selected + return choice +}