Subject: Re: [PATCH net-next 2/7] tools: ynl: cli: wrap the doc text if it's long

From: Jakub Kicinski <[email-masked]>
Date: Sat, 10 Jan 2026 15:26:58 -0800

On Sat, 10 Jan 2026 11:07:57 -0800 Jakub Kicinski wrote:
> > > +                if sys.stdout.isatty():
> > > +                    term_width = shutil.get_terminal_size().columns
> > > +                else:
> > > +                    term_width = 80
> > > +                doc_text = textwrap.fill(attr.yaml['doc'], width=term_width,
> > > +                                         initial_indent=doc_prefix,
> > > +                                         subsequent_indent=doc_prefix)    
> > 
> > Any specific reason you wrap to 80 for !isatty?  
> 
> not really, just the default width of a classic terminal
> the textwrap library defaults to 70 which is another option tho
> I doubt there's a strong reason behind that value either..

Experimenting with this a little bit more it looks like shutil does the
right thing and returns 80 if not sys.stdout.isatty() Let me respin v2
with the condition removed.
-- 
pw-bot: cr