feat: print-config subset of config (#3179)

* feat: print-config subset of config

* only print format helpers with format config

* improve help text

* also change argument name
This commit is contained in:
Matthew Donoughe
2021-11-15 00:45:19 -05:00
committed by GitHub
parent 9d443dff9f
commit c3e33ea1c7
2 changed files with 145 additions and 18 deletions
+11 -1
View File
@@ -166,6 +166,12 @@ fn main() {
.long("default")
.help("Print the default instead of the computed config")
.takes_value(false),
)
.arg(
Arg::with_name("name")
.help("Configuration keys to print")
.multiple(true)
.required(false),
),
)
.subcommand(
@@ -265,7 +271,11 @@ fn main() {
}
("print-config", Some(sub_m)) => {
let print_default = sub_m.is_present("default");
configure::print_configuration(print_default)
let paths = sub_m
.values_of("name")
.map(|paths| paths.collect::<Vec<&str>>())
.unwrap_or_default();
configure::print_configuration(print_default, &paths)
}
("toggle", Some(sub_m)) => {
if let Some(name) = sub_m.value_of("name") {