« get me outta code hell

Help message - 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:
authorliam4 <towerofnix@gmail.com>2017-06-08 10:19:59 -0300
committerliam4 <towerofnix@gmail.com>2017-06-08 10:19:59 -0300
commit24ecef20156985f543362cdb77df027bfe49f536 (patch)
tree507c77ae7e96cca0af31a53b32ff20cf6c4173ca /src/play.js
parentc8d6f1697bb814ed27386dda81ddc0a0a95d46f3 (diff)
Help message
Diffstat (limited to 'src/play.js')
-rwxr-xr-xsrc/play.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/play.js b/src/play.js
index 7023d9f..fee1b79 100755
--- a/src/play.js
+++ b/src/play.js
@@ -48,6 +48,20 @@ setupDefaultPlaylist('./playlist.json')
     }
 
     await processArgv(process.argv, {
+      '-help': function(util) {
+        // --help  (alias: -h, -?)
+        // Presents a help message.
+
+        console.log('http-music\nTry man http-music!')
+
+        if (util.index === util.argv.length - 1) {
+          shouldPlay = false
+        }
+      },
+
+      'h': util => util.alias('-help'),
+      '?': util => util.alias('-help'),
+
       '-open': async function(util) {
         // --open <file>  (alias: -o)
         // Opens a separate playlist file.