mirror of
https://github.com/Baipyrus/ProxySwitcher.git
synced 2024-12-27 05:01:45 +00:00
30 lines
754 B
Go
30 lines
754 B
Go
package cmd
|
|
|
|
import (
|
|
"github.com/Baipyrus/ProxySwitcher/proxy"
|
|
"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) {
|
|
proxy.Set(cfgPath)
|
|
},
|
|
}
|
|
|
|
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")
|
|
}
|