ipv4 and ipv6 network test

This commit is contained in:
Ben Sarmiento
2024-01-11 01:26:43 +01:00
parent b00ca8375b
commit 86e9e1f8a1
3 changed files with 97 additions and 24 deletions

View File

@@ -9,7 +9,8 @@ import (
)
func main() {
var configPath string // Variable to hold the config path
var configPath string // Variable to hold the config path
var netTestType string // Variable to hold the network test type
var rootCmd = &cobra.Command{
Use: "zurg",
@@ -33,9 +34,11 @@ func main() {
Use: "network-test",
Short: "Run a network test",
Run: func(cmd *cobra.Command, args []string) {
internal.NetworkTest()
internal.NetworkTest(netTestType) // Pass the network test type to NetworkTest
},
}
// Adding a flag for network test type with default value "both"
networkTestCmd.Flags().StringVarP(&netTestType, "type", "t", "both", "network test type (ipv4, ipv6, both)")
var clearDownloadsCmd = &cobra.Command{
Use: "clear-downloads",