]> njoseph.me Git - nimcoon.git/blobdiff - src/nimcoon.nim
YouTube auto-play
[nimcoon.git] / src / nimcoon.nim
index 3ad8fdca67fe4741798a3144acfe3af551b48d7e..9df18a8053dbf521956ff6e23b9e749938e03c86 100644 (file)
@@ -19,9 +19,11 @@ proc parseArguments(): CommandLineOptions =
       "feelingLucky": false,
       "fullScreen": false,
       "download": false,
-      "non-interactive": false
+      "nonInteractive": false,
+      "autoPlay": false
     })
 
+  # Non-interactive/Global options
   for kind, key, value in getopt():
     case kind
     of cmdArgument:
@@ -32,7 +34,8 @@ proc parseArguments(): CommandLineOptions =
       of "l", "lucky": options["feelingLucky"] = true
       of "f", "full-screen": options["fullScreen"] = true
       of "d", "download": options["download"] = true
-      of "n", "non-interactive": options["non-interactive"] = true
+      of "n", "non-interactive": options["nonInteractive"] = true
+      of "a", "auto-play": options["autoPlay"] = true
     of cmdEnd: discard
 
   if searchQuery == "":
@@ -58,7 +61,7 @@ proc main() =
     quit(0)
 
   let searchResults = getSearchResults(searchQuery)
-  if options["non-interactive"]:
+  if options["nonInteractive"]:
     for index, (title, url) in searchResults:
       echo title
       echo url