mirror of
https://github.com/nushell/nushell.git
synced 2024-11-08 01:24:38 +01:00
Added search terms to math commands (#5224)
This commit is contained in:
parent
dd1d9b7623
commit
88ec4186ec
@ -18,6 +18,10 @@ impl Command for SubCommand {
|
||||
"Returns absolute values of a list of numbers"
|
||||
}
|
||||
|
||||
fn search_terms(&self) -> Vec<&str> {
|
||||
vec!["absolute", "modulus", "positive", "distance"]
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -20,6 +20,10 @@ impl Command for SubCommand {
|
||||
"Finds the average of a list of numbers or tables"
|
||||
}
|
||||
|
||||
fn search_terms(&self) -> Vec<&str> {
|
||||
vec!["average", "mean"]
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
_engine_state: &EngineState,
|
||||
|
@ -18,6 +18,10 @@ impl Command for SubCommand {
|
||||
"Applies the ceil function to a list of numbers"
|
||||
}
|
||||
|
||||
fn search_terms(&self) -> Vec<&str> {
|
||||
vec!["ceiling"]
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -17,6 +17,10 @@ impl Command for SubCommand {
|
||||
"Evaluate a math expression into a number"
|
||||
}
|
||||
|
||||
fn search_terms(&self) -> Vec<&str> {
|
||||
vec!["evaluation", "solve", "equation", "expression"]
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("math eval")
|
||||
.optional(
|
||||
|
@ -20,6 +20,10 @@ impl Command for SubCommand {
|
||||
"Finds the maximum within a list of numbers or tables"
|
||||
}
|
||||
|
||||
fn search_terms(&self) -> Vec<&str> {
|
||||
vec!["maximum", "largest"]
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
_engine_state: &EngineState,
|
||||
|
@ -22,6 +22,10 @@ impl Command for SubCommand {
|
||||
"Gets the median of a list of numbers"
|
||||
}
|
||||
|
||||
fn search_terms(&self) -> Vec<&str> {
|
||||
vec!["middle", "average"]
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
_engine_state: &EngineState,
|
||||
|
@ -20,6 +20,10 @@ impl Command for SubCommand {
|
||||
"Finds the minimum within a list of numbers or tables"
|
||||
}
|
||||
|
||||
fn search_terms(&self) -> Vec<&str> {
|
||||
vec!["minimum", "smallest"]
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
_engine_state: &EngineState,
|
||||
|
@ -43,6 +43,10 @@ impl Command for SubCommand {
|
||||
"Gets the most frequent element(s) from a list of numbers or tables"
|
||||
}
|
||||
|
||||
fn search_terms(&self) -> Vec<&str> {
|
||||
vec!["common", "often", "average"]
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
_engine_state: &EngineState,
|
||||
|
@ -20,6 +20,10 @@ impl Command for SubCommand {
|
||||
"Finds the product of a list of numbers or tables"
|
||||
}
|
||||
|
||||
fn search_terms(&self) -> Vec<&str> {
|
||||
vec!["times", "multiply", "x", "*"]
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
_engine_state: &EngineState,
|
||||
|
@ -28,6 +28,10 @@ impl Command for SubCommand {
|
||||
"Applies the round function to a list of numbers"
|
||||
}
|
||||
|
||||
fn search_terms(&self) -> Vec<&str> {
|
||||
vec!["approx", "rough"]
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -18,6 +18,10 @@ impl Command for SubCommand {
|
||||
"Applies the square root function to a list of numbers"
|
||||
}
|
||||
|
||||
fn search_terms(&self) -> Vec<&str> {
|
||||
vec!["square", "root"]
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -22,6 +22,10 @@ impl Command for SubCommand {
|
||||
"Finds the stddev of a list of numbers or tables"
|
||||
}
|
||||
|
||||
fn search_terms(&self) -> Vec<&str> {
|
||||
vec!["SD", "standard", "deviation", "dispersion", "variation"]
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
_engine_state: &EngineState,
|
||||
|
@ -20,6 +20,10 @@ impl Command for SubCommand {
|
||||
"Finds the sum of a list of numbers or tables"
|
||||
}
|
||||
|
||||
fn search_terms(&self) -> Vec<&str> {
|
||||
vec!["plus", "add", "+"]
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
_engine_state: &EngineState,
|
||||
|
Loading…
Reference in New Issue
Block a user