New {
#[arg(help = "Name of the new project")]
name: String,
#[arg(long, help = "Initialize a new local git repo")]
git: bool,
#[arg(long, default_value = "clang", help = "Which compiler to use")]
compiler: CppCompiler,
#[arg(
long,
default_value = "basic",
help = "What configuration file template to use"
)]
template: String,
},
the template argument is being parsed directly as an String.
We need a better way to do this, because the process will only recognize basic and partitions as strings, and if some other String is present, will always choose basic.
This will be much better handled by introducing an enumerated type, analogous for example, to the CppCompiler type, and aborting the process when an incorrect value for that parameter is passed.
Feature Request
Currently, in this code snippet:
the
template
argument is being parsed directly as an String.We need a better way to do this, because the process will only recognize
basic
andpartitions
as strings, and if some other String is present, will always choosebasic
.This will be much better handled by introducing an enumerated type, analogous for example, to the
CppCompiler
type, and aborting the process when an incorrect value for that parameter is passed.