<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><span style="font-family:arial,sans-serif">On Sat, Jun 4, 2016 at 2:32 AM, Dave Chinner </span><span dir="ltr" style="font-family:arial,sans-serif"><<a href="mailto:david@fromorbit.com" target="_blank">david@fromorbit.com</a>></span><span style="font-family:arial,sans-serif"> wrote:</span><br></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Fri, Jun 03, 2016 at 02:09:19PM +0200, Jan Tulak wrote:<br>
> [<br>
> ​snip all, another issue, unrelated to the lsunit one]​<br>
><br>
> ><br>
> ​I realised one small glitch with conflicts watching in the code in<br>
> combination with flags. It is not regression, I think, because b​efore now,<br>
> it was not possible to do something like -l internal=0,logdev=something,<br>
> but now it should be possible.<br>
<br>
</span>I think that overly complicates things. My original intent for this<br>
work was to simplify the interface and code, not make it more<br>
elaborate to support configurations that are theoretically possible<br>
but completely redundant.<br>
<br>
i.e. '-l internal=0,logdev=something' is identical in function to<br>
'-l logdev=something', so there is no need to specify internal=0.<br>
AFAICT, therxp eis never a need to specify '-l internal=[0|1]'<br>
because if '-l logdev=<foo>' is specified, it implies an external<br>
log is being configured, and in every other case the log is<br>
internal.<br>
<span class=""><br>
> The code checks only whether an option was seen, not its value, so it<br>
> does't know that we are in fact disabling something. I see two ways how to<br>
> do solve it. One is a custom conflict solving for these cases, putting some<br>
> if (flag1 && option2) somewhere once every argument and option is parsed.<br>
> But this goes against what the patchset did and moves it again out of the<br>
> option table...<br>
><br>
> The other way is to make a special case for flags in the conflicts-handling<br>
> code. Basically, I would extend the structure with something like:<br>
><br>
> { .index = L_INTERNAL,<br>
>   .conflicts = { L_FILE,<br>
>         L_DEV,<br>
>         LAST_CONFLICT },<br>
>   .conflicts_ignore_on_false=true, // new item, shorter name to be found<br>
<br>
</span>What happens when you have two conflicts, on which you want to<br>
ignore on false, the other you want to ignore on true?  And where do<br>
you draw the line? L_SU vs L_SUNIT conflict and throw an error only<br>
when the values differ?<br>
<div class="HOEnZb"><div class="im trimless-h5 trimless-content"><br></div></div></blockquote><div><br></div><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;display:inline">​Yeah, that's true... let's call it feature then.</div></div><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;display:inline"><br></div></div><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;display:inline">Cheers,</div></div><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;display:inline">Jan​</div> </div></div><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>