feat: add search terms to date (#5306)

* add search terms

* add search terms

* add search terms

* add search terms

* add search terms

* add search terms

* add search terms

* add search terms

* add search patterns

* run cargo fmt --all
This commit is contained in:
Abdulqudduus Babalola
2022-04-23 14:54:03 +01:00
committed by GitHub
parent b9eb213f36
commit 667eb27d1b
17 changed files with 107 additions and 0 deletions

View File

@ -21,6 +21,20 @@ impl Command for Date {
"Date-related commands"
}
fn search_terms(&self) -> Vec<&str> {
vec![
"date",
"time",
"now",
"today",
"tomorrow",
"yesterday",
"weekday",
"weekday_name",
"timezone",
]
}
fn run(
&self,
engine_state: &EngineState,

View File

@ -31,6 +31,10 @@ impl Command for SubCommand {
"Format a given date using a format string."
}
fn search_terms(&self) -> Vec<&str> {
vec!["date", "format", "strftime"]
}
fn run(
&self,
engine_state: &EngineState,

View File

@ -20,6 +20,21 @@ impl Command for SubCommand {
"Print a 'humanized' format for the date, relative to now."
}
fn search_terms(&self) -> Vec<&str> {
vec![
"date",
"humanize",
"relative",
"now",
"today",
"tomorrow",
"yesterday",
"weekday",
"weekday_name",
"timezone",
]
}
fn run(
&self,
engine_state: &EngineState,

View File

@ -21,6 +21,10 @@ impl Command for SubCommand {
"List supported time zones."
}
fn search_terms(&self) -> Vec<&str> {
vec!["UTC", "GMT", "timezone", "list", "list-timezone"]
}
fn run(
&self,
engine_state: &EngineState,

View File

@ -18,6 +18,10 @@ impl Command for SubCommand {
"Get the current date."
}
fn search_terms(&self) -> Vec<&str> {
vec!["date", "now", "present", "current-time"]
}
fn run(
&self,
_engine_state: &EngineState,

View File

@ -22,6 +22,10 @@ impl Command for SubCommand {
"Convert the date into a structured table."
}
fn search_terms(&self) -> Vec<&str> {
vec!["date", "to", "record", "structured", "table"]
}
fn run(
&self,
engine_state: &EngineState,

View File

@ -22,6 +22,10 @@ impl Command for SubCommand {
"Convert the date into a structured table."
}
fn search_terms(&self) -> Vec<&str> {
vec!["date", "to", "record", "structured", "table"]
}
fn run(
&self,
engine_state: &EngineState,

View File

@ -32,6 +32,20 @@ impl Command for SubCommand {
"Use 'date list-timezone' to list all supported time zones."
}
fn search_terms(&self) -> Vec<&str> {
vec![
"date",
"to",
"timezone",
"transform",
"convert",
"UTC",
"GMT",
"list",
"list-timezone",
]
}
fn run(
&self,
engine_state: &EngineState,