feat: fix compike, add license, desc
This commit is contained in:
@@ -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
|
||||
```
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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"))
|
||||
|
||||
Reference in New Issue
Block a user