mirror of
https://github.com/sharkdp/bat.git
synced 2024-11-08 00:44:30 +01:00
Move InputFile to separate module
This commit is contained in:
parent
1be346a038
commit
860f3e9006
@ -15,6 +15,7 @@ use ansi_term;
|
||||
|
||||
use assets::BAT_THEME_DEFAULT;
|
||||
use errors::*;
|
||||
use inputfile::InputFile;
|
||||
use line_range::LineRange;
|
||||
use style::{OutputComponent, OutputComponents, OutputWrap};
|
||||
|
||||
@ -25,13 +26,6 @@ pub enum PagingMode {
|
||||
Never,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||
pub enum InputFile<'a> {
|
||||
StdIn,
|
||||
Ordinary(&'a str),
|
||||
ThemePreviewFile,
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct Config<'a> {
|
||||
/// List of files to print
|
||||
|
@ -11,7 +11,7 @@ use syntect::parsing::{SyntaxDefinition, SyntaxSet};
|
||||
#[cfg(unix)]
|
||||
use std::os::unix::fs::FileTypeExt;
|
||||
|
||||
use app::InputFile;
|
||||
use inputfile::InputFile;
|
||||
|
||||
lazy_static! {
|
||||
static ref PROJECT_DIRS: ProjectDirs =
|
||||
|
@ -1,9 +1,10 @@
|
||||
use std::fs::File;
|
||||
use std::io::{self, BufRead, BufReader, Write};
|
||||
|
||||
use app::{Config, InputFile};
|
||||
use app::Config;
|
||||
use assets::HighlightingAssets;
|
||||
use errors::*;
|
||||
use inputfile::InputFile;
|
||||
use line_range::LineRange;
|
||||
use output::OutputType;
|
||||
use printer::{InteractivePrinter, Printer, SimplePrinter};
|
||||
|
6
src/inputfile.rs
Normal file
6
src/inputfile.rs
Normal file
@ -0,0 +1,6 @@
|
||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||
pub enum InputFile<'a> {
|
||||
StdIn,
|
||||
Ordinary(&'a str),
|
||||
ThemePreviewFile,
|
||||
}
|
@ -24,6 +24,7 @@ mod clap_app;
|
||||
mod controller;
|
||||
mod decorations;
|
||||
mod diff;
|
||||
mod inputfile;
|
||||
mod line_range;
|
||||
mod output;
|
||||
mod preprocessor;
|
||||
@ -40,9 +41,10 @@ use std::process;
|
||||
use ansi_term::Colour::Green;
|
||||
use ansi_term::Style;
|
||||
|
||||
use app::{App, Config, InputFile};
|
||||
use app::{App, Config};
|
||||
use assets::{clear_assets, config_dir, HighlightingAssets};
|
||||
use controller::Controller;
|
||||
use inputfile::InputFile;
|
||||
use style::{OutputComponent, OutputComponents};
|
||||
|
||||
mod errors {
|
||||
|
@ -10,12 +10,13 @@ use console::AnsiCodeIterator;
|
||||
use syntect::easy::HighlightLines;
|
||||
use syntect::highlighting::Theme;
|
||||
|
||||
use app::{Config, InputFile};
|
||||
use app::Config;
|
||||
use assets::HighlightingAssets;
|
||||
use decorations::{Decoration, GridBorderDecoration, LineChangesDecoration, LineNumberDecoration};
|
||||
use diff::get_git_diff;
|
||||
use diff::LineChanges;
|
||||
use errors::*;
|
||||
use inputfile::InputFile;
|
||||
use preprocessor::expand;
|
||||
use style::OutputWrap;
|
||||
use terminal::{as_terminal_escaped, to_ansi_color};
|
||||
|
Loading…
Reference in New Issue
Block a user