initialize set command

This commit is contained in:
Baipyrus 2024-08-29 23:08:02 +02:00
parent e9debba906
commit 3bd3bea69a

39
cmd/set.go Normal file
View File

@ -0,0 +1,39 @@
package cmd
import (
"fmt"
"os"
"os/signal"
"syscall"
"github.com/spf13/cobra"
)
// setCmd represents the set command
var setCmd = &cobra.Command{
Use: "set",
Short: "Enable the current internet proxy settings",
Run: func(cmd *cobra.Command, args []string) {
fmt.Printf("Setting Proxy Settings...\n")
// Block process until interrupted
done := make(chan os.Signal, 1)
signal.Notify(done, syscall.SIGINT, syscall.SIGTERM)
fmt.Println("Blocking, press ctrl+c to continue...")
<-done
},
}
func init() {
rootCmd.AddCommand(setCmd)
// Here you will define your flags and configuration settings.
// Cobra supports Persistent Flags which will work for this command
// and all subcommands, e.g.:
// setCmd.PersistentFlags().String("foo", "", "A help for foo")
// Cobra supports local flags which will only run when this command
// is called directly, e.g.:
// setCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
}