Skip to content

Commit b6fd766

Browse files
authored
fix: options -h and --help return exit code 1 (#170)
1 parent 51bc397 commit b6fd766

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

bin/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,22 +265,22 @@ async function getCommandLineOptions(
265265
};
266266
}
267267

268-
function logHelpAndExit() {
268+
function logHelpAndExit(code: number = 0) {
269269
const help = commandLineUsage(usageDefinitions);
270270
console.log(help);
271-
process.exit(1);
271+
process.exit(code);
272272
}
273273

274274
function logMissingArgAndExit(arg: string): void {
275275
console.log(`\nMissing argument: -${arg}\n`);
276-
logHelpAndExit();
276+
logHelpAndExit(1);
277277
}
278278

279279
function logMissingAuthAndExit(): void {
280280
console.log(
281281
'\nInvalid authentication arguments: please provide either a user and password, or a clientId and clientSecret\n'
282282
);
283-
logHelpAndExit();
283+
logHelpAndExit(1);
284284
}
285285

286286
function normalizeDirectory(directory: string): string {

0 commit comments

Comments
 (0)