The CLI help message (--help) doesn't keep the original format
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
oslo.config |
Confirmed
|
Wishlist
|
Unassigned |
Bug Description
When I create a CLI config option which provides a help text with line
breaks, these line breaks won't get used in the printed help message.
Steps to reproduce
==================
* Create a CLI option which has line breaks in its help text:
from oslo_config import cfg
example_opt = cfg.IntOpt(
Here is a long description of this example opt which explains this
more in detail.
A list which explains things:
* item 1
* item 2""")
* Register this CLI opt:
cfg.
* Let the service which uses this CLI option print its help:
my-service --help
Expected output
===============
--example_
This is an example opt.
Here is a long description of this example opt which explains this
more in detail.
A list which explains things:
* item 1
* item 2
Actual output
=============
--example_
This is an example opt. Here is a long description of this example
opt which explains this more in detail. A list which explains
things: * item 1 * item 2
Version
=======
* seen in oslo.config version 2.6.0
* NOT double-checked in master code
Notes
=====
I'm using the help extensively in a Nova blueprint [1] and it would be
nice to keep the preformatted text.
References
==========
[1] https:/
Changed in oslo.config: | |
status: | New → Confirmed |
seems a big demand.
because oslo.config depends on argparse, including help formatter,
maybe we can push argparse project to add a formatter meet this requirement.