From 47363c569278c08fbbf1b484e6af27740cd782eb Mon Sep 17 00:00:00 2001 From: Hatter Jiang Date: Sat, 21 Nov 2020 23:42:39 +0800 Subject: [PATCH] feat: add authors, bin --- template.toml | 10 ++++++++++ {{project_name}}/Cargo.toml | 6 +++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/template.toml b/template.toml index 00674aa..588f46a 100644 --- a/template.toml +++ b/template.toml @@ -22,6 +22,16 @@ default = "my-cli" prompt = "What's the name of the executable?" validation = "^([a-zA-Z][a-zA-Z-_]+)$" +[[variables]] +name = "author" +default = "No One" +prompt = "What is your name?" + +[[variables]] +name = "email" +default = "no@example.com" +prompt = "What is your email?" + [[variables]] name = "license" default = "MIT" diff --git a/{{project_name}}/Cargo.toml b/{{project_name}}/Cargo.toml index 478f19b..52ad13e 100644 --- a/{{project_name}}/Cargo.toml +++ b/{{project_name}}/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "{{project_name}}" version = "0.0.1" -authors = ["Hatter Jiang "] +authors = ["{{author}} <{{email}}>"] edition = "2018" {% if license != "None" -%} license = "{{license}}" @@ -10,6 +10,10 @@ description = "{{description}}" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[[bin]] +name = "{{bin}}" +path = "src/main.rs" + [dependencies] clap = "2.33" toml = "0.5"