From 365f76ad19177b09fb59a258d8bb5d7cb98ae43d Mon Sep 17 00:00:00 2001 From: Chris Gillespie <6572184+gillespiecd@users.noreply.github.com> Date: Thu, 17 Sep 2020 23:13:53 -0700 Subject: [PATCH] Tidy up help command text (#2566) --- crates/nu-cli/src/commands/benchmark.rs | 10 +++++++++- crates/nu-cli/src/commands/clear.rs | 2 +- crates/nu-cli/src/commands/date/command.rs | 2 +- crates/nu-cli/src/commands/group_by.rs | 2 +- crates/nu-cli/src/commands/move_/command.rs | 2 +- crates/nu-cli/src/commands/run_external.rs | 10 +++++++++- crates/nu-cli/src/commands/sleep.rs | 2 +- crates/nu_plugin_match/src/nu/mod.rs | 2 +- 8 files changed, 24 insertions(+), 8 deletions(-) diff --git a/crates/nu-cli/src/commands/benchmark.rs b/crates/nu-cli/src/commands/benchmark.rs index a5776a3f9..d66354950 100644 --- a/crates/nu-cli/src/commands/benchmark.rs +++ b/crates/nu-cli/src/commands/benchmark.rs @@ -30,7 +30,7 @@ impl WholeStreamCommand for Benchmark { } fn usage(&self) -> &str { - "Runs a block and return the time it took to do execute it. Eg) benchmark { echo $nu.env.NAME }" + "Runs a block and returns the time it took to execute it" } async fn run( @@ -40,6 +40,14 @@ impl WholeStreamCommand for Benchmark { ) -> Result { benchmark(args, registry).await } + + fn examples(&self) -> Vec { + vec![Example { + description: "Benchmarks a command within a block", + example: "benchmark { sleep 500ms }", + result: None, + }] + } } async fn benchmark( diff --git a/crates/nu-cli/src/commands/clear.rs b/crates/nu-cli/src/commands/clear.rs index 5d7647018..574e9da36 100644 --- a/crates/nu-cli/src/commands/clear.rs +++ b/crates/nu-cli/src/commands/clear.rs @@ -17,7 +17,7 @@ impl WholeStreamCommand for Clear { } fn usage(&self) -> &str { - "clears the terminal" + "Clears the terminal" } async fn run(&self, _: CommandArgs, _: &CommandRegistry) -> Result { diff --git a/crates/nu-cli/src/commands/date/command.rs b/crates/nu-cli/src/commands/date/command.rs index 3867fd272..e1f09b0b6 100644 --- a/crates/nu-cli/src/commands/date/command.rs +++ b/crates/nu-cli/src/commands/date/command.rs @@ -16,7 +16,7 @@ impl WholeStreamCommand for Command { } fn usage(&self) -> &str { - "Work with dates." + "Apply date function" } async fn run( diff --git a/crates/nu-cli/src/commands/group_by.rs b/crates/nu-cli/src/commands/group_by.rs index d5449f04d..72063fe83 100644 --- a/crates/nu-cli/src/commands/group_by.rs +++ b/crates/nu-cli/src/commands/group_by.rs @@ -28,7 +28,7 @@ impl WholeStreamCommand for GroupBy { } fn usage(&self) -> &str { - "create a new table grouped." + "Create a new table grouped." } async fn run( diff --git a/crates/nu-cli/src/commands/move_/command.rs b/crates/nu-cli/src/commands/move_/command.rs index 739b3183e..f563a98c7 100644 --- a/crates/nu-cli/src/commands/move_/command.rs +++ b/crates/nu-cli/src/commands/move_/command.rs @@ -17,7 +17,7 @@ impl WholeStreamCommand for Command { } fn usage(&self) -> &str { - "moves across desired subcommand." + "Moves across desired subcommand." } async fn run( diff --git a/crates/nu-cli/src/commands/run_external.rs b/crates/nu-cli/src/commands/run_external.rs index 24e59845d..3ec215107 100644 --- a/crates/nu-cli/src/commands/run_external.rs +++ b/crates/nu-cli/src/commands/run_external.rs @@ -48,7 +48,15 @@ impl WholeStreamCommand for RunExternalCommand { } fn usage(&self) -> &str { - "" + "Runs external command (not a nushell builtin)" + } + + fn examples(&self) -> Vec { + vec![Example { + description: "Run the external echo command", + example: "run_external echo 'nushell'", + result: None, + }] } async fn run( diff --git a/crates/nu-cli/src/commands/sleep.rs b/crates/nu-cli/src/commands/sleep.rs index 1a5dab8a9..360fb9b44 100644 --- a/crates/nu-cli/src/commands/sleep.rs +++ b/crates/nu-cli/src/commands/sleep.rs @@ -37,7 +37,7 @@ impl WholeStreamCommand for Sleep { } fn usage(&self) -> &str { - "delay for a specified amount of time" + "Delay for a specified amount of time" } async fn run( diff --git a/crates/nu_plugin_match/src/nu/mod.rs b/crates/nu_plugin_match/src/nu/mod.rs index c0a39e510..3ecbcc768 100644 --- a/crates/nu_plugin_match/src/nu/mod.rs +++ b/crates/nu_plugin_match/src/nu/mod.rs @@ -10,7 +10,7 @@ use regex::Regex; impl Plugin for Match { fn config(&mut self) -> Result { Ok(Signature::build("match") - .desc("filter rows by regex") + .desc("Filter rows by Regex pattern") .required("member", SyntaxShape::String, "the column name to match") .required("regex", SyntaxShape::String, "the regex to match with") .filter())