embargo_cpp/cli/
new.rs

1
2use clap::Args;
3
4use super::project_type::ProjectType;
5
6#[derive(Args, Debug)]
7pub struct NewArgs {
8    /// The name of the project to create. This will also be the name of the directory created.
9    name: String,
10
11    #[command(flatten)]
12    project_type: ProjectType,
13}
14
15impl NewArgs {
16
17    pub fn with_name(project_name: &str) -> Self {
18        let name = project_name.to_owned();
19        let project_type = ProjectType::default();
20        Self {
21            name,
22            project_type
23        }
24    }
25
26    pub fn name(&self) -> &str {
27        &self.name
28    }
29}