diff options
author | Christian Duerr <contact@christianduerr.com> | 2023-06-12 02:23:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-12 00:23:41 +0000 |
commit | bd4906722a1a026b01f06c94c33b13ff63a7e044 (patch) | |
tree | a2713a7b0a5fa23ec8b9055d7ed06f1cede62447 /alacritty/src/main.rs | |
parent | ea2c39e65d21728e0f04b0eafcec7153e4447cd5 (diff) | |
download | r-alacritty-bd4906722a1a026b01f06c94c33b13ff63a7e044.tar.gz r-alacritty-bd4906722a1a026b01f06c94c33b13ff63a7e044.tar.bz2 r-alacritty-bd4906722a1a026b01f06c94c33b13ff63a7e044.zip |
Switch to TOML configuration format
This switches Alacritty's default configuration format from yaml to
toml. While yaml is still supported, it is done by converting it to toml
and should be removed entirely in the future.
All existing features were persisted based on my testing. Behavior
should not change much, though `--option` might have slightly different
behavior since the entire line is not interpreted as one line of toml.
A new `alacritty migrate` subcommand has been added which allows
automatic migration from yaml to toml. This also could be used as a
facility to automatically fix configuration file changes in the future.
Closes #6592.
Diffstat (limited to 'alacritty/src/main.rs')
-rw-r--r-- | alacritty/src/main.rs | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/alacritty/src/main.rs b/alacritty/src/main.rs index 29120b35..55f81502 100644 --- a/alacritty/src/main.rs +++ b/alacritty/src/main.rs @@ -42,6 +42,7 @@ mod logging; #[cfg(target_os = "macos")] mod macos; mod message_bar; +mod migrate; #[cfg(windows)] mod panic; mod renderer; @@ -54,9 +55,9 @@ mod gl { include!(concat!(env!("OUT_DIR"), "/gl_bindings.rs")); } -use crate::cli::Options; #[cfg(unix)] -use crate::cli::{MessageOptions, Subcommands}; +use crate::cli::MessageOptions; +use crate::cli::{Options, Subcommands}; use crate::config::{monitor, UiConfig}; use crate::event::{Event, Processor}; #[cfg(target_os = "macos")] @@ -77,14 +78,14 @@ fn main() -> Result<(), Box<dyn Error>> { // Load command line options. let options = Options::new(); - #[cfg(unix)] match options.subcommands { - Some(Subcommands::Msg(options)) => msg(options), - None => alacritty(options), + #[cfg(unix)] + Some(Subcommands::Msg(options)) => msg(options)?, + Some(Subcommands::Migrate(options)) => migrate::migrate(options), + None => alacritty(options)?, } - #[cfg(not(unix))] - alacritty(options) + Ok(()) } /// `msg` subcommand entrypoint. |