[CRIU] [PATCH] crit: enable --pretty by default

Christopher Covington cov at codeaurora.org
Tue Jul 21 14:28:19 PDT 2015


On 07/21/2015 02:32 PM, Tycho Andersen wrote:
> On Tue, Jul 21, 2015 at 09:17:20PM +0300, Ruslan Kuprieiev wrote:
>>
>>
>> On 07/21/2015 09:06 PM, Tycho Andersen wrote:
>>> On Tue, Jul 21, 2015 at 08:57:26PM +0300, Ruslan Kuprieiev wrote:
>>>> Hi Tycho,
>>>>
>>>> We did that on purpose, as we thought that crit should be used in various
>>>> scripts and they might be not happy with --pretty option, as it does some
>>>> unusual transformations with data(i.e. int to string in hex) which scripts
>>>> might be not happy about, as they use json tools(i.e. they might expect int
>>>> but get string in hex format).
>>>>
>>>> I'm not sure that we should enable it always by default.
>>>> That being said, I believe we used to have "pretty for stdout by default"
>>>> behavior and I can't remember why it is gone. Though, we might
>>>> think of resurrecting it.
>>> You mean "pretty when stdout is a terminal"?
>>
>> Well, we used to do that in a lazy way, just checking if -o option is not
>> specified. =)
>> But your way sounds a lot better=).
>>
>>> That sounds ok with me,
>>> all I'm trying to do is avoid having to type --pretty when I use crit
>>> to inspect the images :)
>>>
>>> I know this will break things, but I was hoping it might be early
>>> enough in the lifetime that there weren't a lot of scripts around that
>>> depend on it.
>>
>> To be honest, I haven't heard about none of those scripts =).
>> Maybe you're right and it is still early enough indeed.
>>
>> But maybe the best way to solve it would be to combine both ideas described
>> above.
>> Add "pretty when stdout is a terminal" and add --no-pretty to force
>> non-pretty
>> output even for terminal.
>> What do you think?
> 
> I think my #1 would be to just take this patch and break things
> for people, #2 would be to do some sort of fancy detection, but I
> guess this is why we have Pavel :)

Would such an implementation mean piping to less could change the output
format? If so, that's not a behavior I would expect or be pleased to discover.

Chris

-- 
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


More information about the CRIU mailing list