From 14f825cb51916a41929a46439434c445b3e46fd4 Mon Sep 17 00:00:00 2001 From: Philipp Dieter Date: Sat, 28 Aug 2021 18:15:22 +0200 Subject: [PATCH] Add option to set prompt for server --- server.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server.js b/server.js index 456ec1e..b709719 100755 --- a/server.js +++ b/server.js @@ -5,6 +5,7 @@ const repl = require('repl'); const DEFAULT_HOST = "localhost"; const DEFAULT_PORT = 3456; +const DEFAULT_PROMPT = "> "; const CRed = "\x1b[31m"; const CYellow = "\x1b[33m"; @@ -135,7 +136,7 @@ const startServer = (options) => { }) // Start a node repl - const r = repl.start({prompt: "> "}); + const r = repl.start({prompt: options.prompt}); r.defineCommand('show', { help: '[TERMLOG] Select log levels to display (info | log | warning | error | debug). Multiple levels are seperated by `,`', action(arg) { @@ -171,6 +172,9 @@ Options: --out arg Save output to file +--primpt arg + Sets promt, "" to disable + --show args Select log levels to display (info | log | warning | error | debug). Multiple levels are seperated by \`,\` @@ -183,6 +187,7 @@ Options: port: DEFAULT_PORT, host:DEFAULT_HOST, show: LOGLEVELS, + prompt: DEFAULT_PROMPT, ...args }