sigp / lighthouse

Ethereum consensus client in Rust
https://lighthouse.sigmaprime.io/
Apache License 2.0
2.92k stars 741 forks source link

Support --validator-dir and other flags after subcommands #3768

Open michaelsproul opened 1 year ago

michaelsproul commented 1 year ago

Description

In the Lighthouse account manager currently the validator-dir flag needs to come directly after the validator subcommand, which gives it quite poor UX and discoverability.

i.e. you need to write

lighthouse account validator --validator-dir /path import --keystores /blah

but can't write

lighthouse account validator import --validator-dir /path --keystores /blah

Version

Lighthouse v3.3.0

Steps to resolve

I think there are options in clap (our CLI parser) to mark certain flags as global. I'm not sure if global is overkill though, I should hope it only applies from that subcommand down and not all the way up to the top-level lighthouse command.

0xbentang commented 1 year ago

First time contributing, please let me know if there're any issues. Do you also have hints on what other flags are needed for the change?