[PATCH] [gdb/tui] Factor out border-mode help text

Bruno Larsen blarsen@redhat.com
Wed May 24 09:56:54 GMT 2023


On 22/05/2023 11:09, Tom de Vries via Gdb-patches wrote:
> On 5/21/23 21:59, Tom de Vries via Gdb-patches wrote:
>> I noticed that the help texts for tui border-mode and tui 
>> active-border-mode
>> are similar.
>>
>> Factor out the common part into macro HELP_ATTRIBUTE_MODE.
>>
>
> This is a v2, which uses c++ std::string instead of a macro.
>
> OTOH, it changes the translation boundaries, and I'm not sure if the 
> new parts still classify as "entire sentence".
>
> Then again, I was not able to find any files containing translations 
> for gdb, so perhaps it doesn't matter.
>
 > +  const std::string help_tui_border_mode
 > +    = (std::string ("\
 > +This variable controls the attributes to use for the window borders:\n")
 > +       + help_attribute_mode);

I think there is no need to explicitly call the std::string constructor 
here (at least compiling with gcc you don't). You could have it as:

  +  const std::string help_tui_border_mode
  +    = ("This variable controls the attributes to use for the window 
borders:\n"
  +       + help_attribute_mode);

Which makes it a bit clearer in my opinion.

Other than that (or if my suggestion isn't really feasible on all 
compilers/systems), looks ok to me:

Reviewed-By: Bruno Larsen <blarsen@redhat.com>

-- 
Cheers,
Bruno

> Thanks,
> - Tom



More information about the Gdb-patches mailing list