Skip to content

Commit 57199fd

Browse files
Match Node's exit code meanings
1 parent 78b71af commit 57199fd

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/cli/index.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,16 @@ import { VersionBumpOptions } from "../version-bump-options";
55
import { helpText } from "./help";
66
import { parseArgs } from "./parse-args";
77

8+
/**
9+
* @see https://nodejs.org/api/process.html#process_exit_codes
10+
*/
811
enum ExitCode {
912
Success = 0,
10-
SytaxError = 1,
11-
RuntimeError = 2,
13+
FatalError = 1,
14+
InvalidArgument = 9,
1215
}
1316

17+
1418
/**
1519
* The main entry point of the CLI
1620
*
@@ -38,7 +42,7 @@ export async function main(args: string[]): Promise<void> {
3842
// There was an error parsing the command-line args
3943
console.error((error as Error).message);
4044
console.error(helpText);
41-
process.exit(ExitCode.SytaxError);
45+
process.exit(ExitCode.InvalidArgument);
4246
}
4347
}
4448

0 commit comments

Comments
 (0)