Skip to content

Commit 654b85a

Browse files
committed
improve required message
1 parent aa595f8 commit 654b85a

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/errors.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ export class RequiredError extends Error {
33
cmdName!: string
44

55
constructor(fieldName: string, cmdName: string) {
6-
super(`${fieldName} is required, but was not defined` + (cmdName !== "all" ? ` for ${cmdName}` : ""))
6+
super(
7+
`Option: \`${fieldName}\` is required${
8+
cmdName !== "all" ? ` for command: \`${cmdName}\`` : ""
9+
}, but was not defined. Try using: \`--${fieldName} {value}\``
10+
)
711
this.fieldName = fieldName
812
this.cmdName = cmdName
913
}

0 commit comments

Comments
 (0)