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

Clean help message

This commit is contained in:
Elisabeth Henry 2016-03-01 20:29:11 +01:00
parent f0600a1f3f
commit 7ca0b8f26a

@ -74,10 +74,7 @@ lang: en
} }
exit(0); exit(0);
} else { } else {
print_error("--create must be used with a list of additonal files. unreachable!(); // because Clap takes care of it
USAGE:
\tcrowbook [BOOK] --create <MARKDOWN_FILES>");
} }
} }
@ -87,20 +84,21 @@ pub fn create_matches<'a>() -> ArgMatches<'a> {
.about("Render a markdown book in Epub, PDF or HTML.") .about("Render a markdown book in Epub, PDF or HTML.")
.arg_from_usage("-s, --single 'Use a single Markdown file instead of a book configuration 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("-v, --verbose 'Print warnings in parsing/rendering'")
.arg_from_usage("-d, --debug 'Print debugging information'") .arg(Arg::from_usage("-d, --debug 'Print debugging information'")
.arg_from_usage("--create [FILES]... 'Creates a new book with existing markdown files.'") .hidden(true))
.arg(Arg::from_usage("-o, --output [FILE] 'Specifies output file.'") .arg_from_usage("-c, --create [FILES]... 'Creates a new book with existing markdown files'")
.arg(Arg::from_usage("-o, --output [FILE] 'Specifies output file'")
.requires("to")) .requires("to"))
.arg(Arg::from_usage("-t, --to [FORMAT] 'Generate specific format'") .arg(Arg::from_usage("-t, --to [FORMAT] 'Generate specific format")
.possible_values(&["epub", "pdf", "html", "tex", "odt"])) .possible_values(&["epub", "pdf", "html", "tex", "odt"]))
.arg(Arg::from_usage("--set [KEY_VALUES] 'Sets a list of book options'") .arg(Arg::from_usage("--set [KEY_VALUES] 'Sets a list of book options'")
.min_values(2)) .min_values(2))
.arg(Arg::from_usage("-l --list-options 'Lists all possible options")) .arg(Arg::from_usage("-l --list-options 'Lists all possible options"))
.arg_from_usage("--list-options-md 'List all options, formatted in Markdown.'") .arg_from_usage("--list-options-md 'List all options, formatted in Markdown'")
.arg_from_usage("--print-template [TEMPLATE] 'Displays the default value of a template.'") .arg_from_usage("--print-template [TEMPLATE] 'Displays the default value of a template'")
.arg(Arg::with_name("BOOK") .arg(Arg::with_name("BOOK")
.index(1) .index(1)
.help("File containing the book configuration, or a Markdown file when called with --single.")); .help("File containing the book configuration, or a Markdown file when called with --single"));
let matches = app.get_matches(); let matches = app.get_matches();