From 548555c45e208a5f679165286af6d468c6a47ed9 Mon Sep 17 00:00:00 2001 From: Magnus Hoff Date: Wed, 1 Nov 2017 11:44:49 +0100 Subject: [PATCH] Populate clap with information from Cargo.toml --- Cargo.toml | 1 + src/main.rs | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b3cfcf3..302107d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "sausagewiki" version = "0.1.0" +description = "A wiki engine" authors = ["Magnus Hoff "] license = "GPL-3.0" diff --git a/src/main.rs b/src/main.rs index 1ca09bc..3000d44 100644 --- a/src/main.rs +++ b/src/main.rs @@ -45,8 +45,9 @@ const PORT: &str = "port"; fn args<'a>() -> clap::ArgMatches<'a> { use clap::{App, Arg}; - App::new("sausagewiki") - .about("A wiki engine") + App::new(env!("CARGO_PKG_NAME")) + .version(env!("CARGO_PKG_VERSION")) + .about(env!("CARGO_PKG_DESCRIPTION")) .arg(Arg::with_name(DATABASE) .help("Sets the database file to use") .required(true))