-
-
Notifications
You must be signed in to change notification settings - Fork 660
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This branch added support for the EXA_COLORS environment variable, and defines a bunch of two-letter configuration settings that allows theming exa. The next step is to allow custom highlighting based on file names.
- Loading branch information
Showing
21 changed files
with
470 additions
and
306 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,7 @@ mod fs; | |
mod info; | ||
mod options; | ||
mod output; | ||
mod style; | ||
|
||
|
||
/// The main program wrapper. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
use std::ffi::OsString; | ||
|
||
|
||
// General variables | ||
|
||
/// Environment variable used to colour files, both by their filesystem type | ||
/// (symlink, socket, directory) and their file name or extension (image, | ||
/// video, archive); | ||
pub static LS_COLORS: &str = "LS_COLORS"; | ||
|
||
/// Environment variable used to override the width of the terminal, in | ||
/// characters. | ||
pub static COLUMNS: &str = "COLUMNS"; | ||
|
||
|
||
// exa-specific variables | ||
|
||
/// Environment variable used to colour exa’s interface when colours are | ||
/// enabled. This includes all the colours that LS_COLORS would recognise, | ||
/// overriding them if necessary. It can also contain exa-specific codes. | ||
pub static EXA_COLORS: &str = "EXA_COLORS"; | ||
|
||
/// Environment variable used to switch on strict argument checking, such as | ||
/// complaining if an argument was specified twice, or if two conflict. | ||
/// This is meant to be so you don’t accidentally introduce the wrong | ||
/// behaviour in a script, rather than for general command-line use. | ||
pub static EXA_STRICT: &str = "EXA_STRICT"; | ||
|
||
/// Environment variable used to limit the grid-details view | ||
/// (`--grid --long`) so it’s only activated if there’s at least the given | ||
/// number of rows of output. | ||
pub static EXA_GRID_ROWS: &str = "EXA_GRID_ROWS"; | ||
|
||
|
||
|
||
/// Mockable wrapper for `std::env::var_os`. | ||
pub trait Vars { | ||
fn get(&self, name: &'static str) -> Option<OsString>; | ||
} | ||
|
||
|
||
// Test impl that just returns the value it has. | ||
#[cfg(test)] | ||
impl Vars for Option<OsString> { | ||
fn get(&self, _name: &'static str) -> Option<OsString> { | ||
self.clone() | ||
} | ||
} |
Oops, something went wrong.