
* Fix: don't need sudo if we're root + other aesthetics
* Heavy refactoring, see PR #28
* Fix: avoid silent fatalities
demo: https://tcp.ac/i/JMSUc.gif
* Fix: Inverse check on `IsRoot`
* D.R.Y: check for permissions error in `common.ErrorCheck`
Reduce cognitive complexity.
* Fix: Issue with copying
* Resolve https://github.com/HikariKnight/quickpassthrough/pull/28#discussion_r1646535918
* Resolve https://github.com/HikariKnight/quickpassthrough/pull/28#discussion_r1646606680 and https://github.com/HikariKnight/quickpassthrough/pull/28#discussion_r1646594105
* Revert "Resolve https://github.com/HikariKnight/quickpassthrough/pull/28#discussion_r1646606680 and https://github.com/HikariKnight/quickpassthrough/pull/28#discussion_r1646594105"
This reverts commit ce15213009
.
* Resolve https://github.com/HikariKnight/quickpassthrough/pull/28#discussion_r1646730751
28 lines
494 B
Go
28 lines
494 B
Go
package menu
|
|
|
|
import (
|
|
"fmt"
|
|
"strings"
|
|
|
|
"github.com/gookit/color"
|
|
|
|
"github.com/HikariKnight/quickpassthrough/internal/common"
|
|
)
|
|
|
|
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)
|
|
common.ErrorCheck(err)
|
|
|
|
input_list := strings.Split(input, ",")
|
|
|
|
// Return the input
|
|
return input_list
|
|
}
|