Closed Codpoe closed 3 years ago
@Codpoe, why this issue is closed? I've faced with this problem too.
@0x009922 In the case I mentioned above, if my usage is:
create --template
It will throw an error. That is, if you write a argument name but don’t include a value, it will report an error. And I think it was the right thing to do, so I closed the issue.
But on the whole, I think it would be better if cac
could support something like requiredOption
in commander
. Maybe like this:
cli
.command('create [dir]')
.option('--template <template>', { required: true });
@Codpoe, I agree with you about requiredOption
, it look's like really missing feature.
Issue Type
Expected
If I didn't pass the
template
, it should throw an error like:option "template" value is missing
.Actual
No error, continue to execute
Possible Solutions
Command.ts
-checkOptionValue
Info