diff --git a/README.md b/README.md index 24b75f0..8914b06 100644 --- a/README.md +++ b/README.md @@ -4,3 +4,10 @@ Clap template This is a kickstart ( https://github.com/Keats/kickstart ) template + +Usage: + +```shell +$ kickstart https://git.hatter.ink/hatter/clap-template.git +``` + diff --git a/template.toml b/template.toml index 6cb8ee4..00674aa 100644 --- a/template.toml +++ b/template.toml @@ -22,6 +22,17 @@ default = "my-cli" prompt = "What's the name of the executable?" validation = "^([a-zA-Z][a-zA-Z-_]+)$" +[[variables]] +name = "license" +default = "MIT" +prompt = "Which open-source license do you want to use?" +choices = [ + "MIT", + "BSD", + "GPLv3", + "None", +] + [[variables]] name = "description" default = "A CLI application" diff --git a/{{project_name}}/Cargo.toml b/{{project_name}}/Cargo.toml index 30e9446..478f19b 100644 --- a/{{project_name}}/Cargo.toml +++ b/{{project_name}}/Cargo.toml @@ -3,6 +3,10 @@ name = "{{project_name}}" version = "0.0.1" authors = ["Hatter Jiang "] edition = "2018" +{% if license != "None" -%} +license = "{{license}}" +{%- endif %} +description = "{{description}}" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/{{project_name}}/src/main.rs b/{{project_name}}/src/main.rs index 8b3c043..6765023 100644 --- a/{{project_name}}/src/main.rs +++ b/{{project_name}}/src/main.rs @@ -9,7 +9,7 @@ use cmd::{Command, CommandError}; fn main() -> CommandError { let commands: Vec> = vec![ - Box::new(cmd_test::CommandImpl) + Box::new(cmd_sample::CommandImpl) ]; let mut app = App::new(env!("CARGO_PKG_NAME")) .version(env!("CARGO_PKG_VERSION"))