diff --git a/crates/nu-command/src/network/http/delete.rs b/crates/nu-command/src/network/http/delete.rs index 77fb1fb9d1..8da8321ee3 100644 --- a/crates/nu-command/src/network/http/delete.rs +++ b/crates/nu-command/src/network/http/delete.rs @@ -27,55 +27,55 @@ impl Command for HttpDelete { .named( "user", SyntaxShape::Any, - "the username when authenticating", + "The username when authenticating.", Some('u'), ) .named( "password", SyntaxShape::Any, - "the password when authenticating", + "The password when authenticating.", Some('p'), ) - .named("data", SyntaxShape::Any, "the content to post", Some('d')) + .named("data", SyntaxShape::Any, "The content to post.", Some('d')) .named( "content-type", SyntaxShape::Any, - "the MIME type of content to post", + "The MIME type of content to post.", Some('t'), ) .named( "max-time", SyntaxShape::Duration, - "max duration before timeout occurs", + "Max duration before timeout occurs.", Some('m'), ) .named( "headers", SyntaxShape::Any, - "custom headers you want to add ", + "Custom headers you want to add.", Some('H'), ) .switch( "raw", - "fetch contents as text rather than a table", + "Fetch contents as text rather than a table.", Some('r'), ) .switch( "insecure", - "allow insecure server connections when using SSL", + "Allow insecure server connections when using SSL.", Some('k'), ) .switch( "full", - "returns the full response instead of only the body", + "Returns the full response instead of only the body.", Some('f'), ) .switch( "allow-errors", - "do not fail if the server returns an error code", + "Do not fail if the server returns an error code.", Some('e'), ) - .switch("pool", "using a global pool as a client", None) + .switch("pool", "Using a global pool as a client.", None) .param( Flag::new("redirect-mode") .short('R') @@ -117,37 +117,37 @@ impl Command for HttpDelete { fn examples(&self) -> Vec> { vec![ Example { - description: "http delete from example.com", + description: "HTTP delete from example.com.", example: "http delete https://www.example.com", result: None, }, Example { - description: "http delete from example.com, with username and password", + description: "HTTP delete from example.com, with username and password.", example: "http delete --user myuser --password mypass https://www.example.com", result: None, }, Example { - description: "http delete from example.com, with custom header using a record", + description: "HTTP delete from example.com, with custom header using a record.", example: "http delete --headers {my-header-key: my-header-value} https://www.example.com", result: None, }, Example { - description: "http delete from example.com, with custom header using a list", + description: "HTTP delete from example.com, with custom header using a list.", example: "http delete --headers [my-header-key-A my-header-value-A my-header-key-B my-header-value-B] https://www.example.com", result: None, }, Example { - description: "http delete from example.com, with body", + description: "HTTP delete from example.com, with body.", example: "http delete --data 'body' https://www.example.com", result: None, }, Example { - description: "http delete from example.com, with JSON body", + description: "HTTP delete from example.com, with JSON body.", example: "http delete --content-type application/json --data { field: value } https://www.example.com", result: None, }, Example { - description: "Perform an HTTP delete with JSON content from a pipeline to example.com", + description: "Perform an HTTP delete with JSON content from a pipeline to example.com.", example: "open foo.json | http delete https://www.example.com", result: None, }, diff --git a/crates/nu-command/src/network/http/get.rs b/crates/nu-command/src/network/http/get.rs index ec7779f75b..c96eb5551b 100644 --- a/crates/nu-command/src/network/http/get.rs +++ b/crates/nu-command/src/network/http/get.rs @@ -28,48 +28,48 @@ impl Command for HttpGet { .named( "user", SyntaxShape::Any, - "the username when authenticating", + "The username when authenticating.", Some('u'), ) .named( "password", SyntaxShape::Any, - "the password when authenticating", + "The password when authenticating.", Some('p'), ) .named( "max-time", SyntaxShape::Duration, - "max duration before timeout occurs", + "Max duration before timeout occurs.", Some('m'), ) .named( "headers", SyntaxShape::Any, - "custom headers you want to add ", + "Custom headers you want to add.", Some('H'), ) .switch( "raw", - "fetch contents as text rather than a table", + "Fetch contents as text rather than a table.", Some('r'), ) .switch( "insecure", - "allow insecure server connections when using SSL", + "Allow insecure server connections when using SSL.", Some('k'), ) .switch( "full", - "returns the full response instead of only the body", + "Returns the full response instead of only the body.", Some('f'), ) .switch( "allow-errors", - "do not fail if the server returns an error code", + "Do not fail if the server returns an error code.", Some('e'), ) - .switch("pool", "using a global pool as a client", None) + .switch("pool", "Using a global pool as a client.", None) .param( Flag::new("redirect-mode") .short('R') @@ -113,37 +113,37 @@ impl Command for HttpGet { fn examples(&self) -> Vec> { vec![ Example { - description: "Get content from example.com", + description: "Get content from example.com.", example: "http get https://www.example.com", result: None, }, Example { - description: "Get content from example.com, with username and password", + description: "Get content from example.com, with username and password.", example: "http get --user myuser --password mypass https://www.example.com", result: None, }, Example { - description: "Get content from example.com, with custom header using a record", + description: "Get content from example.com, with custom header using a record.", example: "http get --headers {my-header-key: my-header-value} https://www.example.com", result: None, }, Example { - description: "Get content from example.com, with custom headers using a list", + description: "Get content from example.com, with custom headers using a list.", example: "http get --headers [my-header-key-A my-header-value-A my-header-key-B my-header-value-B] https://www.example.com", result: None, }, Example { - description: "Get the response status code", + description: "Get the response status code.", example: r#"http get https://www.example.com | metadata | get http_response.status"#, result: None, }, Example { - description: "Check response status while streaming", + description: "Check response status while streaming.", example: r#"http get --allow-errors https://example.com/file | metadata access {|m| if $m.http_response.status != 200 { error make {msg: "failed"} } else { } } | lines"#, result: None, }, Example { - description: "Get from Docker daemon via Unix socket", + description: "Get from Docker daemon via Unix socket.", example: "http get --unix-socket /var/run/docker.sock http://localhost/containers/json", result: None, }, diff --git a/crates/nu-command/src/network/http/head.rs b/crates/nu-command/src/network/http/head.rs index b08e833f7c..e2a3d32368 100644 --- a/crates/nu-command/src/network/http/head.rs +++ b/crates/nu-command/src/network/http/head.rs @@ -27,33 +27,33 @@ impl Command for HttpHead { .named( "user", SyntaxShape::Any, - "the username when authenticating", + "The username when authenticating.", Some('u'), ) .named( "password", SyntaxShape::Any, - "the password when authenticating", + "The password when authenticating.", Some('p'), ) .named( "max-time", SyntaxShape::Duration, - "max duration before timeout occurs", + "Max duration before timeout occurs.", Some('m'), ) .named( "headers", SyntaxShape::Any, - "custom headers you want to add ", + "Custom headers you want to add.", Some('H'), ) .switch( "insecure", - "allow insecure server connections when using SSL", + "Allow insecure server connections when using SSL.", Some('k'), ) - .switch("pool", "using a global pool as a client", None) + .switch("pool", "Using a global pool as a client.", None) .param( Flag::new("redirect-mode") .short('R') @@ -95,22 +95,22 @@ impl Command for HttpHead { fn examples(&self) -> Vec> { vec![ Example { - description: "Get headers from example.com", + description: "Get headers from example.com.", example: "http head https://www.example.com", result: None, }, Example { - description: "Get headers from example.com, with username and password", + description: "Get headers from example.com, with username and password.", example: "http head --user myuser --password mypass https://www.example.com", result: None, }, Example { - description: "Get headers from example.com, with custom header using a record", + description: "Get headers from example.com, with custom header using a record.", example: "http head --headers {my-header-key: my-header-value} https://www.example.com", result: None, }, Example { - description: "Get headers from example.com, with custom header using a list", + description: "Get headers from example.com, with custom header using a list.", example: "http head --headers [my-header-key-A my-header-value-A my-header-key-B my-header-value-B] https://www.example.com", result: None, }, diff --git a/crates/nu-command/src/network/http/http_.rs b/crates/nu-command/src/network/http/http_.rs index a2dd8218d5..0bca1b4efa 100644 --- a/crates/nu-command/src/network/http/http_.rs +++ b/crates/nu-command/src/network/http/http_.rs @@ -30,42 +30,42 @@ impl Command for Http { .named( "content-type", SyntaxShape::Any, - "the MIME type of content to post", + "The MIME type of content to post.", Some('t'), ) // common .named( "user", SyntaxShape::Any, - "the username when authenticating", + "The username when authenticating.", Some('u'), ) .named( "password", SyntaxShape::Any, - "the password when authenticating", + "The password when authenticating.", Some('p'), ) .named( "max-time", SyntaxShape::Duration, - "max duration before timeout occurs", + "Max duration before timeout occurs.", Some('m'), ) .named( "headers", SyntaxShape::Any, - "custom headers you want to add ", + "Custom headers you want to add.", Some('H'), ) .switch( "raw", - "fetch contents as text rather than a table", + "Fetch contents as text rather than a table.", Some('r'), ) .switch( "insecure", - "allow insecure server connections when using SSL", + "Allow insecure server connections when using SSL.", Some('k'), ) .switch( @@ -82,7 +82,7 @@ impl Command for Http { ) .switch( "allow-errors", - "do not fail if the server returns an error code", + "Do not fail if the server returns an error code.", Some('e'), ) .param( @@ -154,17 +154,17 @@ impl Command for Http { fn examples(&self) -> Vec> { vec![ Example { - description: "Get content from example.com with default verb", + description: "Get content from example.com with default verb.", example: "http https://www.example.com", result: None, }, Example { - description: "Post content to example.com with default verb", + description: "Post content to example.com with default verb.", example: "http https://www.example.com 'body'", result: None, }, Example { - description: "Get content from example.com with explicit verb", + description: "Get content from example.com with explicit verb.", example: "http get https://www.example.com", result: None, }, diff --git a/crates/nu-command/src/network/http/options.rs b/crates/nu-command/src/network/http/options.rs index d3d71c8d2d..a6511f13a3 100644 --- a/crates/nu-command/src/network/http/options.rs +++ b/crates/nu-command/src/network/http/options.rs @@ -25,38 +25,38 @@ impl Command for HttpOptions { .named( "user", SyntaxShape::Any, - "the username when authenticating", + "The username when authenticating.", Some('u'), ) .named( "password", SyntaxShape::Any, - "the password when authenticating", + "The password when authenticating.", Some('p'), ) .named( "max-time", SyntaxShape::Duration, - "max duration before timeout occurs", + "Max duration before timeout occurs.", Some('m'), ) .named( "headers", SyntaxShape::Any, - "custom headers you want to add ", + "Custom headers you want to add.", Some('H'), ) .switch( "insecure", - "allow insecure server connections when using SSL", + "Allow insecure server connections when using SSL.", Some('k'), ) .switch( "allow-errors", - "do not fail if the server returns an error code", + "Do not fail if the server returns an error code.", Some('e'), ) - .switch("pool", "using a global pool as a client", None) + .switch("pool", "Using a global pool as a client.", None) .filter() .category(Category::Network); @@ -88,27 +88,27 @@ impl Command for HttpOptions { fn examples(&self) -> Vec> { vec![ Example { - description: "Get options from example.com", + description: "Get options from example.com.", example: "http options https://www.example.com", result: None, }, Example { - description: "Get options from example.com, with username and password", + description: "Get options from example.com, with username and password.", example: "http options --user myuser --password mypass https://www.example.com", result: None, }, Example { - description: "Get options from example.com, with custom header using a record", + description: "Get options from example.com, with custom header using a record.", example: "http options --headers {my-header-key: my-header-value} https://www.example.com", result: None, }, Example { - description: "Get options from example.com, with custom headers using a list", + description: "Get options from example.com, with custom headers using a list.", example: "http options --headers [my-header-key-A my-header-value-A my-header-key-B my-header-value-B] https://www.example.com", result: None, }, Example { - description: "Simulate a browser cross-origin preflight request from www.example.com to media.example.com", + description: "Simulate a browser cross-origin preflight request from www.example.com to media.example.com.", example: "http options https://media.example.com/api/ --headers [Origin https://www.example.com Access-Control-Request-Headers \"Content-Type, X-Custom-Header\" Access-Control-Request-Method GET]", result: None, }, diff --git a/crates/nu-command/src/network/http/patch.rs b/crates/nu-command/src/network/http/patch.rs index 196094182e..b6db85ae77 100644 --- a/crates/nu-command/src/network/http/patch.rs +++ b/crates/nu-command/src/network/http/patch.rs @@ -23,54 +23,54 @@ impl Command for HttpPatch { .named( "user", SyntaxShape::Any, - "the username when authenticating", + "The username when authenticating.", Some('u'), ) .named( "password", SyntaxShape::Any, - "the password when authenticating", + "The password when authenticating.", Some('p'), ) .named( "content-type", SyntaxShape::Any, - "the MIME type of content to post", + "The MIME type of content to post.", Some('t'), ) .named( "max-time", SyntaxShape::Duration, - "max duration before timeout occurs", + "Max duration before timeout occurs.", Some('m'), ) .named( "headers", SyntaxShape::Any, - "custom headers you want to add ", + "Custom headers you want to add.", Some('H'), ) .switch( "raw", - "return values as a string instead of a table", + "Return values as a string instead of a table.", Some('r'), ) .switch( "insecure", - "allow insecure server connections when using SSL", + "Allow insecure server connections when using SSL.", Some('k'), ) .switch( "full", - "returns the full response instead of only the body", + "Returns the full response instead of only the body.", Some('f'), ) .switch( "allow-errors", - "do not fail if the server returns an error code", + "Do not fail if the server returns an error code.", Some('e'), ) - .switch("pool", "using a global pool as a client", None) + .switch("pool", "Using a global pool as a client.", None) .param( Flag::new("redirect-mode") .short('R') @@ -90,7 +90,7 @@ impl Command for HttpPatch { } fn description(&self) -> &str { - "Patch a body to a URL." + "Send a PATCH request to a URL with a request body." } fn extra_description(&self) -> &str { @@ -114,32 +114,32 @@ impl Command for HttpPatch { fn examples(&self) -> Vec> { vec![ Example { - description: "Patch content to example.com", + description: "Patch content to example.com.", example: "http patch https://www.example.com 'body'", result: None, }, Example { - description: "Patch content to example.com, with username and password", + description: "Patch content to example.com, with username and password.", example: "http patch --user myuser --password mypass https://www.example.com 'body'", result: None, }, Example { - description: "Patch content to example.com, with custom header using a record", + description: "Patch content to example.com, with custom header using a record.", example: "http patch --headers {my-header-key: my-header-value} https://www.example.com", result: None, }, Example { - description: "Patch content to example.com, with custom header using a list", + description: "Patch content to example.com, with custom header using a list.", example: "http patch --headers [my-header-key-A my-header-value-A my-header-key-B my-header-value-B] https://www.example.com", result: None, }, Example { - description: "Patch content to example.com, with JSON body", + description: "Patch content to example.com, with JSON body.", example: "http patch --content-type application/json https://www.example.com { field: value }", result: None, }, Example { - description: "Patch JSON content from a pipeline to example.com", + description: "Patch JSON content from a pipeline to example.com.", example: "open --raw foo.json | http patch https://www.example.com", result: None, }, diff --git a/crates/nu-command/src/network/http/pool.rs b/crates/nu-command/src/network/http/pool.rs index 6aef60eb15..2d551e45d1 100644 --- a/crates/nu-command/src/network/http/pool.rs +++ b/crates/nu-command/src/network/http/pool.rs @@ -18,12 +18,12 @@ impl Command for HttpPool { .allow_variants_without_examples(true) .switch( "insecure", - "allow insecure server connections when using SSL", + "Allow insecure server connections when using SSL.", Some('k'), ) .switch( "allow-errors", - "do not fail if the server returns an error code", + "Do not fail if the server returns an error code.", Some('e'), ) .param( diff --git a/crates/nu-command/src/network/http/post.rs b/crates/nu-command/src/network/http/post.rs index 228c6f2d77..ab8aa599bc 100644 --- a/crates/nu-command/src/network/http/post.rs +++ b/crates/nu-command/src/network/http/post.rs @@ -27,54 +27,54 @@ impl Command for HttpPost { .named( "user", SyntaxShape::Any, - "the username when authenticating", + "The username when authenticating.", Some('u'), ) .named( "password", SyntaxShape::Any, - "the password when authenticating", + "The password when authenticating.", Some('p'), ) .named( "content-type", SyntaxShape::Any, - "the MIME type of content to post", + "The MIME type of content to post.", Some('t'), ) .named( "max-time", SyntaxShape::Duration, - "max duration before timeout occurs", + "Max duration before timeout occurs.", Some('m'), ) .named( "headers", SyntaxShape::Any, - "custom headers you want to add ", + "Custom headers you want to add.", Some('H'), ) .switch( "raw", - "return values as a string instead of a table", + "Return values as a string instead of a table.", Some('r'), ) .switch( "insecure", - "allow insecure server connections when using SSL", + "Allow insecure server connections when using SSL.", Some('k'), ) .switch( "full", - "returns the full response instead of only the body", + "Returns the full response instead of only the body.", Some('f'), ) .switch( "allow-errors", - "do not fail if the server returns an error code", + "Do not fail if the server returns an error code.", Some('e'), ) - .switch("pool", "using a global pool as a client", None) + .switch("pool", "Using a global pool as a client.", None) .param( Flag::new("redirect-mode") .short('R') @@ -94,7 +94,7 @@ impl Command for HttpPost { } fn description(&self) -> &str { - "Post a body to a URL." + "Send a POST request to a URL with a request body." } fn extra_description(&self) -> &str { @@ -118,52 +118,52 @@ impl Command for HttpPost { fn examples(&self) -> Vec> { vec![ Example { - description: "Post content to example.com", + description: "Post content to example.com.", example: "http post https://www.example.com 'body'", result: None, }, Example { - description: "Post content to example.com, with username and password", + description: "Post content to example.com, with username and password.", example: "http post --user myuser --password mypass https://www.example.com 'body'", result: None, }, Example { - description: "Post content to example.com, with custom header using a record", + description: "Post content to example.com, with custom header using a record.", example: "http post --headers {my-header-key: my-header-value} https://www.example.com", result: None, }, Example { - description: "Post content to example.com, with custom header using a list", + description: "Post content to example.com, with custom header using a list.", example: "http post --headers [my-header-key-A my-header-value-A my-header-key-B my-header-value-B] https://www.example.com", result: None, }, Example { - description: "Post content to example.com, with JSON body", + description: "Post content to example.com, with JSON body.", example: "http post --content-type application/json https://www.example.com { field: value }", result: None, }, Example { - description: "Post JSON content from a pipeline to example.com", + description: "Post JSON content from a pipeline to example.com.", example: "open --raw foo.json | http post https://www.example.com", result: None, }, Example { - description: "Upload a binary file to example.com", + description: "Upload a binary file to example.com.", example: "http post --content-type multipart/form-data https://www.example.com { file: (open -r file.mp3) }", result: None, }, Example { - description: "Convert a text file into binary and upload it to example.com", + description: "Convert a text file into binary and upload it to example.com.", example: "http post --content-type multipart/form-data https://www.example.com { file: (open -r file.txt | into binary) }", result: None, }, Example { - description: "Get the response status code", + description: "Get the response status code.", example: r#"http post https://www.example.com 'body' | metadata | get http_response.status"#, result: None, }, Example { - description: "Check response status while streaming", + description: "Check response status while streaming.", example: r#"http post --allow-errors https://example.com/upload 'data' | metadata access {|m| if $m.http_response.status != 200 { error make {msg: "failed"} } else { } } | lines"#, result: None, }, diff --git a/crates/nu-command/src/network/http/put.rs b/crates/nu-command/src/network/http/put.rs index 4c0f068e5d..094b3bbf0a 100644 --- a/crates/nu-command/src/network/http/put.rs +++ b/crates/nu-command/src/network/http/put.rs @@ -27,54 +27,54 @@ impl Command for HttpPut { .named( "user", SyntaxShape::Any, - "the username when authenticating", + "The username when authenticating.", Some('u'), ) .named( "password", SyntaxShape::Any, - "the password when authenticating", + "The password when authenticating.", Some('p'), ) .named( "content-type", SyntaxShape::Any, - "the MIME type of content to post", + "The MIME type of content to post.", Some('t'), ) .named( "max-time", SyntaxShape::Duration, - "max duration before timeout occurs", + "Max duration before timeout occurs.", Some('m'), ) .named( "headers", SyntaxShape::Any, - "custom headers you want to add ", + "Custom headers you want to add.", Some('H'), ) .switch( "raw", - "return values as a string instead of a table", + "Return values as a string instead of a table.", Some('r'), ) .switch( "insecure", - "allow insecure server connections when using SSL", + "Allow insecure server connections when using SSL.", Some('k'), ) .switch( "full", - "returns the full response instead of only the body", + "Returns the full response instead of only the body.", Some('f'), ) .switch( "allow-errors", - "do not fail if the server returns an error code", + "Do not fail if the server returns an error code.", Some('e'), ) - .switch("pool", "using a global pool as a client", None) + .switch("pool", "Using a global pool as a client.", None) .param( Flag::new("redirect-mode") .short('R') @@ -94,7 +94,7 @@ impl Command for HttpPut { } fn description(&self) -> &str { - "Put a body to a URL." + "Send a PUT request to a URL with a request body." } fn extra_description(&self) -> &str { @@ -118,32 +118,32 @@ impl Command for HttpPut { fn examples(&self) -> Vec> { vec![ Example { - description: "Put content to example.com", + description: "Put content to example.com.", example: "http put https://www.example.com 'body'", result: None, }, Example { - description: "Put content to example.com, with username and password", + description: "Put content to example.com, with username and password.", example: "http put --user myuser --password mypass https://www.example.com 'body'", result: None, }, Example { - description: "Put content to example.com, with custom header using a record", + description: "Put content to example.com, with custom header using a record.", example: "http put --headers {my-header-key: my-header-value} https://www.example.com", result: None, }, Example { - description: "Put content to example.com, with custom header using a list", + description: "Put content to example.com, with custom header using a list.", example: "http put --headers [my-header-key-A my-header-value-A my-header-key-B my-header-value-B] https://www.example.com", result: None, }, Example { - description: "Put content to example.com, with JSON body", + description: "Put content to example.com, with JSON body.", example: "http put --content-type application/json https://www.example.com { field: value }", result: None, }, Example { - description: "Put JSON content from a pipeline to example.com", + description: "Put JSON content from a pipeline to example.com.", example: "open --raw foo.json | http put https://www.example.com", result: None, }, diff --git a/crates/nu-command/src/network/url/build_query.rs b/crates/nu-command/src/network/url/build_query.rs index a631a52eb5..73cecb9971 100644 --- a/crates/nu-command/src/network/url/build_query.rs +++ b/crates/nu-command/src/network/url/build_query.rs @@ -33,22 +33,22 @@ impl Command for UrlBuildQuery { fn examples(&self) -> Vec> { vec![ Example { - description: "Outputs a query string representing the contents of this record", + description: "Outputs a query string representing the contents of this record.", example: r#"{ mode:normal userid:31415 } | url build-query"#, result: Some(Value::test_string("mode=normal&userid=31415")), }, Example { - description: "Outputs a query string representing the contents of this record, with a value that needs to be url-encoded", + description: "Outputs a query string representing the contents of this record, with a value that needs to be URL-encoded.", example: r#"{a:"AT&T", b: "AT T"} | url build-query"#, result: Some(Value::test_string("a=AT%26T&b=AT+T")), }, Example { - description: "Outputs a query string representing the contents of this record, \"exploding\" the list into multiple parameters", + description: "Outputs a query string representing the contents of this record, \"exploding\" the list into multiple parameters.", example: r#"{a: ["one", "two"], b: "three"} | url build-query"#, result: Some(Value::test_string("a=one&a=two&b=three")), }, Example { - description: "Outputs a query string representing the contents of this table containing key-value pairs", + description: "Outputs a query string representing the contents of this table containing key-value pairs.", example: r#"[[key, value]; [a, one], [a, two], [b, three], [a, four]] | url build-query"#, result: Some(Value::test_string("a=one&a=two&b=three&a=four")), }, diff --git a/crates/nu-command/src/network/url/decode.rs b/crates/nu-command/src/network/url/decode.rs index 4ead3a866f..394d4edf4a 100644 --- a/crates/nu-command/src/network/url/decode.rs +++ b/crates/nu-command/src/network/url/decode.rs @@ -54,12 +54,12 @@ impl Command for UrlDecode { fn examples(&self) -> Vec> { vec![ Example { - description: "Decode a url with escape characters", + description: "Decode a URL with escape characters.", example: "'https://example.com/foo%20bar' | url decode", result: Some(Value::test_string("https://example.com/foo bar")), }, Example { - description: "Decode multiple urls with escape characters in list", + description: "Decode multiple URLs with escape characters in list.", example: "['https://example.com/foo%20bar' 'https://example.com/a%3Eb' '%E4%B8%AD%E6%96%87%E5%AD%97/eng/12%2034'] | url decode", result: Some(Value::list( vec![ diff --git a/crates/nu-command/src/network/url/encode.rs b/crates/nu-command/src/network/url/encode.rs index 0d9b403271..cd9f97b0ad 100644 --- a/crates/nu-command/src/network/url/encode.rs +++ b/crates/nu-command/src/network/url/encode.rs @@ -59,12 +59,12 @@ impl Command for UrlEncode { fn examples(&self) -> Vec> { vec![ Example { - description: "Encode a url with escape characters", + description: "Encode a URL with escape characters.", example: "'https://example.com/foo bar' | url encode", result: Some(Value::test_string("https://example.com/foo%20bar")), }, Example { - description: "Encode multiple urls with escape characters in list", + description: "Encode multiple URLs with escape characters in list.", example: "['https://example.com/foo bar' 'https://example.com/a>b' '中文字/eng/12 34'] | url encode", result: Some(Value::list( vec![ @@ -76,7 +76,7 @@ impl Command for UrlEncode { )), }, Example { - description: "Encode all non alphanumeric chars with all flag", + description: "Encode all non alphanumeric chars with all flag.", example: "'https://example.com/foo bar' | url encode --all", result: Some(Value::test_string( "https%3A%2F%2Fexample%2Ecom%2Ffoo%20bar", diff --git a/crates/nu-command/src/network/url/join.rs b/crates/nu-command/src/network/url/join.rs index 787161c7ce..3f0390ee27 100644 --- a/crates/nu-command/src/network/url/join.rs +++ b/crates/nu-command/src/network/url/join.rs @@ -17,7 +17,7 @@ impl Command for UrlJoin { } fn description(&self) -> &str { - "Converts a record to url." + "Convert a record to a URL string." } fn search_terms(&self) -> Vec<&str> { @@ -29,7 +29,7 @@ impl Command for UrlJoin { fn examples(&self) -> Vec> { vec![ Example { - description: "Outputs a url representing the contents of this record, `params` and `query` fields must be equivalent", + description: "Outputs a URL representing the contents of this record, `params` and `query` fields must be equivalent.", example: r#"{ "scheme": "http", "username": "", @@ -50,7 +50,7 @@ impl Command for UrlJoin { )), }, Example { - description: "Outputs a url representing the contents of this record, \"exploding\" the list in `params` into multiple parameters", + description: "Outputs a URL representing the contents of this record, \"exploding\" the list in `params` into multiple parameters.", example: r#"{ "scheme": "http", "username": "user", @@ -65,7 +65,7 @@ impl Command for UrlJoin { )), }, Example { - description: "Outputs a url representing the contents of this record", + description: "Outputs a URL representing the contents of this record.", example: r#"{ "scheme": "http", "username": "user", @@ -80,7 +80,7 @@ impl Command for UrlJoin { )), }, Example { - description: "Outputs a url representing the contents of this record", + description: "Outputs a URL representing the contents of this record.", example: r#"{ "scheme": "http", "host": "www.pixiv.net", diff --git a/crates/nu-command/src/network/url/parse.rs b/crates/nu-command/src/network/url/parse.rs index b8c603c723..17ff8f3c5d 100644 --- a/crates/nu-command/src/network/url/parse.rs +++ b/crates/nu-command/src/network/url/parse.rs @@ -29,7 +29,7 @@ impl Command for UrlParse { } fn description(&self) -> &str { - "Parses a url." + "Parse a URL string into structured data." } fn search_terms(&self) -> Vec<&str> { @@ -54,7 +54,7 @@ impl Command for UrlParse { fn examples(&self) -> Vec> { vec![Example { - description: "Parses a url", + description: "Parses a URL.", example: "'http://user123:pass567@www.example.com:8081/foo/bar?param1=section&p2=&f[name]=vldc&f[no]=42#hello' | url parse", result: Some(Value::test_record(record! { "scheme" => Value::test_string("http"), diff --git a/crates/nu-command/src/network/url/split_query.rs b/crates/nu-command/src/network/url/split_query.rs index ff74ae85dc..3668c7ea9c 100644 --- a/crates/nu-command/src/network/url/split_query.rs +++ b/crates/nu-command/src/network/url/split_query.rs @@ -30,7 +30,7 @@ impl Command for UrlSplitQuery { fn examples(&self) -> Vec> { vec![ Example { - description: "Outputs a table representing the contents of this query string", + description: "Outputs a table representing the contents of this query string.", example: r#""mode=normal&userid=31415" | url split-query"#, result: Some(Value::test_list(vec![ Value::test_record(record! { @@ -44,7 +44,7 @@ impl Command for UrlSplitQuery { ])), }, Example { - description: "Outputs a table representing the contents of this query string, url-decoding the values", + description: "Outputs a table representing the contents of this query string, url-decoding the values.", example: r#""a=AT%26T&b=AT+T" | url split-query"#, result: Some(Value::test_list(vec![ Value::test_record(record! { @@ -58,7 +58,7 @@ impl Command for UrlSplitQuery { ])), }, Example { - description: "Outputs a table representing the contents of this query string", + description: "Outputs a table representing the contents of this query string.", example: r#""a=one&a=two&b=three" | url split-query"#, result: Some(Value::test_list(vec![ Value::test_record(record! { diff --git a/crates/nu-command/src/system/nu_check.rs b/crates/nu-command/src/system/nu_check.rs index c2d87e02d4..1dbdbd3ee0 100644 --- a/crates/nu-command/src/system/nu_check.rs +++ b/crates/nu-command/src/system/nu_check.rs @@ -26,13 +26,13 @@ impl Command for NuCheck { ]) // type is string to avoid automatically canonicalizing the path .optional("path", SyntaxShape::String, "File path to parse.") - .switch("as-module", "Parse content as module", Some('m')) - .switch("debug", "Show error messages", Some('d')) + .switch("as-module", "Parse content as module.", Some('m')) + .switch("debug", "Show error messages.", Some('d')) .category(Category::Strings) } fn description(&self) -> &str { - "Validate and parse input content." + "Validate and parse Nushell input content." } fn search_terms(&self) -> Vec<&str> { diff --git a/crates/nu-command/src/system/registry_query.rs b/crates/nu-command/src/system/registry_query.rs index 19277277a2..6fb4dc55a8 100644 --- a/crates/nu-command/src/system/registry_query.rs +++ b/crates/nu-command/src/system/registry_query.rs @@ -15,23 +15,23 @@ impl Command for RegistryQuery { fn signature(&self) -> Signature { Signature::build("registry query") .input_output_types(vec![(Type::Nothing, Type::Any)]) - .switch("hkcr", "query the hkey_classes_root hive", None) - .switch("hkcu", "query the hkey_current_user hive", None) - .switch("hklm", "query the hkey_local_machine hive", None) - .switch("hku", "query the hkey_users hive", None) - .switch("hkpd", "query the hkey_performance_data hive", None) - .switch("hkpt", "query the hkey_performance_text hive", None) - .switch("hkpnls", "query the hkey_performance_nls_text hive", None) - .switch("hkcc", "query the hkey_current_config hive", None) - .switch("hkdd", "query the hkey_dyn_data hive", None) + .switch("hkcr", "Query the hkey_classes_root hive.", None) + .switch("hkcu", "Query the hkey_current_user hive.", None) + .switch("hklm", "Query the hkey_local_machine hive.", None) + .switch("hku", "Query the hkey_users hive.", None) + .switch("hkpd", "Query the hkey_performance_data hive.", None) + .switch("hkpt", "Query the hkey_performance_text hive.", None) + .switch("hkpnls", "Query the hkey_performance_nls_text hive.", None) + .switch("hkcc", "Query the hkey_current_config hive.", None) + .switch("hkdd", "Query the hkey_dyn_data hive.", None) .switch( "hkculs", - "query the hkey_current_user_local_settings hive", + "Query the hkey_current_user_local_settings hive.", None, ) .switch( "no-expand", - "do not expand %ENV% placeholders in REG_EXPAND_SZ", + "Do not expand %ENV% placeholders in REG_EXPAND_SZ.", Some('u'), ) .required("key", SyntaxShape::String, "Registry key to query.") diff --git a/crates/nu-command/src/system/which_.rs b/crates/nu-command/src/system/which_.rs index e68dc290c7..f97c80fbbe 100644 --- a/crates/nu-command/src/system/which_.rs +++ b/crates/nu-command/src/system/which_.rs @@ -19,7 +19,7 @@ impl Command for Which { .input_output_types(vec![(Type::Nothing, Type::table())]) .allow_variants_without_examples(true) .rest("applications", SyntaxShape::String, "Application(s).") - .switch("all", "list all executables", Some('a')) + .switch("all", "List all executables.", Some('a')) .category(Category::System) } diff --git a/crates/nu-command/src/viewers/griddle.rs b/crates/nu-command/src/viewers/griddle.rs index 070abe9a38..940de8abee 100644 --- a/crates/nu-command/src/viewers/griddle.rs +++ b/crates/nu-command/src/viewers/griddle.rs @@ -28,19 +28,19 @@ impl Command for Griddle { .named( "width", SyntaxShape::Int, - "number of terminal columns wide (not output columns)", + "Number of terminal columns wide (not output columns).", Some('w'), ) - .switch("color", "draw output with color", Some('c')) + .switch("color", "Draw output with color.", Some('c')) .switch( "icons", - "draw output with icons (assumes nerd font is used)", + "Draw output with icons (assumes nerd font is used).", Some('i'), ) .named( "separator", SyntaxShape::String, - "character to separate grid with", + "Character to separate grid with.", Some('s'), ) .category(Category::Viewers) diff --git a/crates/nu-command/src/viewers/table.rs b/crates/nu-command/src/viewers/table.rs index 9bddca8670..0b4ee9ac72 100644 --- a/crates/nu-command/src/viewers/table.rs +++ b/crates/nu-command/src/viewers/table.rs @@ -59,52 +59,52 @@ impl Command for Table { Flag::new("theme") .short('t') .arg(SyntaxShape::String) - .desc("set a table mode/theme") + .desc("Set a table mode/theme.") .completion(Completion::new_list(SUPPORTED_TABLE_MODES)), ) .named( "index", SyntaxShape::Any, - "enable (true) or disable (false) the #/index column or set the starting index", + "Enable (true) or disable (false) the #/index column or set the starting index.", Some('i'), ) .named( "width", SyntaxShape::Int, - "number of terminal columns wide (not output columns)", + "Number of terminal columns wide (not output columns).", Some('w'), ) .switch( "expand", - "expand the table structure in a light mode", + "Expand the table structure in a light mode.", Some('e'), ) .named( "expand-deep", SyntaxShape::Int, - "an expand limit of recursion which will take place, must be used with --expand", + "An expand limit of recursion which will take place, must be used with --expand.", Some('d'), ) - .switch("flatten", "Flatten simple arrays", None) + .switch("flatten", "Flatten simple arrays.", None) .named( "flatten-separator", SyntaxShape::String, - "sets a separator when 'flatten' used", + "Sets a separator when 'flatten' is used.", None, ) .switch( "collapse", - "expand the table structure in collapse mode.\nBe aware collapse mode currently doesn't support width control", + "Expand the table structure in collapse mode.\nBe aware collapse mode currently doesn't support width control.", Some('c'), ) .named( "abbreviated", SyntaxShape::Int, - "abbreviate the data in the table by truncating the middle part and only showing amount provided on top and bottom", + "Abbreviate the data in the table by truncating the middle part and only showing amount provided on top and bottom.", Some('a'), ) - .switch("list", "list available table modes/themes", Some('l')) - .switch("icons", "adds icons to file paths in tables", Some('o'), + .switch("list", "List available table modes/themes.", Some('l')) + .switch("icons", "Add icons to file paths in tables.", Some('o'), ) .category(Category::Viewers) }