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

@ -22,7 +22,7 @@ impl Command for SubCommand {
}
fn usage(&self) -> &str {
"gets the host of a url"
"Get the host of a URL"
}
fn run(

View File

@ -22,7 +22,7 @@ impl Command for SubCommand {
}
fn usage(&self) -> &str {
"gets the path of a url"
"Get the path of a URL"
}
fn run(

View File

@ -22,7 +22,7 @@ impl Command for SubCommand {
}
fn usage(&self) -> &str {
"gets the query of a url"
"Get the query string of a URL"
}
fn run(
@ -39,7 +39,7 @@ impl Command for SubCommand {
let span = Span::test_data();
vec![
Example {
description: "Get query of a url",
description: "Get a query string",
example: "echo 'http://www.example.com/?foo=bar&baz=quux' | url query",
result: Some(Value::String {
val: "foo=bar&baz=quux".to_string(),
@ -47,7 +47,7 @@ impl Command for SubCommand {
}),
},
Example {
description: "No query gives the empty string",
description: "Returns an empty string if there is no query string",
example: "echo 'http://www.example.com/' | url query",
result: Some(Value::String {
val: "".to_string(),

View File

@ -22,7 +22,7 @@ impl Command for SubCommand {
}
fn usage(&self) -> &str {
"gets the scheme (eg http, file) of a url"
"Get the scheme (e.g. http, file) of a URL"
}
fn run(
@ -39,7 +39,7 @@ impl Command for SubCommand {
let span = Span::test_data();
vec![
Example {
description: "Get scheme of a url",
description: "Get the scheme of a URL",
example: "echo 'http://www.example.com' | url scheme",
result: Some(Value::String {
val: "http".to_string(),