-
Notifications
You must be signed in to change notification settings - Fork 152
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
Subcommands should default to inheriting the top-level author
value
#172
Comments
A PR forwarding the author to the subcommand will be accepted. Technically that's a breaking change, but it also look a bit like a bug, thus I'm not sure a major release is needed. |
To be honest, I'm not sure I can make time to familiarize myself with the StructOpt codebase to the degree necessary to write such a PR. How much complexity would you say is involved? ...not to mention that I just realized that a fix is significantly less useful to me than I thought, because I also need to work around a couple of other issues that are Clap's fault (clap-rs/clap#1432, clap-rs/clap#1184), and an " The most concise way to work around all the problems I've identified would just be to support inheriting the (The custom template solves the author problem by omitting |
I dont really know, if no refactoring is needed, quie simple, but it may need some refactoring. Thé issue express a need with a solution. If anyone is interested, he can implement it. If you want to work on it, express it on the issue. You don't need to do it. |
Isn't is solved by #229? |
Changing the default solves it for my I'll try to test the new version and get back to you on it more definitively within the next little while. Looking back at my old comments, it looks like there's more to it than just that. (eg. The " |
@ssokolow About |
As we are now in sync with clap philosophy on this issue, I propose to close it if there is no objection. |
Yeah, that works for ColoredHelp. The last week has been a mess for me and I can never remember the syntax for pulling a dependency from a non-crates.io source. Mind pasting what I need to toss in my Cargo.toml to verify whether #229 plus (I suspect that I'll wind up still having to duplicate |
structopt = { git = "https://..." } On mobile, so by memory and not tested. |
cc @ssokolow , any updates? |
Sorry about that. Got blindsided by a nasty flu and I'm just starting to crawl out of that pit. I'll try to find time for this in the next few days. |
OK. Here are my results. With the current HEAD (e0f74b0):
|
|
Currently, I have two issues with the default behaviour regarding the
author
attribute:help2man
outputThat wouldn't be a huge issue normally, since it's as simple as adding
author=""
to thestructopt
attribute and I've put that in my project boilerplate, but subcommands don't inherit it.That means that, if I don't want
Stephan Sokolow <http, //www.ssokolow.com/ContactMe>
cluttering up all the subcommands in my project, something that should look like this......winds up looking like this:
...which is both a ludicrous status quo (How often do you find a project where different authors are responsible for different subcommands within the same binary?) and harmful for code readability.
StructOpt should just use the top-level
author
value for all subcommands unless they explicitly specify otherwise.(The blank
\\\
at the beginning is a workaround for anotherhelp2man
incompatibility which I'll be reporting separately once I have a moment to test whether it's StructOpt's fault or Clap's.)EDIT: And I just discovered that my
\n
workaround messes up the subcommand listing in--help
. I just can't win either way.The text was updated successfully, but these errors were encountered: