feat: add search terms for conversions (#5259)

This commit is contained in:
Jae-Heon Ji 2022-04-21 01:48:32 +09:00 committed by GitHub
parent 09b972f1dc
commit e97ba9b74c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 36 additions and 0 deletions

View File

@ -21,6 +21,10 @@ impl Command for Fmt {
Signature::build("fmt").category(Category::Conversions)
}
fn search_terms(&self) -> Vec<&str> {
vec!["display", "render", "format"]
}
fn examples(&self) -> Vec<Example> {
vec![Example {
description: "Get a record containing multiple formats for the number 42",

View File

@ -28,6 +28,10 @@ impl Command for SubCommand {
"Convert value to a binary primitive"
}
fn search_terms(&self) -> Vec<&str> {
vec!["convert", "binary", "bytes", "bin"]
}
fn run(
&self,
engine_state: &EngineState,

View File

@ -27,6 +27,10 @@ impl Command for SubCommand {
"Convert value to boolean"
}
fn search_terms(&self) -> Vec<&str> {
vec!["convert", "boolean", "true", "false", "1", "0"]
}
fn run(
&self,
engine_state: &EngineState,

View File

@ -104,6 +104,10 @@ impl Command for SubCommand {
"Convert text into a datetime"
}
fn search_terms(&self) -> Vec<&str> {
vec!["convert", "date", "time", "timezone", "UTC"]
}
fn examples(&self) -> Vec<Example> {
vec![
Example {

View File

@ -25,6 +25,10 @@ impl Command for SubCommand {
"Convert text into a decimal"
}
fn search_terms(&self) -> Vec<&str> {
vec!["convert", "number", "floating"]
}
fn run(
&self,
engine_state: &EngineState,

View File

@ -28,6 +28,10 @@ impl Command for SubCommand {
"Convert value to duration"
}
fn search_terms(&self) -> Vec<&str> {
vec!["convert", "time", "period"]
}
fn run(
&self,
engine_state: &EngineState,

View File

@ -27,6 +27,10 @@ impl Command for SubCommand {
"Convert value to filesize"
}
fn search_terms(&self) -> Vec<&str> {
vec!["convert", "number", "size", "bytes"]
}
fn run(
&self,
engine_state: &EngineState,

View File

@ -33,6 +33,10 @@ impl Command for SubCommand {
"Convert value to integer"
}
fn search_terms(&self) -> Vec<&str> {
vec!["convert", "number", "natural"]
}
fn run(
&self,
engine_state: &EngineState,

View File

@ -37,6 +37,10 @@ impl Command for SubCommand {
"Convert value to string"
}
fn search_terms(&self) -> Vec<&str> {
vec!["convert", "str", "text"]
}
fn run(
&self,
engine_state: &EngineState,