Subject: Re: [PATCH V2 iproute2 1/3] devlink: Add helper for left justification print

From: Jiri Pirko <[email-masked]>
Date: Wed, 2 Oct 2019 19:14:55 +0200

Wed, Oct 02, 2019 at 04:48:04PM CEST, [email-masked] wrote:
>On Wed,  2 Oct 2019 17:35:14 +0300
>Tariq Toukan <[email-masked]> wrote:
>
>>  static void pr_out_str(struct dl *dl, const char *name, const char *val)
>>  {
>> -	if (dl->json_output) {
>> +	__pr_out_indent_newline(dl);
>> +	if (dl->json_output)
>>  		jsonw_string_field(dl->jw, name, val);
>> -	} else {
>> -		if (g_indent_newline)
>> -			pr_out("%s %s", name, val);
>> -		else
>> -			pr_out(" %s %s", name, val);
>> -	}
>> +	else
>> +		pr_out("%s %s", name, val)
>
>Overall this looks like an improvement.
>
>Why doesn't devlink already use existing json_print infrastructure?

It will happen soon hopefully. I have it on the todo list and hopefully
also a person to do it :)