Switch to custom templating library
This commit is contained in:
@ -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");
|
||||
|
||||
Reference in New Issue
Block a user