aboutsummaryrefslogtreecommitdiff
path: root/src/macros.rs
diff options
context:
space:
mode:
authorJoe Wilm <joe@jwilm.com>2016-06-30 09:04:06 -0700
committerJoe Wilm <joe@jwilm.com>2016-06-30 09:04:06 -0700
commitd304ea9b774662ca05384b6633507362e389f7a9 (patch)
tree7bb6780b7296bbed87d174409e9777a54e41cfd1 /src/macros.rs
parent58146acea5ea021884bd58a739b24e98bcb81edf (diff)
downloadalacritty-d304ea9b774662ca05384b6633507362e389f7a9.tar.gz
alacritty-d304ea9b774662ca05384b6633507362e389f7a9.zip
Add config file
Configuration may now be specified in either `$HOME/.alacritty.yml` or `$HOME/.config/alacritty.yml`. See `alacritty.yml` in the repository root for an example. When a configuration file cannot be located, a default configuration is used.
Diffstat (limited to 'src/macros.rs')
-rw-r--r--src/macros.rs15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/macros.rs b/src/macros.rs
index e35eeb90..8abad78d 100644
--- a/src/macros.rs
+++ b/src/macros.rs
@@ -14,17 +14,16 @@
#[macro_export]
macro_rules! die {
- ($($arg:tt)*) => {
- println!($($arg)*);
+ ($($arg:tt)*) => {{
+ err_println!($($arg)*);
::std::process::exit(1);
- }
+ }}
}
#[macro_export]
macro_rules! err_println {
- ($($arg:tt)*) => {
- if let Err(_) = writeln!(&mut ::std::io::stderr(), $($arg)*) {
- die!("Cannot reach stderr");
- }
- }
+ ($($arg:tt)*) => {{
+ use std::io::Write;
+ (writeln!(&mut ::std::io::stderr(), $($arg)*)).expect("stderr");
+ }}
}