diff --git a/src/cli.rs b/src/cli.rs index 266cdb3..700bb7a 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -2,7 +2,7 @@ use clap::Parser; pub const EDITOR_KEY: &str = "VISUAL"; pub const ALWAYS_DELETE_KEY: &str = "ATMPT_ALWAYS_DELETE"; -pub const TEMPLATE_DIR_KEY: &str = "ATMPT_DATA_DIR"; +pub const DATA_DIR_KEY: &str = "ATMPT_DATA_DIR"; #[derive(Debug, Parser)] #[command(author, version, about)] @@ -16,8 +16,8 @@ pub struct Atmpt { #[arg(short = 'n', long, hide_env = true, env = ALWAYS_DELETE_KEY, help = "Delete project on exit")] pub delete: bool, - #[arg(long, hide_env = true, env = TEMPLATE_DIR_KEY, help = "Override template dir")] - pub new_template_dir: Option, + #[arg(long, hide_env = true, env = DATA_DIR_KEY, help = "Override data directory")] + pub data_dir: Option, } #[derive(Debug, Parser)] diff --git a/src/main.rs b/src/main.rs index cb8e70e..f6aaf91 100644 --- a/src/main.rs +++ b/src/main.rs @@ -14,7 +14,7 @@ fn main() -> anyhow::Result<()> { let req = args.required; let mut data_dir = Cow::Borrowed(dirs.data_dir()); - if let Some(new_dir) = args.new_template_dir { + if let Some(new_dir) = args.data_dir { data_dir = Cow::Owned(PathBuf::from(new_dir)); }; diff --git a/tests/mod.rs b/tests/mod.rs index 3e16608..b07a91c 100644 --- a/tests/mod.rs +++ b/tests/mod.rs @@ -1,7 +1,7 @@ use std::{env, path::PathBuf}; use assert_cmd::Command; -use atmpt::{ALWAYS_DELETE_KEY, EDITOR_KEY, TEMPLATE_DIR_KEY}; +use atmpt::{ALWAYS_DELETE_KEY, DATA_DIR_KEY, EDITOR_KEY}; const PROJECT_DIR: &str = env!("CARGO_MANIFEST_DIR"); @@ -10,7 +10,7 @@ fn cmd() -> Command { env::set_var(ALWAYS_DELETE_KEY, "true"); let templates = PathBuf::from_iter([PROJECT_DIR, "templates"]); - env::set_var(TEMPLATE_DIR_KEY, templates.to_string_lossy().as_ref()); + env::set_var(DATA_DIR_KEY, templates.to_string_lossy().as_ref()); Command::cargo_bin("atmpt").unwrap() }