Closed ricebus closed 6 years ago
Hi @ricebus
Not sure I follow entirely but all are optional by default.
You can specify required options using .Required()
when setting up the option.
If you have specified some options as required and they are not found in the specified args then p.Parse(args).HasErrors
will be true
Thanks for the quick reply.
I want to have args1 as Required only if option1 is set. and args2 required if option2 is set. I can put them all under optional but that's not the wanted functionality.
The only work around I found is to first check args[0] "manually" by myself and then to build a different fclp args class..
Unfortunately the library isn't quite that advanced as you've discovered. You'll have to use your workaround for the foreseeable future as the library would need a bit of work to support behaviour such as that.
Thanks for the quick reply 🤕
Hey,
Is there a way to have conditional params?
I want to be able to do something like myapp.exe option1 --arg1 .. --arg 2 (where arg1 is required for example) or myapp.exe option2 --arg3 .. --arg 4 (where arg3 is required for example)
Thanks in advance