refactor(main): use clap::crate_version instead of constant
This commit is contained in:
parent
6c598ba580
commit
dd20821ddc
@ -3,6 +3,7 @@
|
|||||||
extern crate clap;
|
extern crate clap;
|
||||||
extern crate handlebars;
|
extern crate handlebars;
|
||||||
extern crate ldap3;
|
extern crate ldap3;
|
||||||
|
#[macro_use] extern crate clap;
|
||||||
#[macro_use] extern crate rocket;
|
#[macro_use] extern crate rocket;
|
||||||
extern crate rocket_contrib;
|
extern crate rocket_contrib;
|
||||||
#[macro_use] extern crate serde_derive;
|
#[macro_use] extern crate serde_derive;
|
||||||
@ -19,12 +20,11 @@ use rocket::config::{Config, Environment};
|
|||||||
use crate::config::load_config;
|
use crate::config::load_config;
|
||||||
use crate::exit::exit_with_error;
|
use crate::exit::exit_with_error;
|
||||||
|
|
||||||
const VERSION: &str = "1.0";
|
|
||||||
const DEFAULT_CONFIG_FILE_PATH: &str = "/etc/webldappasswd/config.json";
|
const DEFAULT_CONFIG_FILE_PATH: &str = "/etc/webldappasswd/config.json";
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let matches = App::new("WebLDAPPasswd")
|
let matches = App::new("WebLDAPPasswd")
|
||||||
.version(VERSION)
|
.version(crate_version!())
|
||||||
.arg(Arg::with_name("config")
|
.arg(Arg::with_name("config")
|
||||||
.short("c")
|
.short("c")
|
||||||
.long("config")
|
.long("config")
|
||||||
|
Loading…
Reference in New Issue
Block a user