« get me outta code hell

http-music - Command-line music player + utils (not a server!)
about summary refs log tree commit diff
path: root/src/play.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/play.js')
-rwxr-xr-xsrc/play.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/play.js b/src/play.js
index 2e47fba..0ffe996 100755
--- a/src/play.js
+++ b/src/play.js
@@ -22,6 +22,7 @@ readFile('./playlist.json', 'utf-8')
     let curPlaylist = playlist
 
     let pickerType = 'shuffle'
+    let playOpts = []
 
     // WILL play says whether the user has forced playback via an argument.
     // SHOULD play says whether the program has automatically decided to play
@@ -139,6 +140,13 @@ readFile('./playlist.json', 'utf-8')
         pickerType = util.nextArg()
       },
 
+      '-play-opts': function(util) {
+        // --play-opts <opts>
+        // Sets command line options passed to the `play` command.
+
+        playOpts = util.nextArg().split(' ')
+      },
+
       '-debug-list': function(util) {
         // --debug-list
         // Prints out the JSON representation of the active playlist.
@@ -159,7 +167,7 @@ readFile('./playlist.json', 'utf-8')
         console.error("Invalid picker type: " + pickerType)
       }
 
-      return loopPlay(picker)
+      return loopPlay(picker, playOpts)
     } else {
       return curPlaylist
     }