未验证 提交 80b2d948 编写于 作者: A Asher

Don't display stack trace for cli parse failures

Just display the error message and exit. The stack trace isn't necessary
(since it's likely user error) and is potentially confusing.
上级 0e2eaa9b
......@@ -87,7 +87,16 @@ const main = async (args: Args): Promise<void> => {
}
}
const args = parse(process.argv.slice(2))
const tryParse = (): Args => {
try {
return parse(process.argv.slice(2))
} catch (error) {
console.error(error.message)
process.exit(1)
}
}
const args = tryParse()
if (args.help) {
console.log("code-server", require("../../package.json").version)
console.log("")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册