X-Git-Url: https://njoseph.me/gitweb/nimcoon.git/blobdiff_plain/d36e22010231d8bd139b906fc66e060575decb2d..25f5a0342dbd064790637fc5c05d8058d4da25f2:/src/nimcoon.nim diff --git a/src/nimcoon.nim b/src/nimcoon.nim index 1bb0b74..3844d40 100644 --- a/src/nimcoon.nim +++ b/src/nimcoon.nim @@ -25,17 +25,17 @@ proc parseArguments(): CommandLineOptions = of "d", "download": options["download"] = true of cmdEnd: discard - return (searchQuery, options) + (searchQuery, options) proc isValidOptions*(options: Options): bool = # Check for invalid combinations of options var invalidCombinations = [("musicOnly", "fullScreen"), ("download", "fullScreen")] + result = true for combination in invalidCombinations: if options[combination[0]] and options[combination[1]]: stderr.writeLine fmt"Incompatible options provided: {combination[0]} and {combination[1]}" - return false - return true + result = false proc main() = let @@ -45,7 +45,7 @@ proc main() = if(not isValidOptions(options)): quit(1) - if searchQuery.startswith("https:") or searchQuery.startswith("magnet:"): + if searchQuery.startswith("http") or searchQuery.startswith("magnet"): if options["download"]: directDownload(sanitizeURL(searchQuery), options["musicOnly"]) else: