From 4e94c467131a7685b0a0a52b372aa0dd76abba36 Mon Sep 17 00:00:00 2001 From: Geobert Quach Date: Tue, 10 Sep 2019 12:56:45 +0100 Subject: refactor(args): Switch to pico-args in ra_tools --- crates/ra_tools/src/help.rs | 56 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 crates/ra_tools/src/help.rs (limited to 'crates/ra_tools/src/help.rs') diff --git a/crates/ra_tools/src/help.rs b/crates/ra_tools/src/help.rs new file mode 100644 index 000000000..5bfe65734 --- /dev/null +++ b/crates/ra_tools/src/help.rs @@ -0,0 +1,56 @@ +pub fn print_global_help() { + println!( + "tasks + +USAGE: + ra_tools + +FLAGS: + -h, --help Prints help information + +SUBCOMMANDS: + format + format-hook + fuzz-tests + gen-syntax + gen-tests + install-ra + lint" + ) +} + +pub fn print_install_ra_help() { + println!( + "ra_tools-install-ra + +USAGE: + ra_tools.exe install-ra [FLAGS] + +FLAGS: + --client-code + -h, --help Prints help information + --jemalloc + --server" + ) +} + +pub fn print_no_param_subcommand_help(subcommand: &str) { + println!( + "ra_tools-{} + +USAGE: + ra_tools {} + +FLAGS: + -h, --help Prints help information", + subcommand, subcommand + ); +} + +pub fn print_install_ra_conflict() { + println!( + "error: The argument `--server` cannot be used with `--client-code` + +For more information try --help" + ) +} -- 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_tools/src/help.rs | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) (limited to 'crates/ra_tools/src/help.rs') diff --git a/crates/ra_tools/src/help.rs b/crates/ra_tools/src/help.rs index 5bfe65734..6dde6c2d2 100644 --- a/crates/ra_tools/src/help.rs +++ b/crates/ra_tools/src/help.rs @@ -1,6 +1,4 @@ -pub fn print_global_help() { - println!( - "tasks +pub const GLOBAL_HELP: &str = "tasks USAGE: ra_tools @@ -15,13 +13,9 @@ SUBCOMMANDS: gen-syntax gen-tests install-ra - lint" - ) -} + lint"; -pub fn print_install_ra_help() { - println!( - "ra_tools-install-ra +pub const INSTALL_RA_HELP: &str = "ra_tools-install-ra USAGE: ra_tools.exe install-ra [FLAGS] @@ -30,12 +24,10 @@ FLAGS: --client-code -h, --help Prints help information --jemalloc - --server" - ) -} + --server"; pub fn print_no_param_subcommand_help(subcommand: &str) { - println!( + eprintln!( "ra_tools-{} USAGE: @@ -47,10 +39,7 @@ FLAGS: ); } -pub fn print_install_ra_conflict() { - println!( - "error: The argument `--server` cannot be used with `--client-code` +pub const INSTALL_RA_CONFLICT: &str = + "error: The argument `--server` cannot be used with `--client-code` -For more information try --help" - ) -} +For more information try --help"; -- cgit v1.2.3