-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce DESCRIPTION_MORE attribute #378
Conversation
35355fe
to
e4cb7db
Compare
1 similar comment
56a816b
to
7bd9e77
Compare
Closing this one as I'm not happy with how paragraphs and wrapping are handled. |
7bd9e77
to
76e8e22
Compare
We've been using this change in production for about three weeks now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs a few cosmetic changes to support Python 2.
plumbum/cli/application.py
Outdated
# Add to current paragraph | ||
paragraph = paragraph + ' ' + line | ||
|
||
yield from current() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your production must not use Python 2 (must be nice...). This yield from
should be very easy to convert to:
for item in current()
yield item
Since it is an iterator and not a generator.
plumbum/cli/application.py
Outdated
|
||
if len(line) == 0: | ||
# Starting a new paragraph | ||
yield from current() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here as below.
941b9ee
to
b738842
Compare
Thanks, henryiii... |
This change adds a new attribute to be printed between DESCRIPTION and USAGE.
Paragraphs are determined by empty lines inside DESCRIPTION_MORE. Paragraph indentations are preserved and lines are wrapped. Additionally, extra spaces are removed from text.
Instead of relying on a general purpose markup language package, this change brings a minor markup feature: It recognizes lists from their first character so that the whole list does not become one large paragraph. * and - are visible bullet characters and appear as such:
/ is bullet as well, but it is not printed on the output. This:
becomes this: