|
|
|
@ -7,7 +7,7 @@ pub struct Args {
|
|
|
|
|
#[arg(short, long)]
|
|
|
|
|
pub verbose: bool,
|
|
|
|
|
|
|
|
|
|
#[arg(short, long, default_value = ".")]
|
|
|
|
|
#[arg(short, long, default_value = default_repo() )]
|
|
|
|
|
pub repo: PathBuf,
|
|
|
|
|
/// The silo command to execute
|
|
|
|
|
#[command(subcommand)]
|
|
|
|
@ -24,3 +24,14 @@ pub enum Command {
|
|
|
|
|
/// Print the entire context available to templates
|
|
|
|
|
Context,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn default_repo() -> &'static str {
|
|
|
|
|
lazy_static::lazy_static! {
|
|
|
|
|
static ref DEFAULT_REPO: String = dirs::data_dir()
|
|
|
|
|
.unwrap()
|
|
|
|
|
.join("silo")
|
|
|
|
|
.to_string_lossy()
|
|
|
|
|
.into();
|
|
|
|
|
}
|
|
|
|
|
&*DEFAULT_REPO
|
|
|
|
|
}
|
|
|
|
|