bricks/cli/init/
make_config.rs

1use anyhow::Result;
2
3use crate::cli::args::InitCommand;
4
5use super::templates;
6
7pub fn make_config(cmd: &InitCommand) -> Result<String> {
8    let kind = match cmd.lib {
9        true => "library",
10        false => "binary",
11    };
12
13    let lang = match cmd.cpp {
14        true => "cpp",
15        false => "c",
16    };
17
18    let edition = match cmd.cpp {
19        true => "c++17",
20        false => "c99",
21    };
22
23    Ok(templates::config(&cmd.name, kind, lang, edition))
24}