nushell/crates/nu-command/src/formats/to
Vincenzo Carlino 92c4097f8d
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)
2023-01-15 10:16:29 -08:00
..
command.rs Add extra_usage messages for subcommand-only commands (#7594) 2022-12-24 07:16:29 -06:00
csv.rs Standardise the use of ShellError::UnsupportedInput and ShellError::TypeMismatch and add spans to every instance of the former (#7217) 2022-12-23 01:48:53 -05:00
delimited.rs Standardise the use of ShellError::UnsupportedInput and ShellError::TypeMismatch and add spans to every instance of the former (#7217) 2022-12-23 01:48:53 -05:00
html.rs to html --list now returns a table (#7080) 2022-11-15 11:12:56 -06:00
json.rs Split blocks and closures (#7075) 2022-11-10 21:21:49 +13:00
md.rs Declare input and output types of commands (#6796) 2022-11-10 10:55:05 +13:00
mod.rs Rename to url command to url build-query (#7702) 2023-01-15 10:16:29 -08:00
nuon.rs uniq and uniq-by optimization (#7477) (#7534) 2023-01-04 11:35:49 -08:00
text.rs Progress bar Implementation (#7661) 2023-01-10 20:57:48 -05:00
toml.rs To toml fix (#7597) 2022-12-24 15:12:09 -06:00
tsv.rs Declare input and output types of commands (#6796) 2022-11-10 10:55:05 +13:00
xml.rs couple minor updates to xml deps (#7311) 2022-12-02 08:25:13 +13:00
yaml.rs Split blocks and closures (#7075) 2022-11-10 21:21:49 +13:00