Skip to content

Commit

Permalink
feat(args): add name to context of Args.unavailableArgument (#171)
Browse files Browse the repository at this point in the history
  • Loading branch information
favna committed Feb 7, 2021
1 parent b64c703 commit a5bda61
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib/parsers/Args.ts
Original file line number Diff line number Diff line change
Expand Up @@ -628,10 +628,12 @@ export class Args {
}

protected unavailableArgument<T>(type: string | IArgument<T>) {
const name = typeof type === 'string' ? type : type.name;
return err(
new UserError({
identifier: Identifiers.ArgsUnavailable,
message: `The argument "${typeof type === 'string' ? type : type.name}" was not found.`
message: `The argument "${name}" was not found.`,
context: { name }
})
);
}
Expand Down

0 comments on commit a5bda61

Please sign in to comment.