« get me outta code hell

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:
Diffstat (limited to 'index.js')
-rwxr-xr-xindex.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/index.js b/index.js
index 6e83e8a..d628a20 100755
--- a/index.js
+++ b/index.js
@@ -75,6 +75,7 @@ async function main() {
     'player-options': {type: 'series'},
     'stress-test': {type: 'flag'},
     'socket-client': {type: 'value'},
+    'socket-name': {type: 'value'},
     'socket-server': {type: 'value'},
     'telnet-server': {type: 'flag'},
     [parseOptions.handleDashless](option) {
@@ -170,6 +171,12 @@ async function main() {
     attachBackendToSocketClient(backend, socketClient, {
       getPlaylistSources: () => appElement.playlistSources
     })
+
+    let nickname = process.env.USER
+    if (options['socket-name']) {
+      nickname = options['socket-name']
+    }
+    socketClient.setNickname(nickname)
   }
 
   if (options['stress-test']) {