aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/main.rs
diff options
context:
space:
mode:
authorMichael Davis2022-08-04 04:05:52 +0000
committerGitHub2022-08-04 04:05:52 +0000
commit5d33dbacac3564c50b9f3a74cfef6a956c35dd80 (patch)
tree21f1a0709bdf9d8f11765f42651af9c7bae8817e /helix-term/src/main.rs
parent219d2c25156a496ed2923d4cef256352bb1302e5 (diff)
add a CLI flag for specifying config file location (#2666)
Diffstat (limited to 'helix-term/src/main.rs')
-rw-r--r--helix-term/src/main.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/helix-term/src/main.rs b/helix-term/src/main.rs
index 83af7588..7f04f201 100644
--- a/helix-term/src/main.rs
+++ b/helix-term/src/main.rs
@@ -64,6 +64,7 @@ FLAGS:
--health [LANG] Checks for potential errors in editor setup
If given, checks for config errors in language LANG
-g, --grammar {{fetch|build}} Fetches or builds tree-sitter grammars listed in languages.toml
+ -c, --config <file> Specifies a file to use for configuration
-v Increases logging verbosity each use for up to 3 times
(default file: {})
-V, --version Prints version information
@@ -119,14 +120,15 @@ FLAGS:
std::fs::create_dir_all(&config_dir).ok();
}
- let config = match std::fs::read_to_string(config_dir.join("config.toml")) {
+ helix_loader::initialize_config_file(args.config_file.clone());
+
+ let config = match std::fs::read_to_string(helix_loader::config_file()) {
Ok(config) => toml::from_str(&config)
.map(helix_term::keymap::merge_keys)
.unwrap_or_else(|err| {
eprintln!("Bad config: {}", err);
eprintln!("Press <ENTER> to continue with default config");
use std::io::Read;
- // This waits for an enter press.
let _ = std::io::stdin().read(&mut []);
Config::default()
}),