1
0
mirror of https://github.com/lise-henry/crowbook synced 2024-09-30 00:43:44 +02:00

Improve the way --help is displayed

This commit is contained in:
Elisabeth Henry 2016-03-01 18:46:42 +01:00
parent 6e99258062
commit b310d762c5

@ -1,4 +1,4 @@
use clap::{App, Arg, AppSettings, Format, ArgMatches};
use clap::{App, Arg, Format, ArgMatches};
use std::io::{self, Write};
use std::process::exit;
use std::fs;
@ -83,12 +83,11 @@ USAGE:
pub fn create_matches<'a>() -> ArgMatches<'a> {
let app = App::new("crowbook")
.setting(AppSettings::UnifiedHelpMessage)
.version(env!("CARGO_PKG_VERSION"))
.about("Render a markdown book in Epub, PDF or HTML.")
.arg_from_usage("-s, --single 'Create a book from a single MarkDown file'")
.arg_from_usage("-s, --single 'Use a single Markdown file instead of a book configuration file'")
.arg_from_usage("-v, --verbose 'Print warnings in parsing/rendering'")
.arg_from_usage("-d, --debug 'Print additional information")
.arg_from_usage("-d, --debug 'Print debugging information'")
.arg_from_usage("--create [FILES]... 'Creates a new book with existing markdown files.'")
.arg(Arg::from_usage("-o, --output [FILE] 'Specifies output file.'")
.requires("to"))
@ -101,7 +100,7 @@ pub fn create_matches<'a>() -> ArgMatches<'a> {
.arg_from_usage("--print-template [TEMPLATE] 'Displays the default value of a template.'")
.arg(Arg::with_name("BOOK")
.index(1)
.help("File containing the book configuration."));
.help("File containing the book configuration, or a Markdown file when called with --single."));
let matches = app.get_matches();