Re-structure '--help' text

This commit is contained in:
sharkdp 2017-10-03 19:30:39 +02:00
parent 4b61beaa75
commit 7399558a06

View file

@ -360,14 +360,6 @@ fn main() {
.usage("fd [FLAGS/OPTIONS] [<pattern>] [<path>]") .usage("fd [FLAGS/OPTIONS] [<pattern>] [<path>]")
.setting(AppSettings::ColoredHelp) .setting(AppSettings::ColoredHelp)
.setting(AppSettings::DeriveDisplayOrder) .setting(AppSettings::DeriveDisplayOrder)
.arg(Arg::with_name("case-sensitive")
.long("case-sensitive")
.short("s")
.help("Case-sensitive search (default: smart case)"))
.arg(Arg::with_name("full-path")
.long("full-path")
.short("p")
.help("Search full path (default: file-/dirname only)"))
.arg(Arg::with_name("hidden") .arg(Arg::with_name("hidden")
.long("hidden") .long("hidden")
.short("H") .short("H")
@ -376,55 +368,67 @@ fn main() {
.long("no-ignore") .long("no-ignore")
.short("I") .short("I")
.help("Do not respect .(git)ignore files")) .help("Do not respect .(git)ignore files"))
.arg(Arg::with_name("follow") .arg(Arg::with_name("case-sensitive")
.long("follow") .long("case-sensitive")
.short("L") .short("s")
.help("Follow symlinks") .help("Case-sensitive search (default: smart case)"))
.alias("dereference"))
.arg(Arg::with_name("null_separator")
.long("print0")
.short("0")
.help("Separate results by the null character"))
.arg(Arg::with_name("absolute-path") .arg(Arg::with_name("absolute-path")
.long("absolute-path") .long("absolute-path")
.short("a") .short("a")
.help("Show absolute instead of relative paths")) .help("Show absolute instead of relative paths"))
.arg(Arg::with_name("color") .arg(Arg::with_name("follow")
.long("color") .long("follow")
.short("c") .short("L")
.takes_value(true) .alias("dereference")
.possible_values(&["never", "auto", "always"]) .help("Follow symbolic links"))
.help("When to use color in the output. The default is auto.")) .arg(Arg::with_name("full-path")
.long("full-path")
.short("p")
.help("Search full path (default: file-/dirname only)"))
.arg(Arg::with_name("null_separator")
.long("print0")
.short("0")
.help("Separate results by the null character"))
.arg(Arg::with_name("depth") .arg(Arg::with_name("depth")
.long("max-depth") .long("max-depth")
.short("d") .short("d")
.takes_value(true) .takes_value(true)
.help("Set maximum search depth (default: none)")) .help("Set maximum search depth (default: none)"))
.arg(Arg::with_name("file-type")
.long("type")
.short("t")
.takes_value(true)
.possible_values(&["f", "file", "d", "directory", "s", "symlink"])
.hide_possible_values(true)
.help("Filter by type: f(ile), d(irectory), s(ymlink)"))
.arg(Arg::with_name("extension")
.long("extension")
.short("e")
.takes_value(true)
.value_name("ext")
.help("Filter by file extension"))
.arg(Arg::with_name("color")
.long("color")
.short("c")
.takes_value(true)
.possible_values(&["never", "auto", "always"])
.hide_possible_values(true)
.help("When to use color in the output:\n\
never, auto, always (default: auto)"))
.arg(Arg::with_name("threads") .arg(Arg::with_name("threads")
.long("threads") .long("threads")
.short("j") .short("j")
.takes_value(true) .takes_value(true)
.help("The number of threads used for searching")) .help("Set number of threads to use for searching"))
.arg(Arg::with_name("max-buffer-time") .arg(Arg::with_name("max-buffer-time")
.long("max-buffer-time") .long("max-buffer-time")
.takes_value(true) .takes_value(true)
.help("the time (in ms) to buffer, before streaming to the console") .hidden(true)
.hidden(true)) .help("the time (in ms) to buffer, before streaming to the console"))
.arg(Arg::with_name("pattern") .arg(Arg::with_name("pattern")
.help("the search pattern, a regular expression (optional)")) .help("the search pattern, a regular expression (optional)"))
.arg(Arg::with_name("path") .arg(Arg::with_name("path")
.help("the root directory for the filesystem search (optional)")) .help("the root directory for the filesystem search (optional)"))
.arg(Arg::with_name("file-type")
.help("The type of file to search for")
.long("type")
.short("t")
.takes_value(true)
.possible_values(&["f", "file", "d", "directory", "s", "symlink"]))
.arg(Arg::with_name("extension")
.help("The file extension to search for")
.long("extension")
.short("e")
.takes_value(true))
.get_matches(); .get_matches();
// Get the search pattern // Get the search pattern