refactor(main): use clap::crate_version instead of constant

This commit is contained in:
Philipp Matthias Schaefer 2021-02-25 10:34:39 +01:00
parent 6c598ba580
commit dd20821ddc

View File

@ -3,6 +3,7 @@
extern crate clap;
extern crate handlebars;
extern crate ldap3;
#[macro_use] extern crate clap;
#[macro_use] extern crate rocket;
extern crate rocket_contrib;
#[macro_use] extern crate serde_derive;
@ -19,12 +20,11 @@ use rocket::config::{Config, Environment};
use crate::config::load_config;
use crate::exit::exit_with_error;
const VERSION: &str = "1.0";
const DEFAULT_CONFIG_FILE_PATH: &str = "/etc/webldappasswd/config.json";
fn main() {
let matches = App::new("WebLDAPPasswd")
.version(VERSION)
.version(crate_version!())
.arg(Arg::with_name("config")
.short("c")
.long("config")