feat: fix compike, add license, desc

This commit is contained in:
2020-11-21 23:18:26 +08:00
parent 9ce44ce6d5
commit 221cecd8f8
4 changed files with 23 additions and 1 deletions

View File

@@ -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
```

View File

@@ -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"

View File

@@ -3,6 +3,10 @@ name = "{{project_name}}"
version = "0.0.1"
authors = ["Hatter Jiang <jht5945@gmail.com>"]
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

View File

@@ -9,7 +9,7 @@ use cmd::{Command, CommandError};
fn main() -> CommandError {
let commands: Vec<Box<dyn Command>> = 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"))