-
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
flatten
causes the wrong doc-comment to be respected
#333
Comments
Based on reports (clap-rs/clap-verbosity-flag#20) I'm guessing e2270de broke this |
But there's no user specified help here as far as I can see 😕 |
/// Foo
struct Cli { The user's doc-comment is being overridden by the doc-comment from the chain. Instead of "Foo", we're getting library documentation |
This is caused by #290 since doc comments on top of struct/enum are top level attributes too :( |
I just noticed that this also causes the doc comment on my boilerplate opts (which get flattened into the main struct) to override the I'm really starting to feel like I need to write a regression/integration suite on my |
Is there any update or way to fix this? The complexity of structopt is too high for me right now to try to find a fix. thanks in advance |
I tried to fix it. I couldn't. I'll take another round a bit later. |
Hello I guess the „proper“ way to fix it will be hard and will take time (I'm not sure if reordering the calls inside the But if it is hard, would it make sense to add some kind of |
By default, there is no about, but doc comment are |
I've figured that, but it is kind of bad for structs provided by libraries. I want to have doc comment to render on docs.rs, I also tend to But as the author of the library I know my struct should not be used directly and that it should never provide the https://docs.rs/spirit-daemonize/0.3.2/spirit_daemonize/struct.Opts.html Maybe the right name would be |
Work around for the issue where doc comments „sneak in“ while flattening into the program description TeXitoi/structopt#333 Simply enable the doc comments only when building the docs or doc comments.
Just for the record, I've figured a workaround that keeps them for the docs.rs, but doesn't hijacks them for the about:
It simply enables the doc comment only for the documentation generation (and seems to work with doc tests too) |
Work around for the issue where doc comments „sneak in“ while flattening into the program description TeXitoi/structopt#333 Simply enable the doc comments only when building the docs or doc comments.
I've put a link to your workaround in the description of the issue for ease of access. |
The problem is described in these issues: TeXitoi/structopt#333 TeXitoi/structopt#391 The is easiest workaround is to remove doc comments from `Options` and `Subcommand`
Workaround from: TeXitoi/structopt#333 (comment) Co-authored-by: Tim Lancina <tlancina@users.noreply.github.com>
Was showing proxy opts description instead of repl description. This is a workaround for `structopt` issue #333, #391, #418; see TeXitoi/structopt#333 (comment)
Was showing proxy opts description instead of repl description. This is a workaround for `structopt` issue #333, #391, #418; see TeXitoi/structopt#333 (comment)
Was showing proxy opts description instead of repl description. This is a workaround for `structopt` issue #333, #391, #418; see TeXitoi/structopt#333 (comment)
Was showing proxy opts description instead of repl description. This is a workaround for `structopt` issue #333, #391, #418; see TeXitoi/structopt#333 (comment)
This fixes the help docs for the repl and wallet subcommands. The repl subcommand was showing the proxy options docs instead, and the wallet subcommand was showing the description from the WalletSubCommand enum. This is a workaround for structopt issue #333, #391, #418. see TeXitoi/structopt#333 (comment)
This fixes the help docs for the repl and wallet subcommands. The repl subcommand was showing the proxy options docs instead, and the wallet subcommand was showing the description from the WalletSubCommand enum. This is a workaround for structopt issue #333, #391, #418. see TeXitoi/structopt#333 (comment)
3f9b892 Pin fd-lock version to 3.0.2 (Steve Myers) 4a02a9f Manual docs formatting fix (Steve Myers) c82fd90 Update Cargo.lock (Steve Myers) 81652b1 Fix repl and wallet help docs (Steve Myers) Pull request description: ### Description This fixes the help docs for the `repl` and `wallet` subcommands. The `repl` subcommand was showing the proxy options docs instead, and the `wallet` subcommand was showing the description from the `WalletSubCommand` enum. This is a workaround for `structopt` issue #333, #391, #418; see TeXitoi/structopt#333 (comment) ### Notes to the reviewers Before this PR this was showing: ```shell $ cargo run --features esplora-ureq,compiler -- --help ... SUBCOMMANDS: compile Compile a miniscript policy to an output descriptor help Prints this message or the help of the given subcommand(s) key Key management sub-commands repl Proxy Server options wallet Wallet sub-commands ``` After this PR we get: ```shell $ cargo run --features esplora-ureq,compiler -- --help ... SUBCOMMANDS: compile Compile a miniscript policy to an output descriptor help Prints this message or the help of the given subcommand(s) key Key management sub-commands repl Enter REPL command loop mode wallet Wallet options and sub-commands ``` ### Checklists #### All Submissions: * [x] I've signed all my commits * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk-cli/blob/master/CONTRIBUTING.md) * [x] I ran `cargo fmt` and `cargo clippy` before committing #### Bugfixes: * [ ] This pull request breaks the existing API * [ ] I've added tests to reproduce the issue which are now passing * [ ] I'm linking the issue being fixed by this PR Top commit has no ACKs. Tree-SHA512: 8d708720f60940edd40826a159388ced261c91d23e074b51164f8c49a2e673cbaecee0241e52cb02090e40ff1f989a980aee0122230cee211f4c3284cad4483c
Summary: This workaround seems to be unnecessary since we migrated to newer clap. Reviewed By: stepancheg Differential Revision: D37334350 fbshipit-source-id: 3b5c116ec492ea8e6be2fe61cbdd975a115573ba
Workaround from: TeXitoi/structopt#333 (comment) Co-authored-by: Tim Lancina <tlancina@users.noreply.github.com>
Workaround from: TeXitoi/structopt#333 (comment) Co-authored-by: Tim Lancina <tlancina@users.noreply.github.com>
With
clap-verbosity-flag
"3.0.0"will cause clap-verbosity-flag's documentation to be used for the help instead of the user-specified one
I am working around it in clap-verbosity-flag by. not providing a doc comment (clap-rs/clap-verbosity-flag#21).
A workaround is explained in #333 (comment)
The text was updated successfully, but these errors were encountered: