diff options
author | Christian Duerr <contact@christianduerr.com> | 2020-01-06 16:14:59 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-06 16:14:59 +0000 |
commit | 18836f20ddad440a059989076e782b9633d95f39 (patch) | |
tree | b555f88e398d30826144f01d9b609bf0c29d5341 | |
parent | 7fd17ab0dd30d9b14318578e4ca7d8da9c6c91d0 (diff) | |
download | alacritty-18836f20ddad440a059989076e782b9633d95f39.tar.gz alacritty-18836f20ddad440a059989076e782b9633d95f39.zip |
Fix incorrect config path in --help and manpage
Fixes #3154.
-rw-r--r-- | CHANGELOG.md | 4 | ||||
-rw-r--r-- | alacritty/src/cli.rs | 10 | ||||
-rw-r--r-- | extra/alacritty.man | 10 |
3 files changed, 21 insertions, 3 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 20c62d95..7fed829e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## 0.4.2-dev +### Fixed + +- Incorrect default config path in `--help` on Windows and macOS + ## 0.4.1 ### Packaging diff --git a/alacritty/src/cli.rs b/alacritty/src/cli.rs index 6f7f8a68..8abee061 100644 --- a/alacritty/src/cli.rs +++ b/alacritty/src/cli.rs @@ -23,6 +23,13 @@ use alacritty_terminal::index::{Column, Line}; use crate::config::Config; +#[cfg(not(any(target_os = "macos", windows)))] +const CONFIG_PATH: &str = "$XDG_CONFIG_HOME/alacritty/alacritty.yml"; +#[cfg(windows)] +const CONFIG_PATH: &str = "%APPDATA%\\alacritty\\alacritty.yml"; +#[cfg(target_os = "macos")] +const CONFIG_PATH: &str = "$HOME/.config/alacritty/alacritty.yml"; + /// Options specified on the command line pub struct Options { pub live_config_reload: Option<bool>, @@ -158,8 +165,7 @@ impl Options { .help("Start the shell in the specified working directory"), ) .arg(Arg::with_name("config-file").long("config-file").takes_value(true).help( - "Specify alternative configuration file [default: \ - $XDG_CONFIG_HOME/alacritty/alacritty.yml]", + &format!("Specify alternative configuration file [default: {}]", CONFIG_PATH) )) .arg( Arg::with_name("command") diff --git a/extra/alacritty.man b/extra/alacritty.man index 9ec2b02e..62c1eb44 100644 --- a/extra/alacritty.man +++ b/extra/alacritty.man @@ -49,7 +49,15 @@ Defines the window class hint on Linux [default: Alacritty,Alacritty ] Command and args to execute (must be last argument) .TP \fB\-\-config\-file\fR <config\-file> -Specify alternative configuration file [default: $XDG_CONFIG_HOME/alacritty/alacritty.yml] +Specify alternative configuration file + +Alacritty looks for the configuration file at the following paths: + 1. $XDG_CONFIG_HOME/alacritty/alacritty.yml + 2. $XDG_CONFIG_HOME/alacritty.yml + 3. $HOME/.config/alacritty/alacritty.yml + 4. $HOME/.alacritty.yml + +On Windows, the configuration file is located at %APPDATA%\\alacritty\\alacritty.yml. .TP \fB\-d\fR, \fB\-\-dimensions\fR <columns> <lines> Defines the window dimensions. Falls back to size specified by window manager if set to 0x0 [default: 0x0] |