[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260110110757.6dde2d45@kernel.org>
Date: Sat, 10 Jan 2026 11:07:57 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Stanislav Fomichev <stfomichev@...il.com>
Cc: davem@...emloft.net, netdev@...r.kernel.org, edumazet@...gle.com,
pabeni@...hat.com, andrew+netdev@...n.ch, horms@...nel.org,
donald.hunter@...il.com, gal@...dia.com
Subject: Re: [PATCH net-next 2/7] tools: ynl: cli: wrap the doc text if it's
long
On Sat, 10 Jan 2026 11:04:08 -0800 Stanislav Fomichev wrote:
> > @@ -101,7 +102,14 @@ RELATIVE_SCHEMA_DIR='../../../../Documentation/netlink'
> > attr_info += f" -> {nested_set_name}"
> >
> > if attr.yaml.get('doc'):
> > - doc_text = textwrap.indent(attr.yaml['doc'], prefix + ' ')
> > + doc_prefix = prefix + ' ' * 4
> > + 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..
Powered by blists - more mailing lists