Switch to custom templating library

This commit is contained in:
2021-05-20 16:16:02 +02:00
parent 6f8e1d46c7
commit 00412be372
8 changed files with 207 additions and 395 deletions

View File

@ -24,11 +24,10 @@ struct Opt {
#[structopt(short, long)]
link_dir: Option<PathBuf>,
#[structopt(subcommand)]
color: Option<ColorMode>,
#[structopt(short, parse(from_occurrences))]
verbosity: u8,
flags: Vec<String>,
}
#[derive(Debug)]
@ -36,13 +35,7 @@ pub struct Config {
template_dir: PathBuf,
build_dir: PathBuf,
link_dir: PathBuf,
color: ColorMode,
}
#[derive(StructOpt, PartialEq, Eq, Clone, Copy, Debug)]
pub enum ColorMode {
Dark,
Light,
flags: Vec<String>,
}
#[tokio::main]
@ -79,7 +72,7 @@ async fn run() -> Result<(), Errors> {
link_dir: opt
.link_dir
.unwrap_or_else(|| env::var("HOME").expect("$HOME").into()),
color: opt.color.unwrap_or(ColorMode::Dark),
flags: opt.flags,
};
info!("building tree");