add a skip option

This commit is contained in:
HikariKnight 2023-10-27 08:18:52 +02:00
parent d0d72873f2
commit e8bac3c741

View file

@ -7,7 +7,7 @@ import (
"github.com/nexidian/gocliselect"
)
func GenIOMMUMenu(msg string, choices []string) string {
func GenIOMMUMenu(msg string, choices []string, none_option ...int) string {
// Make a regex to get the iommu group
iommu_group_regex := regexp.MustCompile(`(\d{1,3})`)
@ -23,6 +23,12 @@ func GenIOMMUMenu(msg string, choices []string) string {
menu.AddItem(choice, iommuGroup)
}
// If none_option is higher than 0
if len(none_option) > 0 {
// Add a skip option
menu.AddItem(color.Bold.Sprint("Skip/None"), "skip")
}
// Add a go back option
menu.AddItem(color.Bold.Sprint("Go Back"), "back")