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.
This commit is contained in:
parent
0e2eaa9b34
commit
80b2d9481f
@ -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("")
|
||||
|
Reference in New Issue
Block a user