doctave
doctave copied to clipboard
Upgrade arg parsing to clap v3 with derive
Changes the arg parsing to use clap 3.0 with its newly added derive feature, that largely simplifies command line definition and automates away some boilerplate type parsing (notably the port flag).
Note: by default clap now outputs colorful help prompts, let me know if it should be disabled.
Thanks for submitting this!
As long as we respect the --no-color flag in Doctave I think it's fine to display colors in the help prompts. At least personally I like colorful CLIs :)
Haven't had a chance to test this yet, but did you notice any changes in compile time after this change? I'm just aware that clap is a bit of a heavy dependency and relying on derive's can sometimes have a dramatic effect on compile times.
Slower compile times are not necessarily a deal breaker but wanted to check - just something to be aware of.
~~On my WSL2 with Intel Core i5-9300H @ 8x 2.4GHz cargo build sees an increase roughly from 50s to 54s~~
EDIT: that information is probably irrelevant since I just did one run on master and on this branch, without a benchmark
Benchmark results:
master:

pr branch:

So roughly a 1 second increase, IMO reasonable 😁