sc-cli: Fix bugs after switching to clap3 (#10920)

* sc-cli: Fix bugs after switching to clap3

Before switching to clap3 we support cli options like `--reserved-nodes A B` and after you needed to
pass `--reserved-nodes` cli option multiple times `--reserved-nodes A --reserved-nodes B`. This is
fixed by setting `multiple_occurrences(true)` option. This also done for all the other `Vec` cli
options in `sc-cli`. Besides that `--sync` wasn't supporting case insensitive parsing of the value.
This is now also supported. For both regressions a test is added. Besides that the pr removes all
the `rename_all = PascalCase` attributes, because they are not needed. All other `ArgEnum`s were
checked and all are already using `ignore_case(true)`.

* Bring back `PascalCase`, because otherwise it falls back to `kebab-case`...
This commit is contained in:
Bastian Köcher
2022-02-25 16:01:33 +01:00
committed by GitHub
parent 535325d2e6
commit d551fe6613
4 changed files with 87 additions and 23 deletions
@@ -46,7 +46,7 @@ pub struct SharedParams {
///
/// Log levels (least to most verbose) are error, warn, info, debug, and trace.
/// By default, all targets log `info`. The global log level can be set with -l<level>.
#[clap(short = 'l', long, value_name = "LOG_PATTERN")]
#[clap(short = 'l', long, value_name = "LOG_PATTERN", multiple_values(true))]
pub log: Vec<String>,
/// Enable detailed log output.