|
|
@ -7,7 +7,7 @@ pub struct Args {
|
|
|
|
#[arg(short, long)]
|
|
|
|
#[arg(short, long)]
|
|
|
|
pub verbose: bool,
|
|
|
|
pub verbose: bool,
|
|
|
|
|
|
|
|
|
|
|
|
#[arg(short, long, default_value = ".")]
|
|
|
|
#[arg(short, long, default_value = default_repo() )]
|
|
|
|
pub repo: PathBuf,
|
|
|
|
pub repo: PathBuf,
|
|
|
|
/// The silo command to execute
|
|
|
|
/// The silo command to execute
|
|
|
|
#[command(subcommand)]
|
|
|
|
#[command(subcommand)]
|
|
|
@ -24,3 +24,14 @@ pub enum Command {
|
|
|
|
/// Print the entire context available to templates
|
|
|
|
/// Print the entire context available to templates
|
|
|
|
Context,
|
|
|
|
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
|
|
|
|
|
|
|
|
}
|
|
|
|