prepare prompting for config data

This commit is contained in:
Baipyrus 2024-08-31 21:10:34 +02:00
parent a1ff03de66
commit 7c52c2d5d0

View File

@ -2,9 +2,6 @@ package cmd
import ( import (
"fmt" "fmt"
"os"
"os/signal"
"syscall"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
@ -14,13 +11,13 @@ var saveCmd = &cobra.Command{
Use: "save", Use: "save",
Short: "Save a new internet proxy config", Short: "Save a new internet proxy config",
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
fmt.Printf("Saving New Proxy Config...\n") var name string
fmt.Print("Name: ")
fmt.Scanln(&name)
// Block process until interrupted var command string
done := make(chan os.Signal, 1) fmt.Print("Command? ")
signal.Notify(done, syscall.SIGINT, syscall.SIGTERM) fmt.Scanln(&command)
fmt.Println("Blocking, press ctrl+c to continue...")
<-done
}, },
} }