diff options
author | Canop <cano.petrole@gmail.com> | 2020-02-05 11:18:20 +0100 |
---|---|---|
committer | Canop <cano.petrole@gmail.com> | 2020-02-05 11:18:20 +0100 |
commit | 0c69639457ec33e510c74df80799455d6b69d181 (patch) | |
tree | 375a90b012c1ab4440f148cdd53220abd3c25aec /src/clap.rs | |
parent | b9d0d8ac2bc4b42903406bfa3a9e7183f12d4ab4 (diff) |
several small flags related improvements
Diffstat (limited to 'src/clap.rs')
-rw-r--r-- | src/clap.rs | 166 |
1 files changed, 98 insertions, 68 deletions
diff --git a/src/clap.rs b/src/clap.rs index 9b5b271..ec3d191 100644 --- a/src/clap.rs +++ b/src/clap.rs @@ -12,25 +12,9 @@ pub fn clap_app() -> clap::App<'static, 'static> { .author("dystroy <denys.seguret@gmail.com>") .about("Balanced tree view + fuzzy search + BFS + customizable launcher") .arg(clap::Arg::with_name("root").help("sets the root directory")) - .arg( - clap::Arg::with_name("cmd_export_path") - .long("outcmd") - .takes_value(true) - .help("Where to write the produced cmd (if any)"), - ) - .arg( - clap::Arg::with_name("commands") - .short("c") - .long("cmd") - .takes_value(true) - .help("Semicolon separated commands to execute (experimental)"), - ) - .arg( - clap::Arg::with_name("conf") - .long("conf") - .takes_value(true) - .help("Semicolon separated paths to specific config files"), - ) + + // tree flags + .arg( clap::Arg::with_name("dates") .short("d") @@ -44,29 +28,28 @@ pub fn clap_app() -> clap::App<'static, 'static> { .help("Don't show last modified date"), ) .arg( - clap::Arg::with_name("file_export_path") - .short("o") - .long("out") - .takes_value(true) - .help("Where to write the produced path (if any)"), + clap::Arg::with_name("only-folders") + .short("f") + .long("only-folders") + .help("Only show folders"), ) .arg( - clap::Arg::with_name("show-gitignored") - .short("i") - .long("show-gitignored") - .help("Show files which should be ignored according to git"), + clap::Arg::with_name("no-only-folders") + .short("F") + .long("no-only-folders") + .help("Show folders and files alike"), ) .arg( - clap::Arg::with_name("no-show-gitignored") - .short("I") - .long("no-show-gitignored") - .help("Don't show gitignored files"), + clap::Arg::with_name("show-git-info") + .short("g") + .long("show-git-info") + .help("Show git statuses on files and stats on repo"), ) .arg( - clap::Arg::with_name("height") - .long("height") - .help("Height (if you don't want to fill the screen or for file export)") - .takes_value(true), + clap::Arg::with_name("no-show-git-info") + .short("G") + .long("no-show-git-info") + .help("Don't show git statuses on files"), ) .arg( clap::Arg::with_name("hidden") @@ -81,26 +64,16 @@ pub fn clap_app() -> clap::App<'static, 'static> { .help("Show hidden files"), ) .arg( - clap::Arg::with_name("install") - .long("install") - .help("Install or reinstall the br shell function"), - ) - .arg( - clap::Arg::with_name("no-style") - .long("no-style") - .help("Whether to remove all style and colors"), - ) - .arg( - clap::Arg::with_name("only-folders") - .short("f") - .long("only-folders") - .help("Only show folders"), + clap::Arg::with_name("show-gitignored") + .short("i") + .long("show-gitignored") + .help("Show files which should be ignored according to git"), ) .arg( - clap::Arg::with_name("no-only-folders") - .short("F") - .long("no-only-folders") - .help("Show folders and files alike"), + clap::Arg::with_name("no-show-gitignored") + .short("I") + .long("no-show-gitignored") + .help("Don't show gitignored files"), ) .arg( clap::Arg::with_name("permissions") @@ -115,10 +88,79 @@ pub fn clap_app() -> clap::App<'static, 'static> { .help("Don't show permissions"), ) .arg( + clap::Arg::with_name("sizes") + .short("s") + .long("sizes") + .help("Show the size of files and directories"), + ) + .arg( + clap::Arg::with_name("no-sizes") + .short("S") + .long("no-sizes") + .help("Don't show sizes"), + ) + .arg( + clap::Arg::with_name("trim-root") + .short("t") + .long("trim-root") + .help("Trim the root too and don't show a scrollbar"), + ) + .arg( + clap::Arg::with_name("no-trim-root") + .short("T") + .long("no-trim-root") + .help("Don't trim the root level, show a scrollbar"), + ) + + // other options + + .arg( + clap::Arg::with_name("cmd-export-path") + .long("outcmd") + .takes_value(true) + .help("Where to write the produced cmd (if any)"), + ) + .arg( + clap::Arg::with_name("commands") + .short("c") + .long("cmd") + .takes_value(true) + .help("Semicolon separated commands to execute (experimental)"), + ) + .arg( + clap::Arg::with_name("conf") + .long("conf") + .takes_value(true) + .help("Semicolon separated paths to specific config files"), + ) + .arg( + clap::Arg::with_name("file-export-path") + .short("o") + .long("out") + .takes_value(true) + .help("Where to write the produced path (if any)"), + ) + .arg( + clap::Arg::with_name("height") + .long("height") + .help("Height (if you don't want to fill the screen or for file export)") + .takes_value(true), + ) + .arg( + clap::Arg::with_name("install") + .long("install") + .help("Install or reinstall the br shell function"), + ) + .arg( + clap::Arg::with_name("no-style") + .long("no-style") + .help("Whether to remove all style and colors"), + ) + .arg( clap::Arg::with_name("set-install-state") .long("set-install-state") .takes_value(true) - .value_name("STATE") + .value_name("state") .possible_values(&["undefined", "refused", "installed"]) .help("Set the installation state (for use in install script)"), ) @@ -126,20 +168,8 @@ pub fn clap_app() -> clap::App<'static, 'static> { clap::Arg::with_name("print-shell-function") .long("print-shell-function") .takes_value(true) - .value_name("SHELL") + .value_name("shell") .help("Print to stdout the br function for a given shell"), ) - .arg( - clap::Arg::with_name("sizes") - .short("s") - .long("sizes") - .help("Show the size of files and directories"), - ) - .arg( - clap::Arg::with_name("no-sizes") - .short("S") - .long("no-sizes") - .help("Don't show sizes"), - ) .setting(clap::AppSettings::DeriveDisplayOrder) } |