Skip to content

Commit 8fe7fad

Browse files
Added explicit error messages for arguments that are missing their value
1 parent 94ae016 commit 8fe7fad

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/cli/parse-args.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@ export function parseArgs(argv: string[]): ParsedArgs {
3333
{ argv }
3434
);
3535

36+
if (args.token === null) {
37+
throw new SyntaxError("The --token argument requires a value");
38+
}
39+
40+
if (args.registry === null) {
41+
throw new SyntaxError("The --registry argument requires a value");
42+
}
43+
3644
let parsedArgs: ParsedArgs = {
3745
help: args.help as boolean,
3846
version: args.version as boolean,

0 commit comments

Comments
 (0)