-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Custom Help Formatting Papercuts #897
Comments
For context: |
I've been contemplating adding something similar to this for args to allow a short version of the help and a longer one. This would probably fit nicely with what you're requesting. One question though, why a list of paras instead of a single blob of text which could include its own paras? Aside: you could use |
The paragraphs might be unnecessary if the text wrapper is paragraph aware. |
This should be closed with v2.23 that was just released |
I just saw that you added If you pass Instead what I am looking for is that a) |
@mitsuhiko in that case, if you don't use |
Bit then it shows thevlong help texts in the subcommand list which is what
I do not want.
Regards,
Armin
…On Sun, Apr 9, 2017 at 11:23 Kevin K. ***@***.***> wrote:
@mitsuhiko <https://github.com/mitsuhiko> in that case, if you don't use
about and *only* use long_about, it should do what you'r elooking for.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#897 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAc5ImhtACbTL2WJ8jZvc7kQ41TxK_bks5ruSIVgaJpZM4MajRk>
.
|
Ah ok, I misunderstood. Then using templates is probably the best way. let TEMPLATE = "\
\
{bin} {version}
{author}
{about}
USAGE:{usage}
EXPLAINATIONS:
{after-help}
FLAGS:
{flags}
OPTIONS:
{options}
ARGS:
{positionals}";
App::new("my-subcommand")
.about("Does something")
.template(TEMPLATE)
.after_help("paragraph 1 with some text \n\nparagraph 2 with some text"); |
That's a massive amount of work though and scales badly with large number
of subcommands. Also requires to customize the template manually depending
on the configuration of the command.
I am aware of that option and I decided against it which is why I opened
this ticket.
Regards,
Armin
…On Sun, Apr 9, 2017 at 11:34 Kevin K. ***@***.***> wrote:
Ah ok, I misunderstood. Then using templates is probably the best way.
let TEMPLATE = "\\{bin} {version}{author}{about}USAGE:{usage}EXPLAINATIONS:{after-help}FLAGS:{flags}"
OPTIONS:
{options}
ARGS:
{positionals}";App::new("my-subcommand") .about("Does something") .template(TEMPLATE) .after_help("paragraph 1 with some text \n\nparagraph 2 with some text");
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#897 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAc5HIaY2ohRepC_4H9xCImeaosdfuKks5ruSShgaJpZM4MajRk>
.
|
Understood. I've re-opened this issue in order to find a better solution. Thanks for the clear up! |
I also encountered this problem. I expected that
For example, suppose we have a command
and
Also, if the In my opinion, such behavior aligns with the intuition why short and longs about texts are really necessary and how they work, and it also allows one to follow the style of full stops usage, when in short abouts there is no ending dot, while keeping the "narrative" format of the long abouts with proper punctuation. Currently, if long about is configured together with the short about, it is also used for the subcommands descriptions, and not used for the main description text, which seems quite counterintuitive to me. |
I think the argument can be made that |
This is some ideas that would make the usability of custom help pages significantly better. Currently the problems mostly involve subcommands.
Subcommand Name in Help Page
Currently if you have a binary like
foo-bar
and a subcommd namedblub-blah
the help page always formats the first line asfoo-bar-blub-blah
. There is no option to make it show up asfoo-bar blub-blah
which makes a lot more sense for many applications.Longer version of
about()
Currently for the main command one can use
about()
to inject longer text (somewhat, rewrapping does come up as an issue) howeverabout()
is used for subcommands in the listing so that cannot get too large.Would it be possible to introduce a new
explanation()
command that accepts a list of "paragraphs" that are rendered afterUSAGE
but beforeOPTIONS
? Eg:Each paragraph itself would be rewrapped and a double newline inserted between paragraphs. Embedded newlines within a paragraph would most likely have to be preserved. Not sure if there is already support for this sort of stuff.
The text was updated successfully, but these errors were encountered: