diff options
author | David Knaack <davidkna@users.noreply.github.com> | 2021-03-31 17:31:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-31 17:31:55 +0200 |
commit | d06ba072a88da96448260ff7c97174a08aad669a (patch) | |
tree | 30ff17a324703e767a8bb19b0114d7d6ca2aea0c /src/main.rs | |
parent | 2b15ca1a157fa21dd7d8432b2c51e1e2ecf87496 (diff) |
feat(config): allow printing default and computed config (#2521)
* feat: allow printing default and computed config
* fix custom modules
* actually fix custom modules
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs index 977f99414..514097a7a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -132,6 +132,17 @@ fn main() { .arg(Arg::with_name("value").help("Value to place into that key")), ) .subcommand( + SubCommand::with_name("print-config") + .about("Prints the computed starship configuration") + .arg( + Arg::with_name("default") + .short("d") + .long("default") + .help("Print the default instead of the computed config") + .takes_value(false), + ), + ) + .subcommand( SubCommand::with_name("toggle") .about("Toggle a given starship module") .arg( @@ -208,6 +219,10 @@ fn main() { configure::edit_configuration() } } + ("print-config", Some(sub_m)) => { + let print_default = sub_m.is_present("default"); + configure::print_configuration(print_default) + } ("toggle", Some(sub_m)) => { if let Some(name) = sub_m.value_of("name") { if let Some(value) = sub_m.value_of("key") { |