orcs/command/init.rs
1use crate::{Error, Project};
2use clap::ArgMatches;
3use tracing::{info, instrument};
4
5#[instrument(skip(subcommand))]
6pub fn init(project_path: &str, subcommand: &ArgMatches) -> Result<(), Error> {
7 info!("Initialize project");
8 let template = subcommand.value_of("template");
9
10 match subcommand.value_of("name") {
11 Some(name) => Project::create(name, template),
12 None => Project::create(project_path, template),
13 }
14}