mirror of
https://github.com/nushell/nushell
synced 2024-12-27 05:23:11 +00:00
* feat: update #4455, regenerate commands' docs * chore: update make_docs script
This commit is contained in:
parent
2e167ea0c6
commit
c0a1d18e3d
331 changed files with 234 additions and 328 deletions
|
@ -21,4 +21,3 @@ Alias ll to ls -l
|
|||
```shell
|
||||
> alias ll = ls -l
|
||||
```
|
||||
|
||||
|
|
|
@ -25,4 +25,3 @@ Check that all values are even
|
|||
```shell
|
||||
> echo [2 4 6 8] | all? ($it mod 2) == 0
|
||||
```
|
||||
|
||||
|
|
|
@ -43,4 +43,3 @@ Use ansi to color text with a style (blue on red in bold)
|
|||
```shell
|
||||
> $"(ansi -e { fg: '#0000ff' bg: '#ff0000' attr: b })Hello Nu World(ansi reset)"
|
||||
```
|
||||
|
||||
|
|
|
@ -39,4 +39,3 @@ draw text in a gradient by specifying foreground end color - start color is assu
|
|||
```shell
|
||||
> echo 'Hello, Nushell! This is a gradient.' | ansi gradient --fgend 0xe81cff
|
||||
```
|
||||
|
||||
|
|
|
@ -20,4 +20,3 @@ strip ansi escape sequences from string
|
|||
```shell
|
||||
> echo [ (ansi green) (ansi cursor_on) "hello" ] | str collect | ansi strip
|
||||
```
|
||||
|
||||
|
|
|
@ -25,4 +25,3 @@ Check if any of the values is odd
|
|||
```shell
|
||||
> echo [2 4 1 6 8] | any? ($it mod 2) == 1
|
||||
```
|
||||
|
||||
|
|
|
@ -30,4 +30,3 @@ Append Ints and Strings
|
|||
```shell
|
||||
> [0,1] | append [2,nu,4,shell]
|
||||
```
|
||||
|
||||
|
|
|
@ -20,4 +20,3 @@ Benchmarks a command within a block
|
|||
```shell
|
||||
> benchmark { sleep 500ms }
|
||||
```
|
||||
|
||||
|
|
|
@ -25,4 +25,3 @@ Builds a string from letters a b c
|
|||
```shell
|
||||
> build-string (1 + 2) = one ' ' plus ' ' two
|
||||
```
|
||||
|
||||
|
|
|
@ -35,4 +35,3 @@ This month's calendar with the week starting on monday
|
|||
```shell
|
||||
> cal --week-start monday
|
||||
```
|
||||
|
||||
|
|
|
@ -20,4 +20,3 @@ Change to your home directory
|
|||
```shell
|
||||
> cd ~
|
||||
```
|
||||
|
||||
|
|
|
@ -38,4 +38,3 @@ Output multi-byte Unicode character
|
|||
```shell
|
||||
> char -u 1F468 200D 1F466 200D 1F466
|
||||
```
|
||||
|
||||
|
|
|
@ -16,4 +16,3 @@ Clear the terminal
|
|||
```shell
|
||||
> clear
|
||||
```
|
||||
|
||||
|
|
|
@ -20,4 +20,3 @@ Use the second value in the stream
|
|||
```shell
|
||||
> echo 1 2 3 | collect { |x| echo $x.1 }
|
||||
```
|
||||
|
||||
|
|
|
@ -26,4 +26,3 @@ Get the second column from the table
|
|||
```shell
|
||||
> [[name,age,grade]; [bill,20,a]] | columns | select 1
|
||||
```
|
||||
|
||||
|
|
|
@ -30,4 +30,3 @@ Filter out all instances of nothing from a list (Returns [1,2]
|
|||
```shell
|
||||
> echo [1, $nothing, 2] | compact
|
||||
```
|
||||
|
||||
|
|
|
@ -27,4 +27,3 @@ Recursively copy dir_a to dir_b
|
|||
```shell
|
||||
> cp -r dir_a dir_b
|
||||
```
|
||||
|
||||
|
|
|
@ -9,4 +9,3 @@ Deprecated command
|
|||
## Signature
|
||||
|
||||
```> dataframe ```
|
||||
|
||||
|
|
|
@ -9,4 +9,3 @@ date
|
|||
## Signature
|
||||
|
||||
```> date ```
|
||||
|
||||
|
|
|
@ -36,4 +36,3 @@ Format a given date using a given format string.
|
|||
```shell
|
||||
> "2021-10-22 20:00:12 +01:00" | date format "%Y-%m-%d"
|
||||
```
|
||||
|
||||
|
|
|
@ -21,4 +21,3 @@ Print a 'humanized' format for the date, relative to now.
|
|||
```shell
|
||||
> "2021-10-22 20:00:12 +01:00" | date humanize
|
||||
```
|
||||
|
||||
|
|
|
@ -16,4 +16,3 @@ Show timezone(s) that contains 'Shanghai'
|
|||
```shell
|
||||
> date list-timezone | where timezone =~ Shanghai
|
||||
```
|
||||
|
||||
|
|
|
@ -16,4 +16,3 @@ Get the current date and display it in a given format string.
|
|||
```shell
|
||||
> date now | date format "%Y-%m-%d %H:%M:%S"
|
||||
```
|
||||
|
||||
|
|
|
@ -26,4 +26,3 @@ Print the date in a structured table.
|
|||
```shell
|
||||
> '2020-04-12 22:10:57 +0200' | date to-table
|
||||
```
|
||||
|
||||
|
|
|
@ -35,4 +35,3 @@ Get the current date in Hawaii
|
|||
```shell
|
||||
> "2020-10-10 10:00:00 +02:00" | date to-timezone "+0500"
|
||||
```
|
||||
|
||||
|
|
|
@ -20,4 +20,3 @@ Describe the type of a string
|
|||
```shell
|
||||
> 'hello' | debug
|
||||
```
|
||||
|
||||
|
|
|
@ -20,4 +20,3 @@ Decode the output of an external command
|
|||
```shell
|
||||
> cat myfile.q | decode utf-8
|
||||
```
|
||||
|
||||
|
|
|
@ -16,3 +16,9 @@ Define a custom command, which participates in the caller environment
|
|||
- `params`: parameters
|
||||
- `block`: body of the definition
|
||||
|
||||
## Examples
|
||||
|
||||
Set environment variable by call a custom command
|
||||
```shell
|
||||
> def-env foo [] { let-env BAR = "BAZ" }; foo; $env.BAR
|
||||
```
|
||||
|
|
|
@ -27,4 +27,3 @@ Define a command and run it with parameter(s)
|
|||
```shell
|
||||
> def say-sth [sth: string] { echo $sth }; say-sth hi
|
||||
```
|
||||
|
||||
|
|
|
@ -21,4 +21,3 @@ Give a default 'target' to all file entries
|
|||
```shell
|
||||
> ls -la | default target 'nothing'
|
||||
```
|
||||
|
||||
|
|
|
@ -16,4 +16,3 @@ Describe the type of a string
|
|||
```shell
|
||||
> 'hello' | describe
|
||||
```
|
||||
|
||||
|
|
|
@ -26,4 +26,3 @@ Splits a multi-line string into columns with headers detected
|
|||
```shell
|
||||
> echo $'c1 c2 c3(char nl)a b c' | detect columns
|
||||
```
|
||||
|
||||
|
|
|
@ -9,4 +9,3 @@ Dataframe commands
|
|||
## Signature
|
||||
|
||||
```> dfr ```
|
||||
|
||||
|
|
|
@ -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
|
||||
|
@ -34,4 +34,3 @@ Aggregate sum in series
|
|||
```shell
|
||||
> [4 1 5 6] | dfr to-df | dfr aggregate sum
|
||||
```
|
||||
|
||||
|
|
|
@ -23,4 +23,3 @@ Checks the result from a comparison
|
|||
let res = ($s > 9);
|
||||
$res | dfr all-false
|
||||
```
|
||||
|
||||
|
|
|
@ -23,4 +23,3 @@ Checks the result from a comparison
|
|||
let res = ($s > 9);
|
||||
$res | dfr all-true
|
||||
```
|
||||
|
||||
|
|
|
@ -28,4 +28,3 @@ Appends a dataframe merging at the end of columns
|
|||
> let a = ([[a b]; [1 2] [3 4]] | dfr to-df);
|
||||
$a | dfr append $a --col
|
||||
```
|
||||
|
||||
|
|
|
@ -16,4 +16,3 @@ Returns index for max value
|
|||
```shell
|
||||
> [1 3 2] | dfr to-df | dfr arg-max
|
||||
```
|
||||
|
||||
|
|
|
@ -16,4 +16,3 @@ Returns index for min value
|
|||
```shell
|
||||
> [1 3 2] | dfr to-df | dfr arg-min
|
||||
```
|
||||
|
||||
|
|
|
@ -25,4 +25,3 @@ Returns indexes for a sorted series
|
|||
```shell
|
||||
> [1 2 2 3 3] | dfr to-df | dfr arg-sort -r
|
||||
```
|
||||
|
||||
|
|
|
@ -16,4 +16,3 @@ Returns indexes where values are true
|
|||
```shell
|
||||
> [$false $true $false] | dfr to-df | dfr arg-true
|
||||
```
|
||||
|
||||
|
|
|
@ -16,4 +16,3 @@ Returns indexes for unique values
|
|||
```shell
|
||||
> [1 2 2 3 3] | dfr to-df | dfr arg-unique
|
||||
```
|
||||
|
||||
|
|
|
@ -20,4 +20,3 @@ Returns the selected column as series
|
|||
```shell
|
||||
> [[a b]; [1 2] [3 4]] | dfr to-df | dfr column a
|
||||
```
|
||||
|
||||
|
|
|
@ -21,4 +21,3 @@ Concatenate string
|
|||
> let other = ([za xs cd] | dfr to-df);
|
||||
[abc abc abc] | dfr to-df | dfr concatenate $other
|
||||
```
|
||||
|
||||
|
|
|
@ -20,4 +20,3 @@ Returns boolean indicating if pattern was found
|
|||
```shell
|
||||
> [abc acb acb] | dfr to-df | dfr contains ab
|
||||
```
|
||||
|
||||
|
|
|
@ -17,4 +17,3 @@ Counts null values
|
|||
> let s = ([1 1 0 0 3 3 4] | dfr to-df);
|
||||
($s / $s) | dfr count-null
|
||||
```
|
||||
|
||||
|
|
|
@ -16,4 +16,3 @@ Counts unique values
|
|||
```shell
|
||||
> [1 1 2 2 3 3 4] | dfr to-df | dfr count-unique
|
||||
```
|
||||
|
||||
|
|
|
@ -21,4 +21,3 @@ Cumulative sum for a series
|
|||
```shell
|
||||
> [1 2 3 4 5] | dfr to-df | dfr cumulative sum
|
||||
```
|
||||
|
||||
|
|
|
@ -16,4 +16,3 @@ dataframe description
|
|||
```shell
|
||||
> [[a b]; [1 1] [1 1]] | dfr to-df | dfr describe
|
||||
```
|
||||
|
||||
|
|
|
@ -21,4 +21,3 @@ drop duplicates
|
|||
```shell
|
||||
> [[a b]; [1 2] [3 4] [1 2]] | dfr to-df | dfr drop-duplicates
|
||||
```
|
||||
|
||||
|
|
|
@ -29,4 +29,3 @@ drop null values in dataframe
|
|||
> let s = ([1 2 0 0 3 4] | dfr to-df);
|
||||
($s / $s) | dfr drop-nulls
|
||||
```
|
||||
|
||||
|
|
|
@ -20,4 +20,3 @@ drop column a
|
|||
```shell
|
||||
> [[a b]; [1 2] [3 4]] | dfr to-df | dfr drop a
|
||||
```
|
||||
|
||||
|
|
|
@ -16,4 +16,3 @@ Dataframe dtypes
|
|||
```shell
|
||||
> [[a b]; [1 2] [3 4]] | dfr to-df | dfr dtypes
|
||||
```
|
||||
|
||||
|
|
|
@ -21,4 +21,3 @@ Filter dataframe using a bool mask
|
|||
> let mask = ([$true $false] | dfr to-df);
|
||||
[[a b]; [1 2] [3 4]] | dfr to-df | dfr filter-with $mask
|
||||
```
|
||||
|
||||
|
|
|
@ -20,4 +20,3 @@ Create new dataframe with head rows
|
|||
```shell
|
||||
> [[a b]; [1 2] [3 4]] | dfr to-df | dfr first 1
|
||||
```
|
||||
|
||||
|
|
|
@ -18,4 +18,3 @@ Returns day from a date
|
|||
let df = ([$dt $dt] | dfr to-df);
|
||||
$df | dfr get-day
|
||||
```
|
||||
|
||||
|
|
|
@ -18,4 +18,3 @@ Returns hour from a date
|
|||
let df = ([$dt $dt] | dfr to-df);
|
||||
$df | dfr get-hour
|
||||
```
|
||||
|
||||
|
|
|
@ -18,4 +18,3 @@ Returns minute from a date
|
|||
let df = ([$dt $dt] | dfr to-df);
|
||||
$df | dfr get-minute
|
||||
```
|
||||
|
||||
|
|
|
@ -18,4 +18,3 @@ Returns month from a date
|
|||
let df = ([$dt $dt] | dfr to-df);
|
||||
$df | dfr get-month
|
||||
```
|
||||
|
||||
|
|
|
@ -18,4 +18,3 @@ Returns nanosecond from a date
|
|||
let df = ([$dt $dt] | dfr to-df);
|
||||
$df | dfr get-nanosecond
|
||||
```
|
||||
|
||||
|
|
|
@ -18,4 +18,3 @@ Returns ordinal from a date
|
|||
let df = ([$dt $dt] | dfr to-df);
|
||||
$df | dfr get-ordinal
|
||||
```
|
||||
|
||||
|
|
|
@ -18,4 +18,3 @@ Returns second from a date
|
|||
let df = ([$dt $dt] | dfr to-df);
|
||||
$df | dfr get-second
|
||||
```
|
||||
|
||||
|
|
|
@ -18,4 +18,3 @@ Returns week from a date
|
|||
let df = ([$dt $dt] | dfr to-df);
|
||||
$df | dfr get-week
|
||||
```
|
||||
|
||||
|
|
|
@ -18,4 +18,3 @@ Returns weekday from a date
|
|||
let df = ([$dt $dt] | dfr to-df);
|
||||
$df | dfr get-weekday
|
||||
```
|
||||
|
||||
|
|
|
@ -18,4 +18,3 @@ Returns year from a date
|
|||
let df = ([$dt $dt] | dfr to-df);
|
||||
$df | dfr get-year
|
||||
```
|
||||
|
||||
|
|
|
@ -20,4 +20,3 @@ Creates dataframe with selected columns
|
|||
```shell
|
||||
> [[a b]; [1 2] [3 4]] | dfr to-df | dfr get a
|
||||
```
|
||||
|
||||
|
|
|
@ -20,4 +20,3 @@ Grouping by column a
|
|||
```shell
|
||||
> [[a b]; [one 1] [one 2]] | dfr to-df | dfr group-by a
|
||||
```
|
||||
|
||||
|
|
|
@ -16,4 +16,3 @@ Create mask indicating duplicated values
|
|||
```shell
|
||||
> [5 6 6 6 8 8 8] | dfr to-df | dfr is-duplicated
|
||||
```
|
||||
|
||||
|
|
|
@ -21,4 +21,3 @@ Checks if elements from a series are contained in right series
|
|||
> let other = ([1 3 6] | dfr to-df);
|
||||
[5 6 6 6 8 8 8] | dfr to-df | dfr is-in $other
|
||||
```
|
||||
|
||||
|
|
|
@ -18,4 +18,3 @@ Create mask where values are not null
|
|||
let res = ($s / $s);
|
||||
$res | dfr is-not-null
|
||||
```
|
||||
|
||||
|
|
|
@ -18,4 +18,3 @@ Create mask where values are null
|
|||
let res = ($s / $s);
|
||||
$res | dfr is-null
|
||||
```
|
||||
|
||||
|
|
|
@ -16,4 +16,3 @@ Create mask indicating unique values
|
|||
```shell
|
||||
> [5 6 6 6 8 8 8] | dfr to-df | dfr is-unique
|
||||
```
|
||||
|
||||
|
|
|
@ -25,4 +25,3 @@ inner join dataframe
|
|||
> let right = ([[a b c]; [1 2 5] [3 4 5] [5 6 6]] | dfr to-df);
|
||||
$right | dfr join $right -l [a b] -r [a b]
|
||||
```
|
||||
|
||||
|
|
|
@ -20,4 +20,3 @@ Create new dataframe with last rows
|
|||
```shell
|
||||
> [[a b]; [1 2] [3 4]] | dfr to-df | dfr last 1
|
||||
```
|
||||
|
||||
|
|
|
@ -23,4 +23,3 @@ melt dataframe
|
|||
```shell
|
||||
> [[a b c d]; [x 1 4 a] [y 2 5 b] [z 3 6 c]] | dfr to-df | dfr melt -c [b c] -v [a d]
|
||||
```
|
||||
|
||||
|
|
|
@ -16,4 +16,3 @@ Inverts boolean mask
|
|||
```shell
|
||||
> [$true $false $true] | dfr to-df | dfr not
|
||||
```
|
||||
|
||||
|
|
|
@ -25,4 +25,3 @@ Takes a file name and creates a dataframe
|
|||
```shell
|
||||
> dfr open test.csv
|
||||
```
|
||||
|
||||
|
|
|
@ -22,4 +22,3 @@ Pivot a dataframe on b and aggregation on col c
|
|||
```shell
|
||||
> [[a b c]; [one x 1] [two y 2]] | dfr to-df | dfr group-by a | dfr pivot b c sum
|
||||
```
|
||||
|
||||
|
|
|
@ -21,4 +21,3 @@ Renames a dataframe column
|
|||
```shell
|
||||
> [[a b]; [1 2] [3 4]] | dfr to-df | dfr rename-col a a_new
|
||||
```
|
||||
|
||||
|
|
|
@ -20,4 +20,3 @@ Renames a series
|
|||
```shell
|
||||
> [5 6 7 8] | dfr to-df | dfr rename new_name
|
||||
```
|
||||
|
||||
|
|
|
@ -21,4 +21,3 @@ Replaces string
|
|||
```shell
|
||||
> [abac abac abac] | dfr to-df | dfr replace-all -p a -r A
|
||||
```
|
||||
|
||||
|
|
|
@ -21,4 +21,3 @@ Replaces string
|
|||
```shell
|
||||
> [abc abc abc] | dfr to-df | dfr replace -p ab -r AB
|
||||
```
|
||||
|
||||
|
|
|
@ -26,4 +26,3 @@ Rolling max for a series
|
|||
```shell
|
||||
> [1 2 3 4 5] | dfr to-df | dfr rolling max 2 | dfr drop-nulls
|
||||
```
|
||||
|
||||
|
|
|
@ -27,4 +27,3 @@ Shows sample row using fraction and replace
|
|||
```shell
|
||||
> [[a b]; [1 2] [3 4] [5 6]] | dfr to-df | dfr sample -f 0.5 -e
|
||||
```
|
||||
|
||||
|
|
|
@ -23,4 +23,3 @@ Set value in selected rows from series
|
|||
let indices = ([0 2] | dfr to-df);
|
||||
$series | dfr set-with-idx 6 -i $indices
|
||||
```
|
||||
|
||||
|
|
|
@ -23,4 +23,3 @@ Shifts the values by a given period
|
|||
let mask = ($s | dfr is-null);
|
||||
$s | dfr set 0 --mask $mask
|
||||
```
|
||||
|
||||
|
|
|
@ -16,4 +16,3 @@ Shows row and column shape
|
|||
```shell
|
||||
> [[a b]; [1 2] [3 4]] | dfr to-df | dfr shape
|
||||
```
|
||||
|
||||
|
|
|
@ -20,4 +20,3 @@ Shifts the values by a given period
|
|||
```shell
|
||||
> [1 2 2 3 3] | dfr to-df | dfr shift 2 | dfr drop-nulls
|
||||
```
|
||||
|
||||
|
|
|
@ -21,4 +21,3 @@ Create new dataframe from a slice of the rows
|
|||
```shell
|
||||
> [[a b]; [1 2] [3 4]] | dfr to-df | dfr slice 0 1
|
||||
```
|
||||
|
||||
|
|
|
@ -26,4 +26,3 @@ Create new sorted series
|
|||
```shell
|
||||
> [3 4 1 2] | dfr to-df | dfr sort
|
||||
```
|
||||
|
||||
|
|
|
@ -16,4 +16,3 @@ Returns string lengths
|
|||
```shell
|
||||
> [a ab abc] | dfr to-df | dfr str-lengths
|
||||
```
|
||||
|
||||
|
|
|
@ -21,4 +21,3 @@ Creates slices from the strings
|
|||
```shell
|
||||
> [abcded abc321 abc123] | dfr to-df | dfr str-slice 1 -l 2
|
||||
```
|
||||
|
||||
|
|
|
@ -22,4 +22,3 @@ Formats date
|
|||
let df = ([$dt $dt] | dfr to-df);
|
||||
$df | dfr strftime "%Y/%m/%d"
|
||||
```
|
||||
|
||||
|
|
|
@ -29,4 +29,3 @@ Takes selected rows from series
|
|||
let indices = ([0 2] | dfr to-df);
|
||||
$series | dfr take $indices
|
||||
```
|
||||
|
||||
|
|
|
@ -27,4 +27,3 @@ Saves dataframe to csv file using other delimiter
|
|||
```shell
|
||||
> [[a b]; [1 2] [3 4]] | dfr to-df | dfr to-csv test.csv -d '|'
|
||||
```
|
||||
|
||||
|
|
|
@ -31,4 +31,3 @@ Takes a list of booleans and creates a dataframe
|
|||
```shell
|
||||
> [$true $true $false] | dfr to-df
|
||||
```
|
||||
|
||||
|
|
|
@ -21,4 +21,3 @@ Create new dataframe with dummy variables from a series
|
|||
```shell
|
||||
> [1 2 2 3 3] | dfr to-df | dfr to-dummies
|
||||
```
|
||||
|
||||
|
|
|
@ -16,4 +16,3 @@ Modifies strings to lowercase
|
|||
```shell
|
||||
> [Abc aBc abC] | dfr to-df | dfr to-lowercase
|
||||
```
|
||||
|
||||
|
|
|
@ -26,4 +26,3 @@ Shows tail rows from dataframe
|
|||
```shell
|
||||
> [[a b]; [1 2] [3 4] [5 6]] | dfr to-df | dfr to-nu -t -n 1
|
||||
```
|
||||
|
||||
|
|
|
@ -20,4 +20,3 @@ Saves dataframe to csv file
|
|||
```shell
|
||||
> [[a b]; [1 2] [3 4]] | dfr to-df | dfr to-parquet test.parquet
|
||||
```
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue