Re: [PATCH] column: Fix an incorrect parse of the 'nodense' option token

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Feb 12, 2012 at 1:41 AM, Ramsay Jones
<ramsay@xxxxxxxxxxxxxxxxxxx> wrote:
>
> The parse_option() function always saw the 'nodense' token as
> 'dense', since it stripped the 'no' off the input argument string
> earlier when checking for the presence of the 'color' token.
>
> In order to fix the parse, we use local variables (within the loop)
> initialised to the function input arguments instead, which allows
> each token check to be independent.
>
> Also, add some 'nodense' tests to t/t9002-column.sh.
>
> Signed-off-by: Ramsay Jones <ramsay@xxxxxxxxxxxxxxxxxxx>

Acked-by: Nguyen Thai Ngoc Duy <pclouds@xxxxxxxxx>


> Note that the code supports the 'nocolor' token, but it is not documented
> in config.txt.
>
> If I understand correctly (and it's quite possible that I don't!), the
> 'nodense' token has the same meaning as the absence of the 'dense' token
> (and I assume a similar comment applies to the '[no]color' tokens). If that
> is the case, then maybe a better solution would be to simply remove the
> 'nodense' and 'nocolor' tokens. I will leave it to you to decide which
> solution is more appropriate.

It's about overriding config. If you set "dense" by default in
column.ui but do not want it in this particular run, you can say
--column=nodense.

The [no]color is for plumbing only. If a command produces colored
output, "color" is required to calculate text length correctly.
Overriding it with "nocolor" would break the layout badly so it's no
use there. It does not make sense (to me) for users to put "color" in
column.ui. Which is why it's not mentioned in document.
-- 
Duy
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]