use std::collections::{HashMap, HashSet};
use std::ffi::OsString;
use std::path::PathBuf;
use bat::assets::HighlightingAssets;
use clap::{AppSettings, ColorChoice, FromArgMatches, IntoApp, Parser};
use lazy_static::lazy_static;
use syntect::highlighting::Theme as SyntaxTheme;
use syntect::parsing::SyntaxSet;
use crate::config::delta_unreachable;
use crate::env::DeltaEnv;
use crate::git_config::{GitConfig, GitConfigEntry};
use crate::options;
use crate::utils;
use crate::utils::bat::output::PagingMode;
#[derive(Parser)]
#[clap(
name = "delta",
about = "A viewer for git and diff output",
version,
color = ColorChoice::Always,
setting(AppSettings::DeriveDisplayOrder),
term_width(0),
after_long_help = "\
GIT CONFIG
----------
By default, delta takes settings from a section named \"delta\" in git config files, if one is
present. The git config file to use for delta options will usually be ~/.gitconfig, but delta
follows the rules given in https://git-scm.com/docs/git-config#FILES. Most delta options can be
given in a git config file, using the usual option names but without the initial '--'. An example
is
[delta]
line-numbers = true
zero-style = dim syntax
FEATURES
--------
A feature is a named collection of delta options in git config. An example is:
[delta \"my-delta-feature\"]
syntax-theme = Dracula
plus-style = bold syntax \"#002800\"
To activate those options, you would use:
delta --features my-delta-feature
A feature name may not contain whitespa