refactor and start adding actual functionality
This commit is contained in:
parent
9efa0ee226
commit
82fec3ab58
11 changed files with 158 additions and 33 deletions
27
pkg/menu/manual.go
Normal file
27
pkg/menu/manual.go
Normal file
|
@ -0,0 +1,27 @@
|
|||
package menu
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/HikariKnight/ls-iommu/pkg/errorcheck"
|
||||
"github.com/gookit/color"
|
||||
)
|
||||
|
||||
func ManualInput(msg string, format string) []string {
|
||||
// Print the title
|
||||
color.Bold.Println(msg)
|
||||
|
||||
// Tell user the format to use
|
||||
color.Bold.Printf("The format is %s\n", format)
|
||||
|
||||
// Get the user input
|
||||
var input string
|
||||
_, err := fmt.Scan(&input)
|
||||
errorcheck.ErrorCheck(err)
|
||||
|
||||
input_list := strings.Split(input, ",")
|
||||
|
||||
// Return the input
|
||||
return input_list
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue