Add example for command n,g,p and grid, update date now examples (#4622)

This commit is contained in:
Justin Ma
2022-02-24 20:17:05 +08:00
committed by GitHub
parent 784382edde
commit c3979ef1cf
11 changed files with 191 additions and 14 deletions

View File

@ -35,10 +35,22 @@ impl Command for SubCommand {
}
fn examples(&self) -> Vec<Example> {
vec![Example {
description: "Get the current date and display it in a given format string.",
example: r#"date now | date format "%Y-%m-%d %H:%M:%S""#,
result: None,
}]
vec![
Example {
description: "Get the current date and display it in a given format string.",
example: r#"date now | date format "%Y-%m-%d %H:%M:%S""#,
result: None,
},
Example {
description: "Get the time duration from 2019-04-30 to now",
example: r#"(date now) - 2019-05-01"#,
result: None,
},
Example {
description: "Get the time duration since a more accurate time",
example: r#"(date now) - 2019-05-01T04:12:05.20+08:00"#,
result: None,
},
]
}
}