With the CommandLine library, is there a way to specify that one of two options must be present? I have two parameters, -if and -od. I want an error if neither is present or if both are present. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160404/dbae63e0/attachment.html>
Could you do something like `-mode={if,od}` and make the option required? -- Sean Silva On Mon, Apr 4, 2016 at 11:54 AM, Daniel Dilts via llvm-dev < llvm-dev at lists.llvm.org> wrote:> With the CommandLine library, is there a way to specify that one of two > options must be present? > > I have two parameters, -if and -od. I want an error if neither is present > or if both are present. > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160404/2cb2b3be/attachment.html>
Both arguments require a string. Sorry, I forgot to mention that. On Mon, Apr 4, 2016 at 12:02 PM, Sean Silva <chisophugis at gmail.com> wrote:> Could you do something like `-mode={if,od}` and make the option required? > > -- Sean Silva > > On Mon, Apr 4, 2016 at 11:54 AM, Daniel Dilts via llvm-dev < > llvm-dev at lists.llvm.org> wrote: > >> With the CommandLine library, is there a way to specify that one of two >> options must be present? >> >> I have two parameters, -if and -od. I want an error if neither is >> present or if both are present. >> >> _______________________________________________ >> LLVM Developers mailing list >> llvm-dev at lists.llvm.org >> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >> >> >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160404/3ceabe72/attachment.html>