« get me outta code hell

update old process.argv checks to use parseOptions - mtui - Music Text User Interface - user-friendly command line music player
about summary refs log tree commit diff
path: root/index.js
diff options
context:
space:
mode:
authorFlorrie <towerofnix@gmail.com>2020-07-10 11:25:59 -0300
committerFlorrie <towerofnix@gmail.com>2020-07-10 11:30:13 -0300
commit8927fb3f3ef9a3d641cf607a756b8815f06c57e2 (patch)
treed40fbcacd6ab21e9ea9204d7cb0457758ad7fb97 /index.js
parent7ea3291db7dd2de13e9f07005e83524711f086af (diff)
update old process.argv checks to use parseOptions
Diffstat (limited to 'index.js')
-rwxr-xr-xindex.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/index.js b/index.js
index f0cd4e3..444d579 100755
--- a/index.js
+++ b/index.js
@@ -65,9 +65,9 @@ async function main() {
         }
       }
     },
-    'player-options': {
-      type: 'series'
-    },
+    'player-options': {type: 'series'},
+    'stress-test': {type: 'flag'},
+    'telnet-server': {type: 'flag'},
     [parseOptions.handleDashless](option) {
       playlistSources.push(option)
     }
@@ -132,13 +132,13 @@ async function main() {
   const loadPlaylistPromise = loadPlaylists()
 
   let telnetServer
-  if (process.argv.includes('--telnet-server')) {
+  if (options['telnet-server']) {
     telnetServer = new TelnetServer(backend)
     await telnetServer.listen(1244)
     appElement.attachAsServerHost(telnetServer)
   }
 
-  if (process.argv.includes('--stress-test')) {
+  if (options['stress-test']) {
     await loadPlaylistPromise
 
     const w = 80