mirror of
https://github.com/clap-rs/clap
synced 2024-12-13 22:32:33 +00:00
04b5b074d1
The largest organizational change is that methods used to generate the help are implemented by the Help object and not the App, FlagBuilder, Parser, etc. The new code is based heavily on the old one with a few minor modifications aimed to reduce code duplication and coupling between the Help and the rest of the code. The new code turn things around: instead of having a HelpWriter that holds an AnyArg object and a method that is called with a writer as argument, there is a Help Object that holds a writer and a method that is called with a writer as an argument. There are still things to do such as moving `create_usage` outside the Parser. The peformance has been affected, probably by the use of Trait Objects. This was done as a way to reduce code duplication (i.e. in the unified help code). This performance hit should not affect the usability as generating and printing the help is dominated by user interaction and IO. The old code to generate the help is still functional and is the active one. The new code has been tested against the old one by generating help strings for most of the examples in the repo. |
||
---|---|---|
.. | ||
01_default.rs | ||
02_simple.rs | ||
03_complex.rs | ||
04_new_help.rs |