Fix incorrect config path in --help and manpage

Fixes #3154.
This commit is contained in:
Christian Duerr 2020-01-06 16:14:59 +00:00 committed by GitHub
parent 7fd17ab0dd
commit 18836f20dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 3 deletions

View File

@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## 0.4.2-dev ## 0.4.2-dev
### Fixed
- Incorrect default config path in `--help` on Windows and macOS
## 0.4.1 ## 0.4.1
### Packaging ### Packaging

View File

@ -23,6 +23,13 @@ use alacritty_terminal::index::{Column, Line};
use crate::config::Config; 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 /// Options specified on the command line
pub struct Options { pub struct Options {
pub live_config_reload: Option<bool>, pub live_config_reload: Option<bool>,
@ -158,8 +165,7 @@ impl Options {
.help("Start the shell in the specified working directory"), .help("Start the shell in the specified working directory"),
) )
.arg(Arg::with_name("config-file").long("config-file").takes_value(true).help( .arg(Arg::with_name("config-file").long("config-file").takes_value(true).help(
"Specify alternative configuration file [default: \ &format!("Specify alternative configuration file [default: {}]", CONFIG_PATH)
$XDG_CONFIG_HOME/alacritty/alacritty.yml]",
)) ))
.arg( .arg(
Arg::with_name("command") Arg::with_name("command")

View File

@ -49,7 +49,15 @@ Defines the window class hint on Linux [default: Alacritty,Alacritty ]
Command and args to execute (must be last argument) Command and args to execute (must be last argument)
.TP .TP
\fB\-\-config\-file\fR <config\-file> \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 .TP
\fB\-d\fR, \fB\-\-dimensions\fR <columns> <lines> \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] Defines the window dimensions. Falls back to size specified by window manager if set to 0x0 [default: 0x0]