mirror of
https://github.com/chenasraf/massarg.git
synced 2026-05-18 01:39:05 +00:00
improve required message
This commit is contained in:
@@ -3,7 +3,11 @@ export class RequiredError extends Error {
|
||||
cmdName!: string
|
||||
|
||||
constructor(fieldName: string, cmdName: string) {
|
||||
super(`${fieldName} is required, but was not defined` + (cmdName !== "all" ? ` for ${cmdName}` : ""))
|
||||
super(
|
||||
`Option: \`${fieldName}\` is required${
|
||||
cmdName !== "all" ? ` for command: \`${cmdName}\`` : ""
|
||||
}, but was not defined. Try using: \`--${fieldName} {value}\``
|
||||
)
|
||||
this.fieldName = fieldName
|
||||
this.cmdName = cmdName
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user