<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_extra"><div class="gmail_quote">[<div class="gmail_default" style="font-family:arial,helvetica,sans-serif;display:inline">​snip all, another issue, unrelated to the lsunit one]​</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><span class=""><div data-smartmail="gmail_signature"><div dir="ltr"><div></div></div></div>
</span></div></div>
</blockquote></div><div class="gmail_quote"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;display:inline"><br></div></div><div class="gmail_quote"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">​I realised one small glitch with conflicts watching in the code in combination with flags. It is not regression, I think, because b​efore now, it was not possible to do something like -l internal=0,logdev=something, but now it should be possible.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">The code checks only whether an option was seen, not its value, so it does't know that we are in fact disabling something. I see two ways how to do solve it. One is a custom conflict solving for these cases, putting some if (flag1 && option2) somewhere once every argument and option is parsed. But this goes against what the patchset did and moves it again out of the option table...</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">The other way is to make a special case for flags in the conflicts-handling code. Basically, I would extend the structure with something like:</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><div class="gmail_default">{ .index = L_INTERNAL,</div><div class="gmail_default">  .conflicts = { L_FILE,</div><div class="gmail_default">        L_DEV,</div><div class="gmail_default">        LAST_CONFLICT },</div><div class="gmail_default">  .conflicts_ignore_on_false=true, // new item, shorter name to be found<br></div><div class="gmail_default">  .minval = 0,</div><div class="gmail_default">  .maxval = 1,</div><div class="gmail_default">  .defaultval = 1,</div><div class="gmail_default">},</div><div class="gmail_default"><br></div><div class="gmail_default">And then, if a conflict is found, it checks the value and if the value is false/zero, then ignore the conflict. A more generic code would allow for any given value, but I think that this would be useful only for flags, so "on_false" and possibly "on_true" would be enough.</div></div></div><div class="gmail_quote"><br><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">​Any comments?</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Thanks,</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Jan​</div><br></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Jan Tulak<br></div><a href="mailto:jtulak@redhat.com" target="_blank">jtulak@redhat.com</a> / <a href="mailto:jan@tulak.me" target="_blank">jan@tulak.me</a></div></div></div></div>
</div></div>