diff --git a/jslib b/jslib index 802d38f52e..a1823f9931 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit 802d38f52e9794567179b9bd9ffc475ceb31323f +Subproject commit a1823f9931173b982fee10ba4cb84c0ee5078fc3 diff --git a/src/program.ts b/src/program.ts index c440b1ed66..fde3d5628b 100644 --- a/src/program.ts +++ b/src/program.ts @@ -68,8 +68,8 @@ export class Program extends BaseProgram { }); program.on('command:*', () => { - writeLn(chalk.redBright('Invalid command: ' + program.args.join(' '))); - writeLn('See --help for a list of available commands.', true); + writeLn(chalk.redBright('Invalid command: ' + program.args.join(' ')), false, true); + writeLn('See --help for a list of available commands.', true, true); process.exitCode = 1; }); diff --git a/src/utils.ts b/src/utils.ts index 44d2520668..3124f6efc5 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -8,11 +8,12 @@ import { FolderView } from 'jslib/models/view/folderView'; import { NodeUtils } from 'jslib/misc/nodeUtils'; export class CliUtils { - static writeLn(s: string, finalLine: boolean = false) { + static writeLn(s: string, finalLine: boolean = false, error: boolean = false) { + const stream = error ? process.stderr : process.stdout; if (finalLine && process.platform === 'win32') { - process.stdout.write(s); + stream.write(s); } else { - process.stdout.write(s + '\n'); + stream.write(s + '\n'); } }