Changing clap settings (#624)
This commit is contained in:
parent
8a00a004d8
commit
38c883e1ef
|
@ -1,6 +1,6 @@
|
||||||
|
extern crate chrono;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate clap;
|
extern crate clap;
|
||||||
extern crate chrono;
|
|
||||||
extern crate env_logger;
|
extern crate env_logger;
|
||||||
extern crate error_chain;
|
extern crate error_chain;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
|
@ -38,7 +38,7 @@ fn main() {
|
||||||
.author("Mathieu David <mathieudavid@mathieudavid.org>")
|
.author("Mathieu David <mathieudavid@mathieudavid.org>")
|
||||||
// Get the version from our Cargo.toml using clap's crate_version!() macro
|
// Get the version from our Cargo.toml using clap's crate_version!() macro
|
||||||
.version(concat!("v",crate_version!()))
|
.version(concat!("v",crate_version!()))
|
||||||
.setting(AppSettings::SubcommandRequired)
|
.setting(AppSettings::ArgRequiredElseHelp)
|
||||||
.after_help("For more information about a specific command, \
|
.after_help("For more information about a specific command, \
|
||||||
try `mdbook <command> --help`\n\
|
try `mdbook <command> --help`\n\
|
||||||
Source code for mdbook available \
|
Source code for mdbook available \
|
||||||
|
@ -77,11 +77,14 @@ fn init_logger() {
|
||||||
let mut builder = Builder::new();
|
let mut builder = Builder::new();
|
||||||
|
|
||||||
builder.format(|formatter, record| {
|
builder.format(|formatter, record| {
|
||||||
writeln!(formatter, "{} [{}] ({}): {}",
|
writeln!(
|
||||||
Local::now().format("%Y-%m-%d %H:%M:%S"),
|
formatter,
|
||||||
record.level(),
|
"{} [{}] ({}): {}",
|
||||||
record.target(),
|
Local::now().format("%Y-%m-%d %H:%M:%S"),
|
||||||
record.args())
|
record.level(),
|
||||||
|
record.target(),
|
||||||
|
record.args()
|
||||||
|
)
|
||||||
});
|
});
|
||||||
|
|
||||||
if let Ok(var) = env::var("RUST_LOG") {
|
if let Ok(var) = env::var("RUST_LOG") {
|
||||||
|
|
Loading…
Reference in New Issue