mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 14:40:06 +02:00
Strip trailing whitespace in files (#4575)
* Strip trailing whitespace in rs files * Strip trailing whitespace in toml files * Strip trailing whitespace in md files * Strip trailing whitespace in nu files
This commit is contained in:
@ -206,8 +206,8 @@ The `full "#hex"` format is a take on the `"#hex"` format but allows one to spec
|
||||
|
||||
Example: `{ fg: "#ff0000" bg: "#0000ff" attr: b }`
|
||||
|
||||
* foreground of red in "#hex" format
|
||||
* background of blue in "#hex" format
|
||||
* foreground of red in "#hex" format
|
||||
* background of blue in "#hex" format
|
||||
* attribute of bold abbreviated
|
||||
|
||||
## `Primitive values`
|
||||
|
@ -12,7 +12,7 @@ Performs an aggregation operation on a dataframe and groupby object
|
||||
|
||||
## Parameters
|
||||
|
||||
- `operation_name`:
|
||||
- `operation_name`:
|
||||
Dataframes: mean, sum, min, max, quantile, median, var, std
|
||||
GroupBy: mean, sum, min, max, first, last, nunique, quantile, median, var, std, count
|
||||
- `--quantile {number}`: quantile value for quantile operation
|
||||
|
@ -20,7 +20,7 @@ Create a custom error for a custom command
|
||||
```shell
|
||||
> def foo [x] {
|
||||
let span = (metadata $x).span;
|
||||
error make {msg: "this is fishy", label: {text: "fish right here", start: $span.start, end: $span.end } }
|
||||
error make {msg: "this is fishy", label: {text: "fish right here", start: $span.start, end: $span.end } }
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -16,7 +16,7 @@ Fetch the contents from a URL (HTTP GET operation).
|
||||
- `--user {any}`: the username when authenticating
|
||||
- `--password {any}`: the password when authenticating
|
||||
- `--timeout {int}`: timeout period in seconds
|
||||
- `--headers {any}`: custom headers you want to add
|
||||
- `--headers {any}`: custom headers you want to add
|
||||
- `--raw`: fetch contents as text rather than a table
|
||||
|
||||
## Examples
|
||||
|
@ -18,7 +18,7 @@ Flatten the table.
|
||||
|
||||
flatten a table
|
||||
```shell
|
||||
> [[N, u, s, h, e, l, l]] | flatten
|
||||
> [[N, u, s, h, e, l, l]] | flatten
|
||||
```
|
||||
|
||||
flatten a table, get the first item
|
||||
|
@ -18,7 +18,7 @@ Post a body to a URL (HTTP POST operation).
|
||||
- `--password {any}`: the password when authenticating
|
||||
- `--content-type {any}`: the MIME type of content to post
|
||||
- `--content-length {any}`: the length of the content being posted
|
||||
- `--headers {any}`: custom headers you want to add
|
||||
- `--headers {any}`: custom headers you want to add
|
||||
- `--raw`: return values as a string instead of a table
|
||||
- `--insecure`: allow insecure server connections when using SSL
|
||||
|
||||
|
@ -18,7 +18,7 @@ Create a new table splitted.
|
||||
|
||||
split items by column named "lang"
|
||||
```shell
|
||||
>
|
||||
>
|
||||
{
|
||||
'2019': [
|
||||
{ name: 'andres', lang: 'rb', year: '2019' },
|
||||
@ -28,6 +28,6 @@ split items by column named "lang"
|
||||
{ name: 'storm', lang: 'rs', 'year': '2021' }
|
||||
]
|
||||
} | split-by lang
|
||||
|
||||
|
||||
```
|
||||
|
||||
|
@ -4,7 +4,7 @@ layout: command
|
||||
version: 0.59.0
|
||||
---
|
||||
|
||||
Convert table into .csv text
|
||||
Convert table into .csv text
|
||||
|
||||
## Signature
|
||||
|
||||
@ -24,6 +24,6 @@ Outputs an CSV string representing the contents of this table
|
||||
|
||||
Outputs an CSV string representing the contents of this table
|
||||
```shell
|
||||
> [[foo bar]; [1 2]] | to csv -s ';'
|
||||
> [[foo bar]; [1 2]] | to csv -s ';'
|
||||
```
|
||||
|
||||
|
@ -140,7 +140,7 @@ error: aborting due to previous error
|
||||
|
||||
That's not certainly what we expected.
|
||||
|
||||
It happens that Nu needs to know more about the command, including it's name and signature. We didn't do any of that and the compiler is telling us so. We seem to be missing implementing the `WholeStreamCommand` trait. This is the trait that, when implemented, allows us to state it's name, signature, and the like.
|
||||
It happens that Nu needs to know more about the command, including it's name and signature. We didn't do any of that and the compiler is telling us so. We seem to be missing implementing the `WholeStreamCommand` trait. This is the trait that, when implemented, allows us to state it's name, signature, and the like.
|
||||
|
||||
## WholeStreamCommand
|
||||
|
||||
|
@ -10,7 +10,7 @@ version: ($vers)
|
||||
($command.usage)
|
||||
|
||||
"
|
||||
let sig = ($command.signature | each { |param|
|
||||
let sig = ($command.signature | each { |param|
|
||||
if $param.parameter_type == "positional" {
|
||||
$"('(')($param.parameter_name)(')')"
|
||||
} else if $param.parameter_type == "switch" {
|
||||
@ -56,7 +56,7 @@ $"($example.description)
|
||||
|
||||
$example_top + $examples
|
||||
} else { "" }
|
||||
|
||||
|
||||
let doc = ($top + $signature + $parameters + $examples)
|
||||
|
||||
let safe_name = ($command.command | str find-replace '\?' '' | str find-replace ' ' '_')
|
||||
|
Reference in New Issue
Block a user