Allow custom url

This commit is contained in:
Ben Adrian Sarmiento
2024-06-16 21:11:40 +02:00
parent e5bb026f87
commit f2331c6a2e
4 changed files with 20 additions and 7 deletions

View File

@@ -10,6 +10,7 @@ import (
func main() {
var configPath string // Variable to hold the config path
var testURL string // Variable to hold the download URL
var rootCmd = &cobra.Command{
Use: "zurg",
@@ -49,10 +50,13 @@ func main() {
Use: "network-test",
Short: "Test your network with RD servers",
Run: func(cmd *cobra.Command, args []string) {
internal.NetworkTest()
internal.NetworkTest(testURL) // Pass the downloadURL to NetworkTest
},
}
// Adding a flag for the test URL with a default value
networkTestCmd.Flags().StringVarP(&testURL, "test-url", "t", "", "URL to test network with")
rootCmd.AddCommand(versionCmd, clearDownloadsCmd, clearTorrentsCmd, networkTestCmd)
if err := rootCmd.Execute(); err != nil {