summaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorDan Davison <dandavison7@gmail.com>2020-06-10 14:58:55 -0400
committerDan Davison <dandavison7@gmail.com>2020-06-10 14:58:55 -0400
commit39b4d39d7f2b3c07e316ea8640640602d2115d14 (patch)
tree1634c174f399f38426b9034269ee1698b5ee23d8 /src/main.rs
parent18ddf57ff200b3db692294665b0d8513b8f42daf (diff)
Add boolean flags to config
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs24
1 files changed, 10 insertions, 14 deletions
diff --git a/src/main.rs b/src/main.rs
index f32000ca..93cfdb54 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -49,19 +49,6 @@ fn main() -> std::io::Result<()> {
let arg_matches = cli::Opt::clap().get_matches();
let opt = cli::Opt::from_clap(&arg_matches);
- if opt.list_languages {
- list_languages()?;
- process::exit(0);
- } else if opt.list_syntax_theme_names {
- list_syntax_theme_names()?;
- process::exit(0);
- } else if opt.list_syntax_themes {
- list_syntax_themes()?;
- process::exit(0);
- }
-
- let show_background_colors_option = opt.show_background_colors;
-
let mut git_config = match std::env::current_dir() {
Ok(dir) => match git2::Repository::discover(dir) {
Ok(repo) => match repo.config() {
@@ -83,7 +70,16 @@ fn main() -> std::io::Result<()> {
);
}
- if show_background_colors_option {
+ if config.list_languages {
+ list_languages()?;
+ process::exit(0);
+ } else if config.list_syntax_theme_names {
+ list_syntax_theme_names()?;
+ process::exit(0);
+ } else if config.list_syntax_themes {
+ list_syntax_themes()?;
+ process::exit(0);
+ } else if config.show_background_colors {
show_background_colors(&config);
process::exit(0);
}