Open capripot opened 2 years ago
I would suggest to remove "required" flag from Parser and Banner, rather then having required option. If option is required, that means, that it is not an option, but argument.
I agree, I was also confused by having to write option :flag, required: false
but wouldn't it be a breaking change? π
From @IvanShamatov :
If option is required, that means, that it is not an option, but argument.
Could we imagine options as keyword arguments? Sometimes it makes more sense to name the arguments rather than having nameless positional arguments. And keyword arguments used to be an "options Hash" but now can be required or not.
I would leave the option to the developer to choose the style they like the best. What do you think?
@capripot Sure, I understand the concept of keyword arguments, I just can't remember any cli utility with that kind of required option in a wild. Do you have any examples?
Anyway, I don't see why we can't have it. I will talk to the team to ask their opinion on that. Thank you for the contribution
@IvanShamatov Do you think we could merge this? βΊοΈ π
Hi @capripot, thank you so much for your patience here. I've started looking at this, as you might notice from the few small commits I've pushed. I'll look to get it ready to merge over the coming week, and will let you know if I have any questions for you.
required: true
is accepted and implemented byOption
, but not used byParser
orBanner
. This PR implements the enforcement of it and surface it to the help banner.Checks: