mirror of
https://github.com/sharkdp/bat
synced 2026-08-08 19:41:45 +00:00
Add option to generate a default config file, fixes #870
This commit is contained in:
committed by
David Peter
parent
4aef8c180a
commit
376c556862
+5
-1
@@ -22,7 +22,7 @@ use std::process;
|
||||
use ansi_term::Colour::Green;
|
||||
use ansi_term::Style;
|
||||
|
||||
use crate::{app::App, config::config_file};
|
||||
use crate::{app::App, config::{config_file, generate_config_file}};
|
||||
use assets::{assets_from_cache_or_binary, cache_dir, clear_assets, config_dir};
|
||||
use bat::Controller;
|
||||
use directories::PROJECT_DIRS;
|
||||
@@ -188,6 +188,10 @@ fn run() -> Result<bool> {
|
||||
} else if app.matches.is_present("config-file") {
|
||||
println!("{}", config_file().to_string_lossy());
|
||||
|
||||
Ok(true)
|
||||
} else if app.matches.is_present("generate-config-file") {
|
||||
generate_config_file();
|
||||
|
||||
Ok(true)
|
||||
} else if app.matches.is_present("config-dir") {
|
||||
writeln!(io::stdout(), "{}", config_dir())?;
|
||||
|
||||
Reference in New Issue
Block a user