diff options
-rw-r--r-- | src/cli.rs | 12 | ||||
-rw-r--r-- | src/main.rs | 3 |
2 files changed, 11 insertions, 4 deletions
@@ -10,6 +10,7 @@ use structopt::{clap, StructOpt}; use syntect::highlighting::Theme as SyntaxTheme; use syntect::parsing::SyntaxSet; +use crate::bat::assets::HighlightingAssets; use crate::git_config::GitConfig; use crate::options; @@ -510,8 +511,11 @@ pub struct ComputedValues { } impl Opt { - pub fn from_args_and_git_config(git_config: &mut Option<GitConfig>) -> Self { - Self::from_clap_and_git_config(Self::clap().get_matches(), git_config) + pub fn from_args_and_git_config( + git_config: &mut Option<GitConfig>, + assets: HighlightingAssets, + ) -> Self { + Self::from_clap_and_git_config(Self::clap().get_matches(), git_config, assets) } #[cfg(test)] @@ -520,12 +524,14 @@ impl Opt { I: IntoIterator, I::Item: Into<OsString> + Clone, { - Self::from_clap_and_git_config(Self::clap().get_matches_from(iter), git_config) + let assets = HighlightingAssets::new(); + Self::from_clap_and_git_config(Self::clap().get_matches_from(iter), git_config, assets) } fn from_clap_and_git_config( arg_matches: clap::ArgMatches, git_config: &mut Option<GitConfig>, + assets: HighlightingAssets, ) -> Self { let mut opt = Opt::from_clap(&arg_matches); options::set::set_options(&mut opt, git_config, &arg_matches); diff --git a/src/main.rs b/src/main.rs index dc734319..a70b83c3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -47,7 +47,8 @@ mod errors { } fn main() -> std::io::Result<()> { - let opt = cli::Opt::from_args_and_git_config(&mut git_config::GitConfig::try_create()); + let assets = HighlightingAssets::new(); + let opt = cli::Opt::from_args_and_git_config(&mut git_config::GitConfig::try_create(), assets); if opt.list_languages { list_languages()?; |