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>
Maybe something like `-mode={if,od}` together with `-mode-arg=<string>` ?
(that probably won't work if the -mode-arg means wildly different things
for the two options)
-- Sean Silva
On Mon, Apr 4, 2016 at 12:05 PM, Daniel Dilts <diltsman at gmail.com>
wrote:
> 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/b66df6be/attachment.html>
by "won't work" I mean it may be pretty unintuitive. On Mon, Apr 4, 2016 at 12:12 PM, Sean Silva <chisophugis at gmail.com> wrote:> Maybe something like `-mode={if,od}` together with `-mode-arg=<string>` ? > (that probably won't work if the -mode-arg means wildly different things > for the two options) > > -- Sean Silva > > On Mon, Apr 4, 2016 at 12:05 PM, Daniel Dilts <diltsman at gmail.com> wrote: > >> 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/cb89bab5/attachment.html>