mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 22:50:14 +02:00
Rename to url
command to url build-query
(#7702)
# Description Refactor command: "to url" in: "to url query". Changed usage sentence. Closes: #7495 # User-Facing Changes Now we get a query string from a record or table by using command: "to url query". ``` > help to url query Convert record or table into query string applying percent-encoding. Usage: > to url query Flags: -h, --help - Display the help message for this command Signatures: <record> | to url query -> <string> <table> | to url query -> <string> Examples: Outputs a query string representing the contents of this record > { mode:normal userid:31415 } | to url query Outputs a query string representing the contents of this 1-row table > [[foo bar]; ["1" "2"]] | to url query Outputs a query string representing the contents of this record > {a:"AT&T", b: "AT T"} | to url query ``` # Tests + Formatting Added this test: ``` Example { description: "Outputs a query string representing the contents of this record", example: r#"{a:"AT&T", b: "AT T"} | to url query"#, result: Some(Value::test_string("a=AT%26T&b=AT+T")), }, ``` to ensure percent-encoding. # After Submitting If PR is accepted I'll open another PR on documentation to notify changes on [this.](https://github.com/nushell/nushell.github.io/blob/main/book/commands/to_url.md)
This commit is contained in:
@ -6,7 +6,7 @@ fn can_encode_and_decode_urlencoding() {
|
||||
cwd: "tests/fixtures/formats", pipeline(
|
||||
r#"
|
||||
open sample.url
|
||||
| to url
|
||||
| url build-query
|
||||
| from url
|
||||
| get cheese
|
||||
"#
|
||||
|
Reference in New Issue
Block a user