mirror of
https://github.com/Llewellynvdm/exa.git
synced 2024-06-01 15:00:49 +00:00
Move Colours and LSColors to their own module
The ‘options’ module is allowed to depend on ‘style’, but ‘options::render’ is not.
This commit is contained in:
parent
945fa1e83d
commit
dd838c2dc1
|
@ -38,6 +38,7 @@ mod fs;
|
|||
mod info;
|
||||
mod options;
|
||||
mod output;
|
||||
mod style;
|
||||
|
||||
|
||||
/// The main program wrapper.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use output::Colours;
|
||||
use style::Colours;
|
||||
|
||||
use options::{flags, Vars, Misfire};
|
||||
use options::parser::MatchedFlags;
|
||||
|
@ -63,7 +63,7 @@ impl Colours {
|
|||
pub fn deduce<V, TW>(matches: &MatchedFlags, vars: &V, widther: TW) -> Result<Colours, Misfire>
|
||||
where TW: Fn() -> Option<usize>, V: Vars {
|
||||
use self::TerminalColours::*;
|
||||
use output::lsc::LSColors;
|
||||
use style::LSColors;
|
||||
use options::vars;
|
||||
|
||||
let tc = TerminalColours::deduce(matches)?;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
use output::Colours;
|
||||
use style::Colours;
|
||||
|
||||
use output::{View, Mode, grid, details};
|
||||
use output::grid_details::{self, RowThreshold};
|
||||
use output::table::{TimeTypes, Environment, SizeFormat, Columns, Options as TableOptions};
|
||||
|
|
|
@ -70,7 +70,7 @@ use fs::{Dir, File};
|
|||
use fs::dir_action::RecurseOptions;
|
||||
use fs::filter::FileFilter;
|
||||
use fs::feature::xattr::{Attribute, FileAttributes};
|
||||
use output::colours::Colours;
|
||||
use style::Colours;
|
||||
use output::cell::TextCell;
|
||||
use output::tree::{TreeTrunk, TreeParams, TreeDepth};
|
||||
use output::file_name::FileStyle;
|
||||
|
|
|
@ -3,7 +3,7 @@ use std::io::{Write, Result as IOResult};
|
|||
use term_grid as tg;
|
||||
|
||||
use fs::File;
|
||||
use output::colours::Colours;
|
||||
use style::Colours;
|
||||
use output::file_name::FileStyle;
|
||||
|
||||
|
||||
|
|
|
@ -9,8 +9,8 @@ use fs::{Dir, File};
|
|||
use fs::feature::xattr::FileAttributes;
|
||||
use fs::filter::FileFilter;
|
||||
|
||||
use style::Colours;
|
||||
use output::cell::TextCell;
|
||||
use output::colours::Colours;
|
||||
use output::details::{Options as DetailsOptions, Row as DetailsRow, Render as DetailsRender};
|
||||
use output::grid::Options as GridOptions;
|
||||
use output::file_name::FileStyle;
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
use std::io::{Write, Result as IOResult};
|
||||
|
||||
use ansi_term::ANSIStrings;
|
||||
use fs::File;
|
||||
|
||||
use fs::File;
|
||||
use output::file_name::{FileName, FileStyle};
|
||||
use super::colours::Colours;
|
||||
use style::Colours;
|
||||
|
||||
|
||||
/// The lines view literally just displays each file, line-by-line.
|
||||
|
|
|
@ -1,23 +1,20 @@
|
|||
use output::file_name::FileStyle;
|
||||
use style::Colours;
|
||||
|
||||
pub use self::cell::{TextCell, TextCellContents, DisplayWidth};
|
||||
pub use self::colours::Colours;
|
||||
pub use self::escape::escape;
|
||||
pub use self::lsc::LSColors;
|
||||
|
||||
pub mod details;
|
||||
pub mod file_name;
|
||||
pub mod grid_details;
|
||||
pub mod grid;
|
||||
pub mod lines;
|
||||
pub mod lsc;
|
||||
pub mod render;
|
||||
pub mod table;
|
||||
pub mod time;
|
||||
|
||||
mod cell;
|
||||
mod colours;
|
||||
mod escape;
|
||||
mod render;
|
||||
mod tree;
|
||||
|
||||
|
||||
|
|
|
@ -10,14 +10,12 @@ use locale;
|
|||
|
||||
use users::UsersCache;
|
||||
|
||||
use style::Colours;
|
||||
use output::cell::TextCell;
|
||||
use output::colours::Colours;
|
||||
use output::time::TimeFormat;
|
||||
|
||||
use fs::{File, Dir, fields as f};
|
||||
|
||||
|
||||
|
||||
/// Options for displaying a table.
|
||||
pub struct Options {
|
||||
pub env: Environment,
|
||||
|
|
5
src/style/mod.rs
Normal file
5
src/style/mod.rs
Normal file
|
@ -0,0 +1,5 @@
|
|||
mod colours;
|
||||
pub use self::colours::Colours;
|
||||
|
||||
mod lsc;
|
||||
pub use self::lsc::LSColors;
|
Loading…
Reference in New Issue
Block a user