add a skip option
This commit is contained in:
parent
d0d72873f2
commit
e8bac3c741
1 changed files with 7 additions and 1 deletions
|
@ -7,7 +7,7 @@ import (
|
||||||
"github.com/nexidian/gocliselect"
|
"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
|
// Make a regex to get the iommu group
|
||||||
iommu_group_regex := regexp.MustCompile(`(\d{1,3})`)
|
iommu_group_regex := regexp.MustCompile(`(\d{1,3})`)
|
||||||
|
|
||||||
|
@ -23,6 +23,12 @@ func GenIOMMUMenu(msg string, choices []string) string {
|
||||||
menu.AddItem(choice, iommuGroup)
|
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
|
// Add a go back option
|
||||||
menu.AddItem(color.Bold.Sprint("Go Back"), "back")
|
menu.AddItem(color.Bold.Sprint("Go Back"), "back")
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue