Group CLI options into sections in help docs #2272
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
Move the doc-gen binary code into its own crate, separate from the soroban-cli crate, and have it be dependent on the unmerged pull request to clap-markdown that adds support for grouping cli options:
Why
The grouped options experience is a massive improvement. It makes the help documentation easier to scan and understand. It's the way the options are organised on the command line and the help markdown documentation should follow suite. While the pull request adds the feature upstream, the pull request hasn't been accepted yet.
The clap-markdown dependency isn't needed for the stellar-cli other than doc-gen, so it is in any case good to get the dependency outside of the soroban-cli crate, so that it isn't downloaded by cargo everytime someone installs the stellar-cli. Moving doc-gen into its own crate is trivial because the soroban-cli is designed to be embedded, and achieves that. Additionally because the doc-gen crate does not need to be published it can reference the unreleased pull request without issue.