Fix command descriptions+examples (#5129)

* Fix exit usage

* Move dfr as-date* format examples to extra_usage

* Update command usage and examples

* More docs on `str trim`

Co-authored-by: sholderbach <sholderbach@users.noreply.github.com>
This commit is contained in:
Reilly Wood
2022-04-08 01:30:49 -07:00
committed by GitHub
parent 6b4cb8b0e0
commit d38a3a8b4e
39 changed files with 104 additions and 62 deletions

View File

@ -16,7 +16,7 @@ impl Command for RenameDF {
}
fn usage(&self) -> &str {
"rename a dataframe column"
"Rename a dataframe column"
}
fn signature(&self) -> Signature {

View File

@ -17,7 +17,11 @@ impl Command for AsDate {
}
fn usage(&self) -> &str {
r#"Converts string to date. Format example:
r#"Converts string to date."#
}
fn extra_usage(&self) -> &str {
r#"Format example:
"%Y-%m-%d" => 2021-12-31
"%d-%m-%Y" => 31-12-2021
"%Y%m%d" => 2021319 (2021-03-19)"#
@ -25,7 +29,7 @@ impl Command for AsDate {
fn signature(&self) -> Signature {
Signature::build(self.name())
.required("format", SyntaxShape::String, "formating date string")
.required("format", SyntaxShape::String, "formatting date string")
.switch("not-exact", "the format string may be contained in the date (e.g. foo-2021-01-01-bar could match 2021-01-01)", Some('n'))
.category(Category::Custom("dataframe".into()))
}

View File

@ -18,7 +18,11 @@ impl Command for AsDateTime {
}
fn usage(&self) -> &str {
r#"Converts string to datetime. Format example:
r#"Converts string to datetime."#
}
fn extra_usage(&self) -> &str {
r#"Format example:
"%y/%m/%d %H:%M:%S" => 21/12/31 12:54:98
"%y-%m-%d %H:%M:%S" => 2021-12-31 24:58:01
"%y/%m/%d %H:%M:%S" => 21/12/31 24:58:01
@ -34,7 +38,7 @@ impl Command for AsDateTime {
fn signature(&self) -> Signature {
Signature::build(self.name())
.required("format", SyntaxShape::String, "formating date time string")
.required("format", SyntaxShape::String, "formatting date time string")
.switch("not-exact", "the format string may be contained in the date (e.g. foo-2021-01-01-bar could match 2021-01-01)", Some('n'))
.category(Category::Custom("dataframe".into()))
}