From 735845d86e6ab94891e421823158f374e2f3412a Mon Sep 17 00:00:00 2001 From: Geobert Quach Date: Tue, 10 Sep 2019 11:31:40 +0100 Subject: refactor(args): Switch to pico-args --- crates/ra_cli/src/help.rs | 96 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 crates/ra_cli/src/help.rs (limited to 'crates/ra_cli/src/help.rs') diff --git a/crates/ra_cli/src/help.rs b/crates/ra_cli/src/help.rs new file mode 100644 index 000000000..bf31472ac --- /dev/null +++ b/crates/ra_cli/src/help.rs @@ -0,0 +1,96 @@ +pub fn print_global_help() { + println!( + "ra-cli + +USAGE: + ra_cli + +FLAGS: + -h, --help Prints help information + +SUBCOMMANDS: + analysis-bench + analysis-stats + highlight + parse + symbols" + ) +} + +pub fn print_analysis_bench_help() { + println!( + "ra_cli-analysis-bench + +USAGE: + ra_cli analysis-bench [FLAGS] [OPTIONS] [PATH] + +FLAGS: + -h, --help Prints help information + -v, --verbose + +OPTIONS: + --complete Compute completions at this location + --highlight Hightlight this file + +ARGS: + Project to analyse" + ) +} + +pub fn print_analysis_stats_help() { + println!( + "ra-cli-analysis-stats + +USAGE: + ra_cli analysis-stats [FLAGS] [OPTIONS] [PATH] + +FLAGS: + -h, --help Prints help information + --memory-usage + -v, --verbose + +OPTIONS: + -o + +ARGS: + " + ) +} + +pub fn print_highlight_help() { + println!( + "ra-cli-highlight + +USAGE: + ra_cli highlight [FLAGS] + +FLAGS: + -h, --help Prints help information + -r, --rainbow" + ) +} + +pub fn print_symbols_help() { + println!( + "ra-cli-symbols + +USAGE: + ra_cli highlight [FLAGS] + +FLAGS: + -h, --help Prints help inforamtion" + ) +} + +pub fn print_parse_help() { + println!( + "ra-cli-parse + +USAGE: + ra_cli parse [FLAGS] + +FLAGS: + -h, --help Prints help inforamtion + --no-dump" + ) +} -- cgit v1.2.3 From aa894ace1fc4600dbc94bccb05532154ee2288d8 Mon Sep 17 00:00:00 2001 From: Geobert Quach Date: Tue, 10 Sep 2019 16:17:11 +0100 Subject: refactor(args): Apply comments --- crates/ra_cli/src/help.rs | 48 ++++++++++++----------------------------------- 1 file changed, 12 insertions(+), 36 deletions(-) (limited to 'crates/ra_cli/src/help.rs') diff --git a/crates/ra_cli/src/help.rs b/crates/ra_cli/src/help.rs index bf31472ac..5171578f0 100644 --- a/crates/ra_cli/src/help.rs +++ b/crates/ra_cli/src/help.rs @@ -1,6 +1,4 @@ -pub fn print_global_help() { - println!( - "ra-cli +pub const GLOBAL_HELP: &str = "ra-cli USAGE: ra_cli @@ -13,13 +11,9 @@ SUBCOMMANDS: analysis-stats highlight parse - symbols" - ) -} + symbols"; -pub fn print_analysis_bench_help() { - println!( - "ra_cli-analysis-bench +pub const ANALYSIS_BENCH_HELP: &str = "ra_cli-analysis-bench USAGE: ra_cli analysis-bench [FLAGS] [OPTIONS] [PATH] @@ -33,13 +27,9 @@ OPTIONS: --highlight Hightlight this file ARGS: - Project to analyse" - ) -} + Project to analyse"; -pub fn print_analysis_stats_help() { - println!( - "ra-cli-analysis-stats +pub const ANALYSIS_STATS_HELP: &str = "ra-cli-analysis-stats USAGE: ra_cli analysis-stats [FLAGS] [OPTIONS] [PATH] @@ -53,44 +43,30 @@ OPTIONS: -o ARGS: - " - ) -} + "; -pub fn print_highlight_help() { - println!( - "ra-cli-highlight +pub const HIGHLIGHT_HELP: &str = "ra-cli-highlight USAGE: ra_cli highlight [FLAGS] FLAGS: -h, --help Prints help information - -r, --rainbow" - ) -} + -r, --rainbow"; -pub fn print_symbols_help() { - println!( - "ra-cli-symbols +pub const SYMBOLS_HELP: &str = "ra-cli-symbols USAGE: ra_cli highlight [FLAGS] FLAGS: - -h, --help Prints help inforamtion" - ) -} + -h, --help Prints help inforamtion"; -pub fn print_parse_help() { - println!( - "ra-cli-parse +pub const PARSE_HELP: &str = "ra-cli-parse USAGE: ra_cli parse [FLAGS] FLAGS: -h, --help Prints help inforamtion - --no-dump" - ) -} + --no-dump"; -- cgit v1.2.3