diff --git a/.vuepress/configs/sidebar/command_categories.ts b/.vuepress/configs/sidebar/command_categories.ts index b396886c26..53b047a60d 100644 --- a/.vuepress/configs/sidebar/command_categories.ts +++ b/.vuepress/configs/sidebar/command_categories.ts @@ -10,6 +10,7 @@ export const commandCategories = [ '/commands/categories/date.md', '/commands/categories/debug.md', '/commands/categories/default.md', + '/commands/categories/deprecated.md', '/commands/categories/env.md', '/commands/categories/expression.md', '/commands/categories/filesystem.md', diff --git a/commands/categories/deprecated.md b/commands/categories/deprecated.md index 4b84bb9679..319829d2e3 100644 --- a/commands/categories/deprecated.md +++ b/commands/categories/deprecated.md @@ -20,7 +20,7 @@ Description - {{ command.title }} + {{ command.title }} {{ command.frontmatter.usage }} diff --git a/commands/docs/alias.md b/commands/docs/alias.md index a58b552b7f..ee85622e5a 100644 --- a/commands/docs/alias.md +++ b/commands/docs/alias.md @@ -2,7 +2,7 @@ title: alias categories: | core -version: 0.100.0 +version: 0.101.0 core: | Alias a command (with optional flags) to a new name. usage: | diff --git a/commands/docs/all.md b/commands/docs/all.md index 993074a848..d0ab69f2b9 100644 --- a/commands/docs/all.md +++ b/commands/docs/all.md @@ -2,7 +2,7 @@ title: all categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Test if every element of the input fulfills a predicate expression. usage: | diff --git a/commands/docs/ansi.md b/commands/docs/ansi.md index 43c0fdc864..58c2c1ef01 100644 --- a/commands/docs/ansi.md +++ b/commands/docs/ansi.md @@ -2,7 +2,7 @@ title: ansi categories: | platform -version: 0.100.0 +version: 0.101.0 platform: | Output ANSI codes to change color and style of text. usage: | diff --git a/commands/docs/ansi_gradient.md b/commands/docs/ansi_gradient.md index 2256cb053d..2093ee2010 100644 --- a/commands/docs/ansi_gradient.md +++ b/commands/docs/ansi_gradient.md @@ -2,7 +2,7 @@ title: ansi gradient categories: | platform -version: 0.100.0 +version: 0.101.0 platform: | Add a color gradient (using ANSI color codes) to the given string. usage: | diff --git a/commands/docs/ansi_link.md b/commands/docs/ansi_link.md index a95d214f98..6f7b6e65bf 100644 --- a/commands/docs/ansi_link.md +++ b/commands/docs/ansi_link.md @@ -2,7 +2,7 @@ title: ansi link categories: | platform -version: 0.100.0 +version: 0.101.0 platform: | Add a link (using OSC 8 escape sequence) to the given string. usage: | diff --git a/commands/docs/ansi_strip.md b/commands/docs/ansi_strip.md index 3b4b9e2690..b46d68d500 100644 --- a/commands/docs/ansi_strip.md +++ b/commands/docs/ansi_strip.md @@ -2,7 +2,7 @@ title: ansi strip categories: | platform -version: 0.100.0 +version: 0.101.0 platform: | Strip ANSI escape sequences from a string. usage: | diff --git a/commands/docs/any.md b/commands/docs/any.md index bf1c678d62..c6d1eabbde 100644 --- a/commands/docs/any.md +++ b/commands/docs/any.md @@ -2,7 +2,7 @@ title: any categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Tests if any element of the input fulfills a predicate expression. usage: | diff --git a/commands/docs/append.md b/commands/docs/append.md index b32c52c606..bffc303d92 100644 --- a/commands/docs/append.md +++ b/commands/docs/append.md @@ -2,7 +2,7 @@ title: append categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Append any number of rows to a table. usage: | diff --git a/commands/docs/ast.md b/commands/docs/ast.md index 40af81cc5a..e9fb5be7c8 100644 --- a/commands/docs/ast.md +++ b/commands/docs/ast.md @@ -2,7 +2,7 @@ title: ast categories: | debug -version: 0.100.0 +version: 0.101.0 debug: | Print the abstract syntax tree (ast) for a pipeline. usage: | @@ -20,8 +20,9 @@ usage: | ## Flags - - `--json, -j`: serialize to json - - `--minify, -m`: minify the nuon or json output + - `--json, -j`: Serialize to json + - `--minify, -m`: Minify the nuon or json output + - `--flatten, -f`: An easier to read version of the ast ## Parameters @@ -30,9 +31,9 @@ usage: | ## Input/output types: -| input | output | -| ------ | ------ | -| string | record | +| input | output | +| ------- | ------ | +| nothing | table | ## Examples @@ -65,3 +66,57 @@ Print the ast of a pipeline with an error, as json, minified > ast 'for x in 1..10 { echo $x ' --json --minify ``` + +Print the ast of a string flattened +```nu +> ast "'hello'" --flatten +╭───┬─────────┬──────────────┬───────────────╮ +│ # │ content │ shape │ span │ +├───┼─────────┼──────────────┼───────────────┤ +│ 0 │ 'hello' │ shape_string │ ╭───────┬───╮ │ +│ │ │ │ │ start │ 0 │ │ +│ │ │ │ │ end │ 7 │ │ +│ │ │ │ ╰───────┴───╯ │ +╰───┴─────────┴──────────────┴───────────────╯ + +``` + +Print the ast of a string flattened, as json, minified +```nu +> ast "'hello'" --flatten --json --minify +[{"content":"'hello'","shape":"shape_string","span":{"start":0,"end":7}}] +``` + +Print the ast of a pipeline flattened +```nu +> ast 'ls | sort-by type name -i' --flatten +╭───┬─────────┬────────────────────┬────────────────╮ +│ # │ content │ shape │ span │ +├───┼─────────┼────────────────────┼────────────────┤ +│ 0 │ ls │ shape_external │ ╭───────┬───╮ │ +│ │ │ │ │ start │ 0 │ │ +│ │ │ │ │ end │ 2 │ │ +│ │ │ │ ╰───────┴───╯ │ +│ 1 │ | │ shape_pipe │ ╭───────┬───╮ │ +│ │ │ │ │ start │ 3 │ │ +│ │ │ │ │ end │ 4 │ │ +│ │ │ │ ╰───────┴───╯ │ +│ 2 │ sort-by │ shape_internalcall │ ╭───────┬────╮ │ +│ │ │ │ │ start │ 5 │ │ +│ │ │ │ │ end │ 12 │ │ +│ │ │ │ ╰───────┴────╯ │ +│ 3 │ type │ shape_string │ ╭───────┬────╮ │ +│ │ │ │ │ start │ 13 │ │ +│ │ │ │ │ end │ 17 │ │ +│ │ │ │ ╰───────┴────╯ │ +│ 4 │ name │ shape_string │ ╭───────┬────╮ │ +│ │ │ │ │ start │ 18 │ │ +│ │ │ │ │ end │ 22 │ │ +│ │ │ │ ╰───────┴────╯ │ +│ 5 │ -i │ shape_flag │ ╭───────┬────╮ │ +│ │ │ │ │ start │ 23 │ │ +│ │ │ │ │ end │ 25 │ │ +│ │ │ │ ╰───────┴────╯ │ +╰───┴─────────┴────────────────────┴────────────────╯ + +``` diff --git a/commands/docs/banner.md b/commands/docs/banner.md index 6dcd3b9141..b54a6e1185 100644 --- a/commands/docs/banner.md +++ b/commands/docs/banner.md @@ -2,7 +2,7 @@ title: banner categories: | default -version: 0.100.0 +version: 0.101.0 default: | Print a banner for nushell with information about the project usage: | diff --git a/commands/docs/bits.md b/commands/docs/bits.md index f346958638..aa2240eb10 100644 --- a/commands/docs/bits.md +++ b/commands/docs/bits.md @@ -2,7 +2,7 @@ title: bits categories: | bits -version: 0.100.0 +version: 0.101.0 bits: | Various commands for working with bits. usage: | diff --git a/commands/docs/bits_and.md b/commands/docs/bits_and.md index 1439677d72..b5e0ba2dcc 100644 --- a/commands/docs/bits_and.md +++ b/commands/docs/bits_and.md @@ -2,7 +2,7 @@ title: bits and categories: | bits -version: 0.100.0 +version: 0.101.0 bits: | Performs bitwise and for ints or binary values. usage: | diff --git a/commands/docs/bits_not.md b/commands/docs/bits_not.md index a831d9c678..bd75735368 100644 --- a/commands/docs/bits_not.md +++ b/commands/docs/bits_not.md @@ -2,7 +2,7 @@ title: bits not categories: | bits -version: 0.100.0 +version: 0.101.0 bits: | Performs logical negation on each bit. usage: | diff --git a/commands/docs/bits_or.md b/commands/docs/bits_or.md index eb1cc9e342..e18e24e2d9 100644 --- a/commands/docs/bits_or.md +++ b/commands/docs/bits_or.md @@ -2,7 +2,7 @@ title: bits or categories: | bits -version: 0.100.0 +version: 0.101.0 bits: | Performs bitwise or for ints or binary values. usage: | diff --git a/commands/docs/bits_rol.md b/commands/docs/bits_rol.md index 415f923260..d843612d59 100644 --- a/commands/docs/bits_rol.md +++ b/commands/docs/bits_rol.md @@ -2,7 +2,7 @@ title: bits rol categories: | bits -version: 0.100.0 +version: 0.101.0 bits: | Bitwise rotate left for ints or binary values. usage: | diff --git a/commands/docs/bits_ror.md b/commands/docs/bits_ror.md index e0eeb0af15..f404fd0860 100644 --- a/commands/docs/bits_ror.md +++ b/commands/docs/bits_ror.md @@ -2,7 +2,7 @@ title: bits ror categories: | bits -version: 0.100.0 +version: 0.101.0 bits: | Bitwise rotate right for ints or binary values. usage: | diff --git a/commands/docs/bits_shl.md b/commands/docs/bits_shl.md index da16546e0f..4d1b86c469 100644 --- a/commands/docs/bits_shl.md +++ b/commands/docs/bits_shl.md @@ -2,7 +2,7 @@ title: bits shl categories: | bits -version: 0.100.0 +version: 0.101.0 bits: | Bitwise shift left for ints or binary values. usage: | diff --git a/commands/docs/bits_shr.md b/commands/docs/bits_shr.md index 4321e5ba3e..1d9d576300 100644 --- a/commands/docs/bits_shr.md +++ b/commands/docs/bits_shr.md @@ -2,7 +2,7 @@ title: bits shr categories: | bits -version: 0.100.0 +version: 0.101.0 bits: | Bitwise shift right for ints or binary values. usage: | diff --git a/commands/docs/bits_xor.md b/commands/docs/bits_xor.md index 42016a3494..2f826d0091 100644 --- a/commands/docs/bits_xor.md +++ b/commands/docs/bits_xor.md @@ -2,7 +2,7 @@ title: bits xor categories: | bits -version: 0.100.0 +version: 0.101.0 bits: | Performs bitwise xor for ints or binary values. usage: | diff --git a/commands/docs/break.md b/commands/docs/break.md index d630e2054c..6e062109b0 100644 --- a/commands/docs/break.md +++ b/commands/docs/break.md @@ -2,7 +2,7 @@ title: break categories: | core -version: 0.100.0 +version: 0.101.0 core: | Break a loop. usage: | diff --git a/commands/docs/bytes.md b/commands/docs/bytes.md index ebd408ea84..7dd6e90bb8 100644 --- a/commands/docs/bytes.md +++ b/commands/docs/bytes.md @@ -2,7 +2,7 @@ title: bytes categories: | bytes -version: 0.100.0 +version: 0.101.0 bytes: | Various commands for working with byte data. usage: | diff --git a/commands/docs/bytes_add.md b/commands/docs/bytes_add.md index f89d7f3f82..f46f6a4f34 100644 --- a/commands/docs/bytes_add.md +++ b/commands/docs/bytes_add.md @@ -2,7 +2,7 @@ title: bytes add categories: | bytes -version: 0.100.0 +version: 0.101.0 bytes: | Add specified bytes to the input. usage: | diff --git a/commands/docs/bytes_at.md b/commands/docs/bytes_at.md index 868980a376..dba6cf4e29 100644 --- a/commands/docs/bytes_at.md +++ b/commands/docs/bytes_at.md @@ -2,7 +2,7 @@ title: bytes at categories: | bytes -version: 0.100.0 +version: 0.101.0 bytes: | Get bytes defined by a range. usage: | diff --git a/commands/docs/bytes_build.md b/commands/docs/bytes_build.md index 8b8c926cf0..ced3e56713 100644 --- a/commands/docs/bytes_build.md +++ b/commands/docs/bytes_build.md @@ -2,7 +2,7 @@ title: bytes build categories: | bytes -version: 0.100.0 +version: 0.101.0 bytes: | Create bytes from the arguments. usage: | diff --git a/commands/docs/bytes_collect.md b/commands/docs/bytes_collect.md index ddfb4d9745..f1f20656e8 100644 --- a/commands/docs/bytes_collect.md +++ b/commands/docs/bytes_collect.md @@ -2,7 +2,7 @@ title: bytes collect categories: | bytes -version: 0.100.0 +version: 0.101.0 bytes: | Concatenate multiple binary into a single binary, with an optional separator between each. usage: | diff --git a/commands/docs/bytes_ends-with.md b/commands/docs/bytes_ends-with.md index 98c945d716..01edfcbd9a 100644 --- a/commands/docs/bytes_ends-with.md +++ b/commands/docs/bytes_ends-with.md @@ -2,7 +2,7 @@ title: bytes ends-with categories: | bytes -version: 0.100.0 +version: 0.101.0 bytes: | Check if bytes ends with a pattern. usage: | diff --git a/commands/docs/bytes_index-of.md b/commands/docs/bytes_index-of.md index 34ba4e4177..5c2f764172 100644 --- a/commands/docs/bytes_index-of.md +++ b/commands/docs/bytes_index-of.md @@ -2,7 +2,7 @@ title: bytes index-of categories: | bytes -version: 0.100.0 +version: 0.101.0 bytes: | Returns start index of first occurrence of pattern in bytes, or -1 if no match. usage: | diff --git a/commands/docs/bytes_length.md b/commands/docs/bytes_length.md index 13bf8eae55..c952be7a7e 100644 --- a/commands/docs/bytes_length.md +++ b/commands/docs/bytes_length.md @@ -2,7 +2,7 @@ title: bytes length categories: | bytes -version: 0.100.0 +version: 0.101.0 bytes: | Output the length of any bytes in the pipeline. usage: | diff --git a/commands/docs/bytes_remove.md b/commands/docs/bytes_remove.md index f25f5ad88f..94c2a490e1 100644 --- a/commands/docs/bytes_remove.md +++ b/commands/docs/bytes_remove.md @@ -2,7 +2,7 @@ title: bytes remove categories: | bytes -version: 0.100.0 +version: 0.101.0 bytes: | Remove bytes. usage: | diff --git a/commands/docs/bytes_replace.md b/commands/docs/bytes_replace.md index 080fef8ffe..9dce8d457b 100644 --- a/commands/docs/bytes_replace.md +++ b/commands/docs/bytes_replace.md @@ -2,7 +2,7 @@ title: bytes replace categories: | bytes -version: 0.100.0 +version: 0.101.0 bytes: | Find and replace binary. usage: | diff --git a/commands/docs/bytes_reverse.md b/commands/docs/bytes_reverse.md index 40efe4b0e6..f27cbd6e31 100644 --- a/commands/docs/bytes_reverse.md +++ b/commands/docs/bytes_reverse.md @@ -2,7 +2,7 @@ title: bytes reverse categories: | bytes -version: 0.100.0 +version: 0.101.0 bytes: | Reverse the bytes in the pipeline. usage: | diff --git a/commands/docs/bytes_starts-with.md b/commands/docs/bytes_starts-with.md index f0f7492523..3a519ddf3b 100644 --- a/commands/docs/bytes_starts-with.md +++ b/commands/docs/bytes_starts-with.md @@ -2,7 +2,7 @@ title: bytes starts-with categories: | bytes -version: 0.100.0 +version: 0.101.0 bytes: | Check if bytes starts with a pattern. usage: | diff --git a/commands/docs/cal.md b/commands/docs/cal.md index 1362189159..f9aaf2d233 100644 --- a/commands/docs/cal.md +++ b/commands/docs/cal.md @@ -2,7 +2,7 @@ title: cal categories: | generators -version: 0.100.0 +version: 0.101.0 generators: | Display a calendar. usage: | diff --git a/commands/docs/cd.md b/commands/docs/cd.md index 34e3c44d3e..4058d201b2 100644 --- a/commands/docs/cd.md +++ b/commands/docs/cd.md @@ -2,7 +2,7 @@ title: cd categories: | filesystem -version: 0.100.0 +version: 0.101.0 filesystem: | Change directory. usage: | diff --git a/commands/docs/char.md b/commands/docs/char.md index 865510e4db..c70fb1ff22 100644 --- a/commands/docs/char.md +++ b/commands/docs/char.md @@ -2,7 +2,7 @@ title: char categories: | strings -version: 0.100.0 +version: 0.101.0 strings: | Output special characters (e.g., 'newline'). usage: | diff --git a/commands/docs/chunk-by.md b/commands/docs/chunk-by.md new file mode 100644 index 0000000000..ef38783350 --- /dev/null +++ b/commands/docs/chunk-by.md @@ -0,0 +1,100 @@ +--- +title: chunk-by +categories: | + filters +version: 0.101.0 +filters: | + Divides a sequence into sub-sequences based on a closure. +usage: | + Divides a sequence into sub-sequences based on a closure. +--- + + +# `chunk-by` for [filters](/commands/categories/filters.md) + +
Divides a sequence into sub-sequences based on a closure.
+ +## Signature + +```> chunk-by {flags} (closure)``` + +## Parameters + + - `closure`: The closure to run. + + +## Input/output types: + +| input | output | +| --------- | --------------- | +| list\ | list\\> | +| range | list\\> | +## Examples + +Chunk data into runs of larger than zero or not. +```nu +> [1, 3, -2, -2, 0, 1, 2] | chunk-by {|it| $it >= 0 } +╭───┬────────────╮ +│ 0 │ ╭───┬───╮ │ +│ │ │ 0 │ 1 │ │ +│ │ │ 1 │ 3 │ │ +│ │ ╰───┴───╯ │ +│ 1 │ ╭───┬────╮ │ +│ │ │ 0 │ -2 │ │ +│ │ │ 1 │ -2 │ │ +│ │ ╰───┴────╯ │ +│ 2 │ ╭───┬───╮ │ +│ │ │ 0 │ 0 │ │ +│ │ │ 1 │ 1 │ │ +│ │ │ 2 │ 2 │ │ +│ │ ╰───┴───╯ │ +╰───┴────────────╯ + +``` + +Identify repetitions in a string +```nu +> [a b b c c c] | chunk-by { |it| $it } +╭───┬───────────╮ +│ 0 │ ╭───┬───╮ │ +│ │ │ 0 │ a │ │ +│ │ ╰───┴───╯ │ +│ 1 │ ╭───┬───╮ │ +│ │ │ 0 │ b │ │ +│ │ │ 1 │ b │ │ +│ │ ╰───┴───╯ │ +│ 2 │ ╭───┬───╮ │ +│ │ │ 0 │ c │ │ +│ │ │ 1 │ c │ │ +│ │ │ 2 │ c │ │ +│ │ ╰───┴───╯ │ +╰───┴───────────╯ + +``` + +Chunk values of range by predicate +```nu +> (0..8) | chunk-by { |it| $it // 3 } +╭───┬───────────╮ +│ 0 │ ╭───┬───╮ │ +│ │ │ 0 │ 0 │ │ +│ │ │ 1 │ 1 │ │ +│ │ │ 2 │ 2 │ │ +│ │ ╰───┴───╯ │ +│ 1 │ ╭───┬───╮ │ +│ │ │ 0 │ 3 │ │ +│ │ │ 1 │ 4 │ │ +│ │ │ 2 │ 5 │ │ +│ │ ╰───┴───╯ │ +│ 2 │ ╭───┬───╮ │ +│ │ │ 0 │ 6 │ │ +│ │ │ 1 │ 7 │ │ +│ │ │ 2 │ 8 │ │ +│ │ ╰───┴───╯ │ +╰───┴───────────╯ + +``` + +## Notes +chunk-by applies the given closure to each value of the input list, and groups +consecutive elements that share the same closure result value into lists. \ No newline at end of file diff --git a/commands/docs/chunks.md b/commands/docs/chunks.md index 6ab137c24e..b168778199 100644 --- a/commands/docs/chunks.md +++ b/commands/docs/chunks.md @@ -2,7 +2,7 @@ title: chunks categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Divide a list or table into chunks of `chunk_size`. usage: | diff --git a/commands/docs/clear.md b/commands/docs/clear.md index eb5e9a7aa9..1d4f612820 100644 --- a/commands/docs/clear.md +++ b/commands/docs/clear.md @@ -2,7 +2,7 @@ title: clear categories: | platform -version: 0.100.0 +version: 0.101.0 platform: | Clear the terminal. usage: | diff --git a/commands/docs/collect.md b/commands/docs/collect.md index 0a819b37bc..17f2f8cc48 100644 --- a/commands/docs/collect.md +++ b/commands/docs/collect.md @@ -2,7 +2,7 @@ title: collect categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Collect a stream into a value. usage: | diff --git a/commands/docs/columns.md b/commands/docs/columns.md index 421b97bc86..bdac3d5b6c 100644 --- a/commands/docs/columns.md +++ b/commands/docs/columns.md @@ -2,7 +2,7 @@ title: columns categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Given a record or table, produce a list of its columns' names. usage: | diff --git a/commands/docs/commandline.md b/commands/docs/commandline.md index 78b905be71..f090105e7c 100644 --- a/commands/docs/commandline.md +++ b/commands/docs/commandline.md @@ -2,7 +2,7 @@ title: commandline categories: | core -version: 0.100.0 +version: 0.101.0 core: | View the current command line input buffer. usage: | diff --git a/commands/docs/commandline_edit.md b/commands/docs/commandline_edit.md index 4b6af4e6c0..96799c21ce 100644 --- a/commands/docs/commandline_edit.md +++ b/commands/docs/commandline_edit.md @@ -2,7 +2,7 @@ title: commandline edit categories: | core -version: 0.100.0 +version: 0.101.0 core: | Modify the current command line input buffer. usage: | diff --git a/commands/docs/commandline_get-cursor.md b/commands/docs/commandline_get-cursor.md index ec034b46ae..e7338f8df1 100644 --- a/commands/docs/commandline_get-cursor.md +++ b/commands/docs/commandline_get-cursor.md @@ -2,7 +2,7 @@ title: commandline get-cursor categories: | core -version: 0.100.0 +version: 0.101.0 core: | Get the current cursor position. usage: | diff --git a/commands/docs/commandline_set-cursor.md b/commands/docs/commandline_set-cursor.md index 79ca112d03..5138904a24 100644 --- a/commands/docs/commandline_set-cursor.md +++ b/commands/docs/commandline_set-cursor.md @@ -2,7 +2,7 @@ title: commandline set-cursor categories: | core -version: 0.100.0 +version: 0.101.0 core: | Set the current cursor position. usage: | diff --git a/commands/docs/compact.md b/commands/docs/compact.md index fc724340cb..025d708961 100644 --- a/commands/docs/compact.md +++ b/commands/docs/compact.md @@ -2,7 +2,7 @@ title: compact categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Creates a table with non-empty rows. usage: | diff --git a/commands/docs/complete.md b/commands/docs/complete.md index e9803fe1a2..dd0939952d 100644 --- a/commands/docs/complete.md +++ b/commands/docs/complete.md @@ -2,7 +2,7 @@ title: complete categories: | system -version: 0.100.0 +version: 0.101.0 system: | Capture the outputs and exit code from an external piped in command in a nushell table. usage: | diff --git a/commands/docs/config.md b/commands/docs/config.md index 9723bd9948..891223287a 100644 --- a/commands/docs/config.md +++ b/commands/docs/config.md @@ -2,7 +2,7 @@ title: config categories: | env -version: 0.100.0 +version: 0.101.0 env: | Edit nushell configuration files. usage: | @@ -30,8 +30,9 @@ You must use one of the following subcommands. Using this command as-is will onl ## Subcommands: -| name | description | type | -| ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------- | -------- | -| [`config env`](/commands/docs/config_env.md) | Edit nu environment configurations. | built-in | -| [`config nu`](/commands/docs/config_nu.md) | Edit nu configurations. | built-in | -| [`config reset`](/commands/docs/config_reset.md) | Reset nushell environment configurations to default, and saves old config files in the config location as oldconfig.nu and oldenv.nu. | built-in | \ No newline at end of file +| name | description | type | +| ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | -------- | +| [`config env`](/commands/docs/config_env.md) | Edit nu environment configurations. | built-in | +| [`config flatten`](/commands/docs/config_flatten.md) | Show the current configuration in a flattened form. | built-in | +| [`config nu`](/commands/docs/config_nu.md) | Edit nu configurations. | built-in | +| [`config reset`](/commands/docs/config_reset.md) | Reset nushell environment configurations to default, and saves old config files in the config location as oldconfig.nu and oldenv.nu. | built-in | \ No newline at end of file diff --git a/commands/docs/config_env.md b/commands/docs/config_env.md index 702733469c..aa4f3a7436 100644 --- a/commands/docs/config_env.md +++ b/commands/docs/config_env.md @@ -2,7 +2,7 @@ title: config env categories: | env -version: 0.100.0 +version: 0.101.0 env: | Edit nu environment configurations. usage: | @@ -20,7 +20,8 @@ usage: | ## Flags - - `--default, -d`: Print default `env.nu` file instead. + - `--default, -d`: Print the internal default `env.nu` file instead. + - `--doc, -s`: Print a commented `env.nu` with documentation instead. ## Input/output types: @@ -31,20 +32,20 @@ usage: | ## Examples -allow user to open and update nu env +open user's env.nu in the default editor ```nu > config env ``` -allow user to print default `env.nu` file +pretty-print a commented `env.nu` that explains common settings ```nu -> config env --default, +> config env --doc | nu-highlight, ``` -allow saving the default `env.nu` locally +pretty-print the internal `env.nu` file which is loaded before the user's environment ```nu -> config env --default | save -f ~/.config/nushell/default_env.nu +> config env --default | nu-highlight, ``` diff --git a/commands/docs/config_flatten.md b/commands/docs/config_flatten.md new file mode 100644 index 0000000000..fc5044f2e2 --- /dev/null +++ b/commands/docs/config_flatten.md @@ -0,0 +1,34 @@ +--- +title: config flatten +categories: | + debug +version: 0.101.0 +debug: | + Show the current configuration in a flattened form. +usage: | + Show the current configuration in a flattened form. +--- + + +# `config flatten` for [debug](/commands/categories/debug.md) + +
Show the current configuration in a flattened form.
+ +## Signature + +```> config flatten {flags} ``` + + +## Input/output types: + +| input | output | +| ------- | ------ | +| nothing | record | + +## Examples + +Show the current configuration in a flattened form +```nu +> config flatten + +``` diff --git a/commands/docs/config_nu.md b/commands/docs/config_nu.md index 7a09414925..4bb092b1c1 100644 --- a/commands/docs/config_nu.md +++ b/commands/docs/config_nu.md @@ -2,7 +2,7 @@ title: config nu categories: | env -version: 0.100.0 +version: 0.101.0 env: | Edit nu configurations. usage: | @@ -20,7 +20,8 @@ usage: | ## Flags - - `--default, -d`: Print default `config.nu` file instead. + - `--default, -d`: Print the internal default `config.nu` file instead. + - `--doc, -s`: Print a commented `config.nu` with documentation instead. ## Input/output types: @@ -31,20 +32,20 @@ usage: | ## Examples -allow user to open and update nu config +open user's config.nu in the default editor ```nu > config nu ``` -allow user to print default `config.nu` file +pretty-print a commented `config.nu` that explains common settings ```nu -> config nu --default, +> config nu --doc | nu-highlight ``` -allow saving the default `config.nu` locally +pretty-print the internal `config.nu` file which is loaded before user's config ```nu -> config nu --default | save -f ~/.config/nushell/default_config.nu +> config nu --default | nu-highlight ``` diff --git a/commands/docs/config_reset.md b/commands/docs/config_reset.md index 2ff1661329..426df0258d 100644 --- a/commands/docs/config_reset.md +++ b/commands/docs/config_reset.md @@ -2,7 +2,7 @@ title: config reset categories: | env -version: 0.100.0 +version: 0.101.0 env: | Reset nushell environment configurations to default, and saves old config files in the config location as oldconfig.nu and oldenv.nu. usage: | diff --git a/commands/docs/const.md b/commands/docs/const.md index 1fbfb874ec..f83d391d5a 100644 --- a/commands/docs/const.md +++ b/commands/docs/const.md @@ -2,7 +2,7 @@ title: const categories: | core -version: 0.100.0 +version: 0.101.0 core: | Create a parse-time constant. usage: | diff --git a/commands/docs/continue.md b/commands/docs/continue.md index 632f22db41..d9f9d56ae1 100644 --- a/commands/docs/continue.md +++ b/commands/docs/continue.md @@ -2,7 +2,7 @@ title: continue categories: | core -version: 0.100.0 +version: 0.101.0 core: | Continue a loop from the next iteration. usage: | diff --git a/commands/docs/cp.md b/commands/docs/cp.md index c09563fb01..ed40d38b64 100644 --- a/commands/docs/cp.md +++ b/commands/docs/cp.md @@ -2,7 +2,7 @@ title: cp categories: | filesystem -version: 0.100.0 +version: 0.101.0 filesystem: | Copy files using uutils/coreutils cp. usage: | diff --git a/commands/docs/date.md b/commands/docs/date.md index 021a8faaab..096af90519 100644 --- a/commands/docs/date.md +++ b/commands/docs/date.md @@ -2,7 +2,7 @@ title: date categories: | date -version: 0.100.0 +version: 0.101.0 date: | Date-related commands. usage: | diff --git a/commands/docs/date_format.md b/commands/docs/date_format.md index af01cf2bf4..3b35bdda10 100644 --- a/commands/docs/date_format.md +++ b/commands/docs/date_format.md @@ -2,7 +2,7 @@ title: date format categories: | removed -version: 0.100.0 +version: 0.101.0 removed: | Removed command: use `format date` instead. usage: | diff --git a/commands/docs/date_humanize.md b/commands/docs/date_humanize.md index c4d57acbf5..367fe97538 100644 --- a/commands/docs/date_humanize.md +++ b/commands/docs/date_humanize.md @@ -2,7 +2,7 @@ title: date humanize categories: | date -version: 0.100.0 +version: 0.101.0 date: | Print a 'humanized' format for the date, relative to now. usage: | diff --git a/commands/docs/date_list-timezone.md b/commands/docs/date_list-timezone.md index 91c4c2cccc..b7118f443a 100644 --- a/commands/docs/date_list-timezone.md +++ b/commands/docs/date_list-timezone.md @@ -2,7 +2,7 @@ title: date list-timezone categories: | date -version: 0.100.0 +version: 0.101.0 date: | List supported time zones. usage: | diff --git a/commands/docs/date_now.md b/commands/docs/date_now.md index 4fa1063e7d..666b26bb37 100644 --- a/commands/docs/date_now.md +++ b/commands/docs/date_now.md @@ -2,7 +2,7 @@ title: date now categories: | date -version: 0.100.0 +version: 0.101.0 date: | Get the current date. usage: | diff --git a/commands/docs/date_to-record.md b/commands/docs/date_to-record.md index 3778209082..7dd9203bfc 100644 --- a/commands/docs/date_to-record.md +++ b/commands/docs/date_to-record.md @@ -1,16 +1,16 @@ --- title: date to-record categories: | - date -version: 0.100.0 -date: | + deprecated +version: 0.101.0 +deprecated: | Convert the date into a record. usage: | Convert the date into a record. --- -# `date to-record` for [date](/commands/categories/date.md) +# `date to-record` for [deprecated](/commands/categories/deprecated.md)
Convert the date into a record.
diff --git a/commands/docs/date_to-table.md b/commands/docs/date_to-table.md index 342d72af2a..c2821dde69 100644 --- a/commands/docs/date_to-table.md +++ b/commands/docs/date_to-table.md @@ -1,16 +1,16 @@ --- title: date to-table categories: | - date -version: 0.100.0 -date: | + deprecated +version: 0.101.0 +deprecated: | Convert the date into a structured table. usage: | Convert the date into a structured table. --- -# `date to-table` for [date](/commands/categories/date.md) +# `date to-table` for [deprecated](/commands/categories/deprecated.md)
Convert the date into a structured table.
diff --git a/commands/docs/date_to-timezone.md b/commands/docs/date_to-timezone.md index 16e7a086cc..9aa8ad7fdf 100644 --- a/commands/docs/date_to-timezone.md +++ b/commands/docs/date_to-timezone.md @@ -2,7 +2,7 @@ title: date to-timezone categories: | date -version: 0.100.0 +version: 0.101.0 date: | Convert a date to a given time zone. usage: | diff --git a/commands/docs/debug.md b/commands/docs/debug.md index 2aaf312c6d..c5616045cf 100644 --- a/commands/docs/debug.md +++ b/commands/docs/debug.md @@ -2,7 +2,7 @@ title: debug categories: | debug -version: 0.100.0 +version: 0.101.0 debug: | Debug print the value(s) piped in. usage: | diff --git a/commands/docs/debug_info.md b/commands/docs/debug_info.md index cad605f8b8..5bcfb6e9f4 100644 --- a/commands/docs/debug_info.md +++ b/commands/docs/debug_info.md @@ -2,7 +2,7 @@ title: debug info categories: | debug -version: 0.100.0 +version: 0.101.0 debug: | View process memory info. usage: | diff --git a/commands/docs/debug_profile.md b/commands/docs/debug_profile.md index bd8b1448f2..21597429c5 100644 --- a/commands/docs/debug_profile.md +++ b/commands/docs/debug_profile.md @@ -2,7 +2,7 @@ title: debug profile categories: | debug -version: 0.100.0 +version: 0.101.0 debug: | Profile pipeline elements in a closure. usage: | @@ -23,8 +23,6 @@ usage: | - `--spans, -s`: Collect spans of profiled elements - `--expand-source, -e`: Collect full source fragments of profiled elements - `--values, -v`: Collect pipeline element output values - - `--expr, -x`: Collect expression types - - `--instructions, -i`: Collect IR instructions - `--lines, -l`: Collect line numbers - `--max-depth, -m {int}`: How many blocks/closures deep to step into (default 2) @@ -54,36 +52,51 @@ Profile config evaluation with more granularity ``` ## Notes -The profiler profiles every evaluated pipeline element inside a closure, stepping into all +The profiler profiles every evaluated instruction inside a closure, stepping into all commands calls and other blocks/closures. The output can be heavily customized. By default, the following columns are included: -- depth : Depth of the pipeline element. Each entered block adds one level of depth. How many +- depth : Depth of the instruction. Each entered block adds one level of depth. How many blocks deep to step into is controlled with the --max-depth option. -- id : ID of the pipeline element -- parent_id : ID of the parent element -- source : Source code of the pipeline element. If the element has multiple lines, only the - first line is used and `...` is appended to the end. Full source code can be shown - with the --expand-source flag. -- duration_ms : How long it took to run the pipeline element in milliseconds. -- (optional) span : Span of the element. Can be viewed via the `view span` command. Enabled with - the --spans flag. -- (optional) expr : The type of expression of the pipeline element. Enabled with the --expr flag. -- (optional) output : The output value of the pipeline element. Enabled with the --values flag. - -To illustrate the depth and IDs, consider `debug profile { if true { echo 'spam' } }`. There are -three pipeline elements: - -depth id parent_id - 0 0 0 debug profile { do { if true { 'spam' } } } - 1 1 0 if true { 'spam' } - 2 2 1 'spam' +- id : ID of the instruction +- parent_id : ID of the instruction that created the parent scope +- source : Source code that generated the instruction. If the source code has multiple lines, + only the first line is used and `...` is appended to the end. Full source code can + be shown with the --expand-source flag. +- pc : The index of the instruction within the block. +- instruction : The pretty printed instruction being evaluated. +- duration_ms : How long it took to run the instruction in milliseconds. +- (optional) span : Span associated with the instruction. Can be viewed via the `view span` + command. Enabled with the --spans flag. +- (optional) output : The output value of the instruction. Enabled with the --values flag. + +To illustrate the depth and IDs, consider `debug profile { do { if true { echo 'spam' } } }`. A unique ID is generated each time an instruction is executed, and there are two levels of depth: + +``` +depth id parent_id source pc instruction + 0 0 0 debug profile { do { if true { 'spam' } } } 0 + 1 1 0 { if true { 'spam' } } 0 load-literal %1, closure(2164) + 1 2 0 { if true { 'spam' } } 1 push-positional %1 + 1 3 0 { do { if true { 'spam' } } } 2 redirect-out caller + 1 4 0 { do { if true { 'spam' } } } 3 redirect-err caller + 1 5 0 do 4 call decl 7 "do", %0 + 2 6 5 true 0 load-literal %1, bool(true) + 2 7 5 if 1 not %1 + 2 8 5 if 2 branch-if %1, 5 + 2 9 5 'spam' 3 load-literal %0, string("spam") + 2 10 5 if 4 jump 6 + 2 11 5 { if true { 'spam' } } 6 return %0 + 1 12 0 { do { if true { 'spam' } } } 5 return %0 +``` Each block entered increments depth by 1 and each block left decrements it by one. This way you can -control the profiling granularity. Passing --max-depth=1 to the above would stop at -`if true { 'spam' }`. The id is used to identify each element. The parent_id tells you that 'spam' -was spawned from `if true { 'spam' }` which was spawned from the root `debug profile { ... }`. +control the profiling granularity. Passing --max-depth=1 to the above would stop inside the `do` +at `if true { 'spam' }`. The id is used to identify each element. The parent_id tells you that the +instructions inside the block are being executed because of `do` (5), which in turn was spawned from +the root `debug profile { ... }`. + +For a better understanding of how instructions map to source code, see the `view ir` command. -Note: In some cases, the ordering of piepeline elements might not be intuitive. For example, +Note: In some cases, the ordering of pipeline elements might not be intuitive. For example, `[ a bb cc ] | each { $in | str length }` involves some implicit collects and lazy evaluation confusing the id/parent_id hierarchy. The --expr flag is helpful for investigating these issues. \ No newline at end of file diff --git a/commands/docs/decode.md b/commands/docs/decode.md index 63ddf56eed..86be670b73 100644 --- a/commands/docs/decode.md +++ b/commands/docs/decode.md @@ -2,7 +2,7 @@ title: decode categories: | strings -version: 0.100.0 +version: 0.101.0 strings: | Decode bytes into a string. usage: | diff --git a/commands/docs/decode_base32.md b/commands/docs/decode_base32.md index b7b78e9028..4420c1232b 100644 --- a/commands/docs/decode_base32.md +++ b/commands/docs/decode_base32.md @@ -2,7 +2,7 @@ title: decode base32 categories: | formats -version: 0.100.0 +version: 0.101.0 formats: | Decode a Base32 value. usage: | diff --git a/commands/docs/decode_base32hex.md b/commands/docs/decode_base32hex.md index 5acb5a1793..ad2d13d7b1 100644 --- a/commands/docs/decode_base32hex.md +++ b/commands/docs/decode_base32hex.md @@ -2,7 +2,7 @@ title: decode base32hex categories: | formats -version: 0.100.0 +version: 0.101.0 formats: | Encode a base32hex value. usage: | diff --git a/commands/docs/decode_base64.md b/commands/docs/decode_base64.md index 527ef3e20a..aff61e69d0 100644 --- a/commands/docs/decode_base64.md +++ b/commands/docs/decode_base64.md @@ -2,7 +2,7 @@ title: decode base64 categories: | formats -version: 0.100.0 +version: 0.101.0 formats: | Decode a Base64 value. usage: | diff --git a/commands/docs/decode_hex.md b/commands/docs/decode_hex.md index 437c911da7..a7c08c83db 100644 --- a/commands/docs/decode_hex.md +++ b/commands/docs/decode_hex.md @@ -2,7 +2,7 @@ title: decode hex categories: | formats -version: 0.100.0 +version: 0.101.0 formats: | Hex decode a value. usage: | diff --git a/commands/docs/def.md b/commands/docs/def.md index c7a3164810..1f4096bd64 100644 --- a/commands/docs/def.md +++ b/commands/docs/def.md @@ -2,7 +2,7 @@ title: def categories: | core -version: 0.100.0 +version: 0.101.0 core: | Define a custom command. usage: | diff --git a/commands/docs/default.md b/commands/docs/default.md index 01ee90aef6..1f0090e6f3 100644 --- a/commands/docs/default.md +++ b/commands/docs/default.md @@ -2,7 +2,7 @@ title: default categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Sets a default value if a row's column is missing or null. usage: | diff --git a/commands/docs/describe.md b/commands/docs/describe.md index a2f297bcb9..a617a93bc5 100644 --- a/commands/docs/describe.md +++ b/commands/docs/describe.md @@ -2,7 +2,7 @@ title: describe categories: | core -version: 0.100.0 +version: 0.101.0 core: | Describe the type and structure of the value(s) piped in. usage: | diff --git a/commands/docs/detect_columns.md b/commands/docs/detect_columns.md index 9aed04aa6b..529bda3a18 100644 --- a/commands/docs/detect_columns.md +++ b/commands/docs/detect_columns.md @@ -2,7 +2,7 @@ title: detect columns categories: | strings -version: 0.100.0 +version: 0.101.0 strings: | Attempt to automatically split text into multiple columns. usage: | diff --git a/commands/docs/do.md b/commands/docs/do.md index cf4303b46f..1ee8caa8cd 100644 --- a/commands/docs/do.md +++ b/commands/docs/do.md @@ -2,7 +2,7 @@ title: do categories: | core -version: 0.100.0 +version: 0.101.0 core: | Run a closure, providing it with the pipeline input. usage: | @@ -58,18 +58,6 @@ Run the closure and ignore both shell and external program errors ``` -Run the closure and ignore shell errors -```nu -> do --ignore-shell-errors { thisisnotarealcommand } - -``` - -Run the closure and ignore external program errors -```nu -> do --ignore-program-errors { nu --commands 'exit 1' }; echo "I'll still run" - -``` - Abort the pipeline if a program returns a non-zero exit code ```nu > do --capture-errors { nu --commands 'exit 1' } | myscarycommand diff --git a/commands/docs/drop.md b/commands/docs/drop.md index f6eb534f7c..981e33a022 100644 --- a/commands/docs/drop.md +++ b/commands/docs/drop.md @@ -2,7 +2,7 @@ title: drop categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Remove items/rows from the end of the input list/table. Counterpart of `skip`. Opposite of `last`. usage: | diff --git a/commands/docs/drop_column.md b/commands/docs/drop_column.md index 17b9f3ad7e..2d3a504571 100644 --- a/commands/docs/drop_column.md +++ b/commands/docs/drop_column.md @@ -2,7 +2,7 @@ title: drop column categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Remove N columns at the right-hand end of the input table. To remove columns by name, use `reject`. usage: | diff --git a/commands/docs/drop_nth.md b/commands/docs/drop_nth.md index 8bbde9d788..28f1bc9f6f 100644 --- a/commands/docs/drop_nth.md +++ b/commands/docs/drop_nth.md @@ -2,7 +2,7 @@ title: drop nth categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Drop the selected rows. usage: | diff --git a/commands/docs/du.md b/commands/docs/du.md index 6a7cdea7ed..3fa7438f08 100644 --- a/commands/docs/du.md +++ b/commands/docs/du.md @@ -2,7 +2,7 @@ title: du categories: | filesystem -version: 0.100.0 +version: 0.101.0 filesystem: | Find disk usage sizes of specified items. usage: | @@ -20,8 +20,8 @@ usage: | ## Flags - - `--all, -a`: Output file sizes as well as directory sizes - `--deref, -r`: Dereference symlinks to their targets for size + - `--long, -l`: Get underlying directories and files for each entry - `--exclude, -x {glob}`: Exclude these file names - `--max-depth, -d {int}`: Directory recursion limit - `--min-size, -m {int}`: Exclude files below this size diff --git a/commands/docs/each.md b/commands/docs/each.md index c9ee7a7aac..dfc55f7113 100644 --- a/commands/docs/each.md +++ b/commands/docs/each.md @@ -2,7 +2,7 @@ title: each categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Run a closure on each row of the input list, creating a new list with the results. usage: | diff --git a/commands/docs/each_while.md b/commands/docs/each_while.md index cbab4cbf3e..cbdd7fc455 100644 --- a/commands/docs/each_while.md +++ b/commands/docs/each_while.md @@ -2,7 +2,7 @@ title: each while categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Run a closure on each row of the input list until a null is found, then create a new list with the results. usage: | diff --git a/commands/docs/echo.md b/commands/docs/echo.md index a910a94e4d..5fc6273df9 100644 --- a/commands/docs/echo.md +++ b/commands/docs/echo.md @@ -2,7 +2,7 @@ title: echo categories: | core -version: 0.100.0 +version: 0.101.0 core: | Returns its arguments, ignoring the piped-in value. usage: | diff --git a/commands/docs/encode.md b/commands/docs/encode.md index 643067a30f..433d1b302b 100644 --- a/commands/docs/encode.md +++ b/commands/docs/encode.md @@ -2,7 +2,7 @@ title: encode categories: | strings -version: 0.100.0 +version: 0.101.0 strings: | Encode a string into bytes. usage: | diff --git a/commands/docs/encode_base32.md b/commands/docs/encode_base32.md index d848b53b71..9c756eefd0 100644 --- a/commands/docs/encode_base32.md +++ b/commands/docs/encode_base32.md @@ -2,7 +2,7 @@ title: encode base32 categories: | formats -version: 0.100.0 +version: 0.101.0 formats: | Encode a string or binary value using Base32. usage: | diff --git a/commands/docs/encode_base32hex.md b/commands/docs/encode_base32hex.md index 1cc0ea90a0..1c4f17534e 100644 --- a/commands/docs/encode_base32hex.md +++ b/commands/docs/encode_base32hex.md @@ -2,7 +2,7 @@ title: encode base32hex categories: | formats -version: 0.100.0 +version: 0.101.0 formats: | Encode a binary value or a string using base32hex. usage: | diff --git a/commands/docs/encode_base64.md b/commands/docs/encode_base64.md index 81950becce..0dd9615bfa 100644 --- a/commands/docs/encode_base64.md +++ b/commands/docs/encode_base64.md @@ -2,7 +2,7 @@ title: encode base64 categories: | formats -version: 0.100.0 +version: 0.101.0 formats: | Encode a string or binary value using Base64. usage: | diff --git a/commands/docs/encode_hex.md b/commands/docs/encode_hex.md index 5c06c5586c..db14dbefad 100644 --- a/commands/docs/encode_hex.md +++ b/commands/docs/encode_hex.md @@ -2,7 +2,7 @@ title: encode hex categories: | formats -version: 0.100.0 +version: 0.101.0 formats: | Hex encode a binary value or a string. usage: | diff --git a/commands/docs/enumerate.md b/commands/docs/enumerate.md index 7ee7791b56..68594e8427 100644 --- a/commands/docs/enumerate.md +++ b/commands/docs/enumerate.md @@ -2,7 +2,7 @@ title: enumerate categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Enumerate the elements in a stream. usage: | diff --git a/commands/docs/error_make.md b/commands/docs/error_make.md index 7f54558377..5cfb114136 100644 --- a/commands/docs/error_make.md +++ b/commands/docs/error_make.md @@ -2,7 +2,7 @@ title: error make categories: | core -version: 0.100.0 +version: 0.101.0 core: | Create an error. usage: | diff --git a/commands/docs/every.md b/commands/docs/every.md index c12ffb335b..ad3e5eff42 100644 --- a/commands/docs/every.md +++ b/commands/docs/every.md @@ -2,7 +2,7 @@ title: every categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Show (or skip) every n-th row, starting from the first one. usage: | diff --git a/commands/docs/exec.md b/commands/docs/exec.md index b67c4fbc0c..867e1a5d1a 100644 --- a/commands/docs/exec.md +++ b/commands/docs/exec.md @@ -2,7 +2,7 @@ title: exec categories: | system -version: 0.100.0 +version: 0.101.0 system: | Execute a command, replacing or exiting the current process, depending on platform. usage: | diff --git a/commands/docs/exit.md b/commands/docs/exit.md index 28175f5106..77bd896973 100644 --- a/commands/docs/exit.md +++ b/commands/docs/exit.md @@ -2,7 +2,7 @@ title: exit categories: | shells -version: 0.100.0 +version: 0.101.0 shells: | Exit Nu. usage: | diff --git a/commands/docs/explain.md b/commands/docs/explain.md index 8e44289597..9812367999 100644 --- a/commands/docs/explain.md +++ b/commands/docs/explain.md @@ -2,7 +2,7 @@ title: explain categories: | debug -version: 0.100.0 +version: 0.101.0 debug: | Explain closure contents. usage: | diff --git a/commands/docs/explore.md b/commands/docs/explore.md index 04ae758c73..a30179479a 100644 --- a/commands/docs/explore.md +++ b/commands/docs/explore.md @@ -2,7 +2,7 @@ title: explore categories: | viewers -version: 0.100.0 +version: 0.101.0 viewers: | Explore acts as a table pager, just like `less` does for text. usage: | diff --git a/commands/docs/export-env.md b/commands/docs/export-env.md index 92dc166797..eb0990afbe 100644 --- a/commands/docs/export-env.md +++ b/commands/docs/export-env.md @@ -2,7 +2,7 @@ title: export-env categories: | env -version: 0.100.0 +version: 0.101.0 env: | Run a block and preserve its environment in a current scope. usage: | diff --git a/commands/docs/export.md b/commands/docs/export.md index 339ce917c5..c139e17097 100644 --- a/commands/docs/export.md +++ b/commands/docs/export.md @@ -2,7 +2,7 @@ title: export categories: | core -version: 0.100.0 +version: 0.101.0 core: | Export definitions or environment variables from a module. usage: | diff --git a/commands/docs/export_alias.md b/commands/docs/export_alias.md index 4ca6179352..a69308229f 100644 --- a/commands/docs/export_alias.md +++ b/commands/docs/export_alias.md @@ -2,7 +2,7 @@ title: export alias categories: | core -version: 0.100.0 +version: 0.101.0 core: | Alias a command (with optional flags) to a new name and export it from a module. usage: | diff --git a/commands/docs/export_const.md b/commands/docs/export_const.md index 5709aadc08..427da289ea 100644 --- a/commands/docs/export_const.md +++ b/commands/docs/export_const.md @@ -2,7 +2,7 @@ title: export const categories: | core -version: 0.100.0 +version: 0.101.0 core: | Use parse-time constant from a module and export them from this module. usage: | diff --git a/commands/docs/export_def.md b/commands/docs/export_def.md index f51ecb981e..d049b9631b 100644 --- a/commands/docs/export_def.md +++ b/commands/docs/export_def.md @@ -2,7 +2,7 @@ title: export def categories: | core -version: 0.100.0 +version: 0.101.0 core: | Define a custom command and export it from a module. usage: | diff --git a/commands/docs/export_extern.md b/commands/docs/export_extern.md index 6a2bb3bc60..34e641b6e4 100644 --- a/commands/docs/export_extern.md +++ b/commands/docs/export_extern.md @@ -2,7 +2,7 @@ title: export extern categories: | core -version: 0.100.0 +version: 0.101.0 core: | Define an extern and export it from a module. usage: | diff --git a/commands/docs/export_module.md b/commands/docs/export_module.md index d05274e680..8e0c6e29c2 100644 --- a/commands/docs/export_module.md +++ b/commands/docs/export_module.md @@ -2,7 +2,7 @@ title: export module categories: | core -version: 0.100.0 +version: 0.101.0 core: | Export a custom module from a module. usage: | diff --git a/commands/docs/export_use.md b/commands/docs/export_use.md index b96a62eb80..fce5a1fa52 100644 --- a/commands/docs/export_use.md +++ b/commands/docs/export_use.md @@ -2,7 +2,7 @@ title: export use categories: | core -version: 0.100.0 +version: 0.101.0 core: | Use definitions from a module and export them from this module. usage: | diff --git a/commands/docs/extern.md b/commands/docs/extern.md index 8b811253dd..7662d01f41 100644 --- a/commands/docs/extern.md +++ b/commands/docs/extern.md @@ -2,7 +2,7 @@ title: extern categories: | core -version: 0.100.0 +version: 0.101.0 core: | Define a signature for an external command. usage: | diff --git a/commands/docs/fill.md b/commands/docs/fill.md index 2c2205a69e..9cfae81268 100644 --- a/commands/docs/fill.md +++ b/commands/docs/fill.md @@ -2,7 +2,7 @@ title: fill categories: | conversions -version: 0.100.0 +version: 0.101.0 conversions: | Fill and Align. usage: | diff --git a/commands/docs/filter.md b/commands/docs/filter.md index 3863600828..ae036c29e1 100644 --- a/commands/docs/filter.md +++ b/commands/docs/filter.md @@ -2,7 +2,7 @@ title: filter categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Filter values based on a predicate closure. usage: | diff --git a/commands/docs/find.md b/commands/docs/find.md index 56ab27dae3..0ad57f710b 100644 --- a/commands/docs/find.md +++ b/commands/docs/find.md @@ -2,7 +2,7 @@ title: find categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Searches terms in the input. usage: | diff --git a/commands/docs/first.md b/commands/docs/first.md index 1642f3081e..d0473284b2 100644 --- a/commands/docs/first.md +++ b/commands/docs/first.md @@ -2,7 +2,7 @@ title: first categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Return only the first several rows of the input. Counterpart of `last`. Opposite of `skip`. usage: | diff --git a/commands/docs/flatten.md b/commands/docs/flatten.md index 14d6f99806..a6667bb323 100644 --- a/commands/docs/flatten.md +++ b/commands/docs/flatten.md @@ -2,7 +2,7 @@ title: flatten categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Flatten the table. usage: | diff --git a/commands/docs/fmt.md b/commands/docs/fmt.md index 089270075b..9329b9bf61 100644 --- a/commands/docs/fmt.md +++ b/commands/docs/fmt.md @@ -2,7 +2,7 @@ title: fmt categories: | conversions -version: 0.100.0 +version: 0.101.0 conversions: | Format a number. usage: | diff --git a/commands/docs/for.md b/commands/docs/for.md index db3e9bbcb8..f33121ab49 100644 --- a/commands/docs/for.md +++ b/commands/docs/for.md @@ -2,7 +2,7 @@ title: for categories: | core -version: 0.100.0 +version: 0.101.0 core: | Loop over a range. usage: | diff --git a/commands/docs/format.md b/commands/docs/format.md index 478173d1cc..fd1244627c 100644 --- a/commands/docs/format.md +++ b/commands/docs/format.md @@ -2,7 +2,7 @@ title: format categories: | strings -version: 0.100.0 +version: 0.101.0 strings: | Various commands for formatting data. usage: | diff --git a/commands/docs/format_date.md b/commands/docs/format_date.md index 2d91a457cb..5ca26eeec0 100644 --- a/commands/docs/format_date.md +++ b/commands/docs/format_date.md @@ -2,7 +2,7 @@ title: format date categories: | strings -version: 0.100.0 +version: 0.101.0 strings: | Format a given date using a format string. usage: | diff --git a/commands/docs/format_duration.md b/commands/docs/format_duration.md index 5d812fad93..192b7821c2 100644 --- a/commands/docs/format_duration.md +++ b/commands/docs/format_duration.md @@ -2,7 +2,7 @@ title: format duration categories: | strings -version: 0.100.0 +version: 0.101.0 strings: | Outputs duration with a specified unit of time. usage: | diff --git a/commands/docs/format_filesize.md b/commands/docs/format_filesize.md index 333495e753..02579dbb3d 100644 --- a/commands/docs/format_filesize.md +++ b/commands/docs/format_filesize.md @@ -2,7 +2,7 @@ title: format filesize categories: | strings -version: 0.100.0 +version: 0.101.0 strings: | Converts a column of filesizes to some specified format. usage: | diff --git a/commands/docs/format_pattern.md b/commands/docs/format_pattern.md index 144cacd360..1a653e349f 100644 --- a/commands/docs/format_pattern.md +++ b/commands/docs/format_pattern.md @@ -2,7 +2,7 @@ title: format pattern categories: | strings -version: 0.100.0 +version: 0.101.0 strings: | Format columns into a string using a simple pattern. usage: | diff --git a/commands/docs/from.md b/commands/docs/from.md index 060341caac..e34cabab79 100644 --- a/commands/docs/from.md +++ b/commands/docs/from.md @@ -2,7 +2,7 @@ title: from categories: | formats -version: 0.100.0 +version: 0.101.0 formats: | Parse a string or binary data into structured data. usage: | diff --git a/commands/docs/from_csv.md b/commands/docs/from_csv.md index 2581535eb3..892e585bd7 100644 --- a/commands/docs/from_csv.md +++ b/commands/docs/from_csv.md @@ -2,7 +2,7 @@ title: from csv categories: | formats -version: 0.100.0 +version: 0.101.0 formats: | Parse text as .csv and create table. usage: | @@ -50,6 +50,22 @@ Convert comma-separated data to a table ``` +Convert comma-separated data to a table, allowing variable number of columns per row +```nu +> "ColA,ColB +1,2 +3,4,5 +6" | from csv --flexible +╭───┬──────┬──────┬─────────╮ +│ # │ ColA │ ColB │ column2 │ +├───┼──────┼──────┼─────────┤ +│ 0 │ 1 │ 2 │ ❎ │ +│ 1 │ 3 │ 4 │ 5 │ +│ 2 │ 6 │ ❎ │ ❎ │ +╰───┴──────┴──────┴─────────╯ + +``` + Convert comma-separated data to a table, ignoring headers ```nu > open data.txt | from csv --noheaders diff --git a/commands/docs/from_eml.md b/commands/docs/from_eml.md index 86fd5ffca3..a8555aee9a 100644 --- a/commands/docs/from_eml.md +++ b/commands/docs/from_eml.md @@ -2,7 +2,7 @@ title: from eml categories: | formats -version: 0.100.0 +version: 0.101.0 formats: | Parse text as .eml and create record. usage: | diff --git a/commands/docs/from_ics.md b/commands/docs/from_ics.md index 579ae12564..6736c3480e 100644 --- a/commands/docs/from_ics.md +++ b/commands/docs/from_ics.md @@ -2,7 +2,7 @@ title: from ics categories: | formats -version: 0.100.0 +version: 0.101.0 formats: | Parse text as .ics and create table. usage: | @@ -38,10 +38,11 @@ Converts ics formatted string to table ```nu > 'BEGIN:VCALENDAR END:VCALENDAR' | from ics -╭───┬────────────────┬────────────────┬────────────────┬────────────────┬────────────────┬────────────────┬────────────────╮ -│ # │ properties │ events │ alarms │ to-Dos │ journals │ free-busys │ timezones │ -├───┼────────────────┼────────────────┼────────────────┼────────────────┼────────────────┼────────────────┼────────────────┤ -│ 0 │ [list 0 items] │ [list 0 items] │ [list 0 items] │ [list 0 items] │ [list 0 items] │ [list 0 items] │ [list 0 items] │ -╰───┴────────────────┴────────────────┴────────────────┴────────────────┴────────────────┴────────────────┴────────────────╯ +╭───┬────────────────┬────────────────┬────────────────┬────────────────┬────────────────┬────────────────┬───────────╮ +│ # │ properties │ events │ alarms │ to-Dos │ journals │ free-busys │ timezones │ +├───┼────────────────┼────────────────┼────────────────┼────────────────┼────────────────┼────────────────┼───────────┤ +│ 0 │ [list 0 items] │ [list 0 items] │ [list 0 items] │ [list 0 items] │ [list 0 items] │ [list 0 items] │ [list 0 │ +│ │ │ │ │ │ │ │ items] │ +╰───┴────────────────┴────────────────┴────────────────┴────────────────┴────────────────┴────────────────┴───────────╯ ``` diff --git a/commands/docs/from_ini.md b/commands/docs/from_ini.md index e601c85dc5..f862e6d791 100644 --- a/commands/docs/from_ini.md +++ b/commands/docs/from_ini.md @@ -2,7 +2,7 @@ title: from ini categories: | formats -version: 0.100.0 +version: 0.101.0 formats: | Parse text as .ini and create table. usage: | diff --git a/commands/docs/from_json.md b/commands/docs/from_json.md index ca4bc24591..76771e178c 100644 --- a/commands/docs/from_json.md +++ b/commands/docs/from_json.md @@ -2,7 +2,7 @@ title: from json categories: | formats -version: 0.100.0 +version: 0.101.0 formats: | Convert from json to structured data. usage: | diff --git a/commands/docs/from_msgpack.md b/commands/docs/from_msgpack.md index 5f58a5a0c0..33122c59cf 100644 --- a/commands/docs/from_msgpack.md +++ b/commands/docs/from_msgpack.md @@ -2,7 +2,7 @@ title: from msgpack categories: | formats -version: 0.100.0 +version: 0.101.0 formats: | Convert MessagePack data into Nu values. usage: | diff --git a/commands/docs/from_msgpackz.md b/commands/docs/from_msgpackz.md index 43a53a476d..000070bee9 100644 --- a/commands/docs/from_msgpackz.md +++ b/commands/docs/from_msgpackz.md @@ -2,7 +2,7 @@ title: from msgpackz categories: | formats -version: 0.100.0 +version: 0.101.0 formats: | Convert brotli-compressed MessagePack data into Nu values. usage: | diff --git a/commands/docs/from_nuon.md b/commands/docs/from_nuon.md index 9fbfd98a9f..ffa7d5d1ae 100644 --- a/commands/docs/from_nuon.md +++ b/commands/docs/from_nuon.md @@ -2,7 +2,7 @@ title: from nuon categories: | formats -version: 0.100.0 +version: 0.101.0 formats: | Convert from nuon to structured data. usage: | diff --git a/commands/docs/from_ods.md b/commands/docs/from_ods.md index 8f890ad773..624e11cacd 100644 --- a/commands/docs/from_ods.md +++ b/commands/docs/from_ods.md @@ -2,7 +2,7 @@ title: from ods categories: | formats -version: 0.100.0 +version: 0.101.0 formats: | Parse OpenDocument Spreadsheet(.ods) data and create table. usage: | diff --git a/commands/docs/from_plist.md b/commands/docs/from_plist.md index 5d68671780..252cf9713c 100644 --- a/commands/docs/from_plist.md +++ b/commands/docs/from_plist.md @@ -2,7 +2,7 @@ title: from plist categories: | formats -version: 0.100.0 +version: 0.101.0 formats: | Convert plist to Nushell values usage: | diff --git a/commands/docs/from_ssv.md b/commands/docs/from_ssv.md index 0551715962..66106c5893 100644 --- a/commands/docs/from_ssv.md +++ b/commands/docs/from_ssv.md @@ -2,7 +2,7 @@ title: from ssv categories: | formats -version: 0.100.0 +version: 0.101.0 formats: | Parse text as space-separated values and create a table. The default minimum number of spaces counted as a separator is 2. usage: | diff --git a/commands/docs/from_toml.md b/commands/docs/from_toml.md index 141dc9ade1..5cf95a4368 100644 --- a/commands/docs/from_toml.md +++ b/commands/docs/from_toml.md @@ -2,7 +2,7 @@ title: from toml categories: | formats -version: 0.100.0 +version: 0.101.0 formats: | Parse text as .toml and create record. usage: | diff --git a/commands/docs/from_tsv.md b/commands/docs/from_tsv.md index 67e4cd5fa0..54ca102e91 100644 --- a/commands/docs/from_tsv.md +++ b/commands/docs/from_tsv.md @@ -2,7 +2,7 @@ title: from tsv categories: | formats -version: 0.100.0 +version: 0.101.0 formats: | Parse text as .tsv and create table. usage: | @@ -49,6 +49,19 @@ Convert tab-separated data to a table ``` +Convert comma-separated data to a table, allowing variable number of columns per row and ignoring headers +```nu +> "value 1 +value 2 description 2" | from tsv --flexible --noheaders +╭───┬─────────┬───────────────╮ +│ # │ column0 │ column1 │ +├───┼─────────┼───────────────┤ +│ 0 │ value 1 │ ❎ │ +│ 1 │ value 2 │ description 2 │ +╰───┴─────────┴───────────────╯ + +``` + Create a tsv file with header columns and open it ```nu > $'c1(char tab)c2(char tab)c3(char nl)1(char tab)2(char tab)3' | save tsv-data | open tsv-data | from tsv diff --git a/commands/docs/from_url.md b/commands/docs/from_url.md index 4e6c19e972..65daad1d6e 100644 --- a/commands/docs/from_url.md +++ b/commands/docs/from_url.md @@ -2,7 +2,7 @@ title: from url categories: | formats -version: 0.100.0 +version: 0.101.0 formats: | Parse url-encoded string as a record. usage: | diff --git a/commands/docs/from_vcf.md b/commands/docs/from_vcf.md index a9ca8377f5..8036363b45 100644 --- a/commands/docs/from_vcf.md +++ b/commands/docs/from_vcf.md @@ -2,7 +2,7 @@ title: from vcf categories: | formats -version: 0.100.0 +version: 0.101.0 formats: | Parse text as .vcf and create table. usage: | diff --git a/commands/docs/from_xlsx.md b/commands/docs/from_xlsx.md index 24247f4965..2bf8b2f0cd 100644 --- a/commands/docs/from_xlsx.md +++ b/commands/docs/from_xlsx.md @@ -2,7 +2,7 @@ title: from xlsx categories: | formats -version: 0.100.0 +version: 0.101.0 formats: | Parse binary Excel(.xlsx) data and create table. usage: | diff --git a/commands/docs/from_xml.md b/commands/docs/from_xml.md index 971cdfca8d..615e5b1b89 100644 --- a/commands/docs/from_xml.md +++ b/commands/docs/from_xml.md @@ -2,7 +2,7 @@ title: from xml categories: | formats -version: 0.100.0 +version: 0.101.0 formats: | Parse text as .xml and create record. usage: | diff --git a/commands/docs/from_yaml.md b/commands/docs/from_yaml.md index cf985c2a10..0d9553736d 100644 --- a/commands/docs/from_yaml.md +++ b/commands/docs/from_yaml.md @@ -2,7 +2,7 @@ title: from yaml categories: | formats -version: 0.100.0 +version: 0.101.0 formats: | Parse text as .yaml/.yml and create table. usage: | diff --git a/commands/docs/from_yml.md b/commands/docs/from_yml.md index 2545d95c03..ddabb80c6d 100644 --- a/commands/docs/from_yml.md +++ b/commands/docs/from_yml.md @@ -2,7 +2,7 @@ title: from yml categories: | formats -version: 0.100.0 +version: 0.101.0 formats: | Parse text as .yaml/.yml and create table. usage: | diff --git a/commands/docs/generate.md b/commands/docs/generate.md index 84bdef8fb7..80f8a02fa7 100644 --- a/commands/docs/generate.md +++ b/commands/docs/generate.md @@ -2,7 +2,7 @@ title: generate categories: | generators -version: 0.100.0 +version: 0.101.0 generators: | Generate a list of values by successively invoking a closure. usage: | diff --git a/commands/docs/get.md b/commands/docs/get.md index b86a38afbc..bec6b2eb94 100644 --- a/commands/docs/get.md +++ b/commands/docs/get.md @@ -2,7 +2,7 @@ title: get categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Extract data using a cell path. usage: | diff --git a/commands/docs/glob.md b/commands/docs/glob.md index 7c1f6686ec..4640d8ad17 100644 --- a/commands/docs/glob.md +++ b/commands/docs/glob.md @@ -2,7 +2,7 @@ title: glob categories: | filesystem -version: 0.100.0 +version: 0.101.0 filesystem: | Creates a list of files and/or folders based on the glob pattern provided. usage: | diff --git a/commands/docs/grid.md b/commands/docs/grid.md index 2ddb16cd23..be41a20670 100644 --- a/commands/docs/grid.md +++ b/commands/docs/grid.md @@ -2,7 +2,7 @@ title: grid categories: | viewers -version: 0.100.0 +version: 0.101.0 viewers: | Renders the output to a textual terminal grid. usage: | diff --git a/commands/docs/group-by.md b/commands/docs/group-by.md index bf8892fa10..aef6ee9fe3 100644 --- a/commands/docs/group-by.md +++ b/commands/docs/group-by.md @@ -2,7 +2,7 @@ title: group-by categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Splits a list or table into groups, and returns a record containing those groups. usage: | @@ -16,7 +16,7 @@ usage: | ## Signature -```> group-by {flags} (grouper)``` +```> group-by {flags} ...rest``` ## Flags @@ -24,7 +24,7 @@ usage: | ## Parameters - - `grouper`: The path to the column to group on. + - `...rest`: The path to the column to group on. ## Input/output types: @@ -119,6 +119,69 @@ Group bools, whether they are strings or actual bools ╰───────┴───────────────╯ ``` +Group items by multiple columns' values +```nu +> [ + [name, lang, year]; + [andres, rb, "2019"], + [jt, rs, "2019"], + [storm, rs, "2021"] + ] + | group-by lang year +╭────┬─────────────────────────────────────────╮ +│ │ ╭──────┬──────────────────────────────╮ │ +│ rb │ │ │ ╭───┬────────┬──────┬──────╮ │ │ +│ │ │ 2019 │ │ # │ name │ lang │ year │ │ │ +│ │ │ │ ├───┼────────┼──────┼──────┤ │ │ +│ │ │ │ │ 0 │ andres │ rb │ 2019 │ │ │ +│ │ │ │ ╰───┴────────┴──────┴──────╯ │ │ +│ │ ╰──────┴──────────────────────────────╯ │ +│ │ ╭──────┬─────────────────────────────╮ │ +│ rs │ │ │ ╭───┬──────┬──────┬──────╮ │ │ +│ │ │ 2019 │ │ # │ name │ lang │ year │ │ │ +│ │ │ │ ├───┼──────┼──────┼──────┤ │ │ +│ │ │ │ │ 0 │ jt │ rs │ 2019 │ │ │ +│ │ │ │ ╰───┴──────┴──────┴──────╯ │ │ +│ │ │ │ ╭───┬───────┬──────┬──────╮ │ │ +│ │ │ 2021 │ │ # │ name │ lang │ year │ │ │ +│ │ │ │ ├───┼───────┼──────┼──────┤ │ │ +│ │ │ │ │ 0 │ storm │ rs │ 2021 │ │ │ +│ │ │ │ ╰───┴───────┴──────┴──────╯ │ │ +│ │ ╰──────┴─────────────────────────────╯ │ +╰────┴─────────────────────────────────────────╯ +``` + +Group items by multiple columns' values +```nu +> [ + [name, lang, year]; + [andres, rb, "2019"], + [jt, rs, "2019"], + [storm, rs, "2021"] + ] + | group-by lang year --to-table +╭───┬──────┬──────┬──────────────────────────────╮ +│ # │ lang │ year │ items │ +├───┼──────┼──────┼──────────────────────────────┤ +│ 0 │ rb │ 2019 │ ╭───┬────────┬──────┬──────╮ │ +│ │ │ │ │ # │ name │ lang │ year │ │ +│ │ │ │ ├───┼────────┼──────┼──────┤ │ +│ │ │ │ │ 0 │ andres │ rb │ 2019 │ │ +│ │ │ │ ╰───┴────────┴──────┴──────╯ │ +│ 1 │ rs │ 2019 │ ╭───┬──────┬──────┬──────╮ │ +│ │ │ │ │ # │ name │ lang │ year │ │ +│ │ │ │ ├───┼──────┼──────┼──────┤ │ +│ │ │ │ │ 0 │ jt │ rs │ 2019 │ │ +│ │ │ │ ╰───┴──────┴──────┴──────╯ │ +│ 2 │ rs │ 2021 │ ╭───┬───────┬──────┬──────╮ │ +│ │ │ │ │ # │ name │ lang │ year │ │ +│ │ │ │ ├───┼───────┼──────┼──────┤ │ +│ │ │ │ │ 0 │ storm │ rs │ 2021 │ │ +│ │ │ │ ╰───┴───────┴──────┴──────╯ │ +╰───┴──────┴──────┴──────────────────────────────╯ + +``` + ## Notes the group-by command makes some assumptions: - if the input data is not a string, the grouper will convert the key to string but the values will remain in their original format. e.g. with bools, "true" and true would be in the same group (see example). diff --git a/commands/docs/gstat.md b/commands/docs/gstat.md index ac1a47ea74..6d24c9c301 100644 --- a/commands/docs/gstat.md +++ b/commands/docs/gstat.md @@ -2,7 +2,7 @@ title: gstat categories: | prompt -version: 0.100.0 +version: 0.101.0 prompt: | Get the git status of a repo usage: | diff --git a/commands/docs/hash.md b/commands/docs/hash.md index 5f77dd5581..c8d26f8488 100644 --- a/commands/docs/hash.md +++ b/commands/docs/hash.md @@ -2,7 +2,7 @@ title: hash categories: | hash -version: 0.100.0 +version: 0.101.0 hash: | Apply hash function. usage: | diff --git a/commands/docs/hash_md5.md b/commands/docs/hash_md5.md index 4165a47d79..06705ab72a 100644 --- a/commands/docs/hash_md5.md +++ b/commands/docs/hash_md5.md @@ -2,7 +2,7 @@ title: hash md5 categories: | hash -version: 0.100.0 +version: 0.101.0 hash: | Hash a value using the md5 hash algorithm. usage: | diff --git a/commands/docs/hash_sha256.md b/commands/docs/hash_sha256.md index a59d8bc276..5c9dadec38 100644 --- a/commands/docs/hash_sha256.md +++ b/commands/docs/hash_sha256.md @@ -2,7 +2,7 @@ title: hash sha256 categories: | hash -version: 0.100.0 +version: 0.101.0 hash: | Hash a value using the sha256 hash algorithm. usage: | diff --git a/commands/docs/headers.md b/commands/docs/headers.md index c8fc61fdb0..21214f9f1f 100644 --- a/commands/docs/headers.md +++ b/commands/docs/headers.md @@ -2,7 +2,7 @@ title: headers categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Use the first row of the table as column names. usage: | diff --git a/commands/docs/help.md b/commands/docs/help.md index 0d394cd6c1..632fb33e27 100644 --- a/commands/docs/help.md +++ b/commands/docs/help.md @@ -2,7 +2,7 @@ title: help categories: | core -version: 0.100.0 +version: 0.101.0 core: | Display help information about different parts of Nushell. usage: | diff --git a/commands/docs/help_aliases.md b/commands/docs/help_aliases.md index 3930f1fc97..39d2d0ffb2 100644 --- a/commands/docs/help_aliases.md +++ b/commands/docs/help_aliases.md @@ -2,7 +2,7 @@ title: help aliases categories: | core -version: 0.100.0 +version: 0.101.0 core: | Show help on nushell aliases. usage: | diff --git a/commands/docs/help_commands.md b/commands/docs/help_commands.md index 8f2711cf7c..4a43b109ac 100644 --- a/commands/docs/help_commands.md +++ b/commands/docs/help_commands.md @@ -2,7 +2,7 @@ title: help commands categories: | core -version: 0.100.0 +version: 0.101.0 core: | Show help on nushell commands. usage: | diff --git a/commands/docs/help_escapes.md b/commands/docs/help_escapes.md index e0c3144098..35384799aa 100644 --- a/commands/docs/help_escapes.md +++ b/commands/docs/help_escapes.md @@ -2,7 +2,7 @@ title: help escapes categories: | core -version: 0.100.0 +version: 0.101.0 core: | Show help on nushell string escapes. usage: | diff --git a/commands/docs/help_externs.md b/commands/docs/help_externs.md index 63b62d999d..796154775d 100644 --- a/commands/docs/help_externs.md +++ b/commands/docs/help_externs.md @@ -2,7 +2,7 @@ title: help externs categories: | core -version: 0.100.0 +version: 0.101.0 core: | Show help on nushell externs. usage: | diff --git a/commands/docs/help_modules.md b/commands/docs/help_modules.md index 4524a7fa4a..64cc1f87e5 100644 --- a/commands/docs/help_modules.md +++ b/commands/docs/help_modules.md @@ -2,7 +2,7 @@ title: help modules categories: | core -version: 0.100.0 +version: 0.101.0 core: | Show help on nushell modules. usage: | diff --git a/commands/docs/help_operators.md b/commands/docs/help_operators.md index fe25ec4b23..065a6b3f91 100644 --- a/commands/docs/help_operators.md +++ b/commands/docs/help_operators.md @@ -2,7 +2,7 @@ title: help operators categories: | core -version: 0.100.0 +version: 0.101.0 core: | Show help on nushell operators. usage: | diff --git a/commands/docs/hide-env.md b/commands/docs/hide-env.md index 206fde8ae6..8a0459b817 100644 --- a/commands/docs/hide-env.md +++ b/commands/docs/hide-env.md @@ -2,7 +2,7 @@ title: hide-env categories: | core -version: 0.100.0 +version: 0.101.0 core: | Hide environment variables in the current scope. usage: | diff --git a/commands/docs/hide.md b/commands/docs/hide.md index 7ed8f5d7fd..a3e5b69f5e 100644 --- a/commands/docs/hide.md +++ b/commands/docs/hide.md @@ -2,7 +2,7 @@ title: hide categories: | core -version: 0.100.0 +version: 0.101.0 core: | Hide definitions in the current scope. usage: | diff --git a/commands/docs/histogram.md b/commands/docs/histogram.md index 933c896f41..79f1fcc7b5 100644 --- a/commands/docs/histogram.md +++ b/commands/docs/histogram.md @@ -2,7 +2,7 @@ title: histogram categories: | chart -version: 0.100.0 +version: 0.101.0 chart: | Creates a new table with a histogram based on the column name passed in. usage: | @@ -51,12 +51,12 @@ Compute a histogram for the types of files, with frequency column named freq Compute a histogram for a list of numbers ```nu > [1 2 1] | histogram -╭───┬───────┬───────┬──────────┬────────────┬────────────────────────────────────────────────────────────────────╮ -│ # │ value │ count │ quantile │ percentage │ frequency │ -├───┼───────┼───────┼──────────┼────────────┼────────────────────────────────────────────────────────────────────┤ -│ 0 │ 1 │ 2 │ 0.67 │ 66.67% │ ****************************************************************** │ -│ 1 │ 2 │ 1 │ 0.33 │ 33.33% │ ********************************* │ -╰───┴───────┴───────┴──────────┴────────────┴────────────────────────────────────────────────────────────────────╯ +╭────┬────────┬────────┬───────────┬─────────────┬────────────────────────────────────────────────────────────────────╮ +│ # │ value │ count │ quantile │ percentage │ frequency │ +├────┼────────┼────────┼───────────┼─────────────┼────────────────────────────────────────────────────────────────────┤ +│ 0 │ 1 │ 2 │ 0.67 │ 66.67% │ ****************************************************************** │ +│ 1 │ 2 │ 1 │ 0.33 │ 33.33% │ ********************************* │ +╰────┴────────┴────────┴───────────┴─────────────┴────────────────────────────────────────────────────────────────────╯ ``` diff --git a/commands/docs/history.md b/commands/docs/history.md index b323645fd5..50eb3c7d82 100644 --- a/commands/docs/history.md +++ b/commands/docs/history.md @@ -2,7 +2,7 @@ title: history categories: | history -version: 0.100.0 +version: 0.101.0 history: | Get the command history. usage: | diff --git a/commands/docs/history_import.md b/commands/docs/history_import.md index 59bb823579..d40ae02e9f 100644 --- a/commands/docs/history_import.md +++ b/commands/docs/history_import.md @@ -2,7 +2,7 @@ title: history import categories: | history -version: 0.100.0 +version: 0.101.0 history: | Import command line history usage: | diff --git a/commands/docs/history_session.md b/commands/docs/history_session.md index 959a0615fd..9ca309b765 100644 --- a/commands/docs/history_session.md +++ b/commands/docs/history_session.md @@ -2,7 +2,7 @@ title: history session categories: | history -version: 0.100.0 +version: 0.101.0 history: | Get the command history session. usage: | diff --git a/commands/docs/http.md b/commands/docs/http.md index 27ab349c23..1818476824 100644 --- a/commands/docs/http.md +++ b/commands/docs/http.md @@ -2,7 +2,7 @@ title: http categories: | network -version: 0.100.0 +version: 0.101.0 network: | Various commands for working with http methods. usage: | diff --git a/commands/docs/http_delete.md b/commands/docs/http_delete.md index e8b827ee9c..31f5fa3aa1 100644 --- a/commands/docs/http_delete.md +++ b/commands/docs/http_delete.md @@ -2,7 +2,7 @@ title: http delete categories: | network -version: 0.100.0 +version: 0.101.0 network: | Delete the specified resource. usage: | diff --git a/commands/docs/http_get.md b/commands/docs/http_get.md index c5afcbe462..28816ddefe 100644 --- a/commands/docs/http_get.md +++ b/commands/docs/http_get.md @@ -2,7 +2,7 @@ title: http get categories: | network -version: 0.100.0 +version: 0.101.0 network: | Fetch the contents from a URL. usage: | diff --git a/commands/docs/http_head.md b/commands/docs/http_head.md index 222a65ce08..983cd343bb 100644 --- a/commands/docs/http_head.md +++ b/commands/docs/http_head.md @@ -2,7 +2,7 @@ title: http head categories: | network -version: 0.100.0 +version: 0.101.0 network: | Get the headers from a URL. usage: | diff --git a/commands/docs/http_options.md b/commands/docs/http_options.md index 239a373989..8991ae1c19 100644 --- a/commands/docs/http_options.md +++ b/commands/docs/http_options.md @@ -2,7 +2,7 @@ title: http options categories: | network -version: 0.100.0 +version: 0.101.0 network: | Requests permitted communication options for a given URL. usage: | diff --git a/commands/docs/http_patch.md b/commands/docs/http_patch.md index e4b1760a73..3dcacb0571 100644 --- a/commands/docs/http_patch.md +++ b/commands/docs/http_patch.md @@ -2,7 +2,7 @@ title: http patch categories: | network -version: 0.100.0 +version: 0.101.0 network: | Patch a body to a URL. usage: | diff --git a/commands/docs/http_post.md b/commands/docs/http_post.md index 956a00b839..88c011ace8 100644 --- a/commands/docs/http_post.md +++ b/commands/docs/http_post.md @@ -2,7 +2,7 @@ title: http post categories: | network -version: 0.100.0 +version: 0.101.0 network: | Post a body to a URL. usage: | diff --git a/commands/docs/http_put.md b/commands/docs/http_put.md index a21fba7717..cecbd92445 100644 --- a/commands/docs/http_put.md +++ b/commands/docs/http_put.md @@ -2,7 +2,7 @@ title: http put categories: | network -version: 0.100.0 +version: 0.101.0 network: | Put a body to a URL. usage: | diff --git a/commands/docs/if.md b/commands/docs/if.md index fa22e74f75..0c164cc932 100644 --- a/commands/docs/if.md +++ b/commands/docs/if.md @@ -2,7 +2,7 @@ title: if categories: | core -version: 0.100.0 +version: 0.101.0 core: | Conditionally run a block. usage: | diff --git a/commands/docs/ignore.md b/commands/docs/ignore.md index edf574a81e..023a84bc4a 100644 --- a/commands/docs/ignore.md +++ b/commands/docs/ignore.md @@ -2,7 +2,7 @@ title: ignore categories: | core -version: 0.100.0 +version: 0.101.0 core: | Ignore the output of the previous command in the pipeline. usage: | diff --git a/commands/docs/inc.md b/commands/docs/inc.md index 9ef4866f24..1a144fb5ba 100644 --- a/commands/docs/inc.md +++ b/commands/docs/inc.md @@ -2,7 +2,7 @@ title: inc categories: | default -version: 0.100.0 +version: 0.101.0 default: | Increment a value or version. Optionally use the column of a table. usage: | diff --git a/commands/docs/input.md b/commands/docs/input.md index 972f8ec082..e40a16d8b3 100644 --- a/commands/docs/input.md +++ b/commands/docs/input.md @@ -2,7 +2,7 @@ title: input categories: | platform -version: 0.100.0 +version: 0.101.0 platform: | Get input from the user. usage: | @@ -22,6 +22,7 @@ usage: | - `--bytes-until-any, -u {string}`: read bytes (not text) until any of the given stop bytes is seen - `--numchar, -n {int}`: number of characters to read; suppresses output + - `--default, -d {string}`: default value if no input is provided - `--suppress-output, -s`: don't print keystroke values ## Parameters @@ -49,6 +50,12 @@ Get two characters from the user, and assign to a variable ``` +Get input from the user with default value, and assign to a variable +```nu +> let user_input = (input --default 10) + +``` + ## Subcommands: diff --git a/commands/docs/input_list.md b/commands/docs/input_list.md index 5c040345c9..8cc55a5dbe 100644 --- a/commands/docs/input_list.md +++ b/commands/docs/input_list.md @@ -2,7 +2,7 @@ title: input list categories: | platform -version: 0.100.0 +version: 0.101.0 platform: | Interactive list selection. usage: | diff --git a/commands/docs/input_listen.md b/commands/docs/input_listen.md index 64b6552b14..90096561f4 100644 --- a/commands/docs/input_listen.md +++ b/commands/docs/input_listen.md @@ -2,7 +2,7 @@ title: input listen categories: | platform -version: 0.100.0 +version: 0.101.0 platform: | Listen for user interface event. usage: | diff --git a/commands/docs/insert.md b/commands/docs/insert.md index 9bf972661b..e28db6bc54 100644 --- a/commands/docs/insert.md +++ b/commands/docs/insert.md @@ -2,7 +2,7 @@ title: insert categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Insert a new column, using an expression or closure to create each row's values. usage: | diff --git a/commands/docs/inspect.md b/commands/docs/inspect.md index 36fae94688..30a7a23c08 100644 --- a/commands/docs/inspect.md +++ b/commands/docs/inspect.md @@ -2,7 +2,7 @@ title: inspect categories: | debug -version: 0.100.0 +version: 0.101.0 debug: | Inspect pipeline results while running a pipeline. usage: | diff --git a/commands/docs/interleave.md b/commands/docs/interleave.md index c58c391fc5..4c3804acb1 100644 --- a/commands/docs/interleave.md +++ b/commands/docs/interleave.md @@ -2,7 +2,7 @@ title: interleave categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Read multiple streams in parallel and combine them into one stream. usage: | diff --git a/commands/docs/into.md b/commands/docs/into.md index 8a354458a2..2e2359a314 100644 --- a/commands/docs/into.md +++ b/commands/docs/into.md @@ -2,7 +2,7 @@ title: into categories: | conversions -version: 0.100.0 +version: 0.101.0 conversions: | Commands to convert data from one type to another. usage: | diff --git a/commands/docs/into_binary.md b/commands/docs/into_binary.md index fcb0957823..edbbb9137a 100644 --- a/commands/docs/into_binary.md +++ b/commands/docs/into_binary.md @@ -2,7 +2,7 @@ title: into binary categories: | conversions -version: 0.100.0 +version: 0.101.0 conversions: | Convert value to a binary primitive. usage: | diff --git a/commands/docs/into_bits.md b/commands/docs/into_bits.md index a115812ff5..f369af2920 100644 --- a/commands/docs/into_bits.md +++ b/commands/docs/into_bits.md @@ -2,7 +2,7 @@ title: into bits categories: | conversions -version: 0.100.0 +version: 0.101.0 conversions: | Convert value to a binary primitive. usage: | diff --git a/commands/docs/into_bool.md b/commands/docs/into_bool.md index 5a5b84b94e..0e18be908d 100644 --- a/commands/docs/into_bool.md +++ b/commands/docs/into_bool.md @@ -2,7 +2,7 @@ title: into bool categories: | conversions -version: 0.100.0 +version: 0.101.0 conversions: | Convert value to boolean. usage: | diff --git a/commands/docs/into_cell-path.md b/commands/docs/into_cell-path.md index 9a69800694..7006a964d1 100644 --- a/commands/docs/into_cell-path.md +++ b/commands/docs/into_cell-path.md @@ -2,7 +2,7 @@ title: into cell-path categories: | conversions -version: 0.100.0 +version: 0.101.0 conversions: | Convert value to a cell-path. usage: | diff --git a/commands/docs/into_datetime.md b/commands/docs/into_datetime.md index 21191d626b..68d94d877e 100644 --- a/commands/docs/into_datetime.md +++ b/commands/docs/into_datetime.md @@ -2,7 +2,7 @@ title: into datetime categories: | conversions -version: 0.100.0 +version: 0.101.0 conversions: | Convert text or timestamp into a datetime. usage: | @@ -63,7 +63,7 @@ Sat, 27 Feb 2021 13:55:40 +0000 (3 years ago) Convert non-standard timestamp string, without timezone offset, to datetime with custom formatting ```nu > '16.11.1984 8:00 am' | into datetime --format '%d.%m.%Y %H:%M %P' -Fri, 16 Nov 1984 08:00:00 +0000 (40 years ago) +Fri, 16 Nov 1984 08:00:00 +0800 (40 years ago) ``` Convert nanosecond-precision unix timestamp to a datetime with offset from UTC diff --git a/commands/docs/into_duration.md b/commands/docs/into_duration.md index b1311931f1..32e22c9b38 100644 --- a/commands/docs/into_duration.md +++ b/commands/docs/into_duration.md @@ -2,7 +2,7 @@ title: into duration categories: | conversions -version: 0.100.0 +version: 0.101.0 conversions: | Convert value to duration. usage: | diff --git a/commands/docs/into_filesize.md b/commands/docs/into_filesize.md index 5ab10a439f..32d5550b16 100644 --- a/commands/docs/into_filesize.md +++ b/commands/docs/into_filesize.md @@ -2,7 +2,7 @@ title: into filesize categories: | conversions -version: 0.100.0 +version: 0.101.0 conversions: | Convert value to filesize. usage: | diff --git a/commands/docs/into_float.md b/commands/docs/into_float.md index ae28d6cdb3..4bee3b1fee 100644 --- a/commands/docs/into_float.md +++ b/commands/docs/into_float.md @@ -2,7 +2,7 @@ title: into float categories: | conversions -version: 0.100.0 +version: 0.101.0 conversions: | Convert data into floating point number. usage: | diff --git a/commands/docs/into_glob.md b/commands/docs/into_glob.md index db2bd705fc..db0f18c627 100644 --- a/commands/docs/into_glob.md +++ b/commands/docs/into_glob.md @@ -2,7 +2,7 @@ title: into glob categories: | conversions -version: 0.100.0 +version: 0.101.0 conversions: | Convert value to glob. usage: | diff --git a/commands/docs/into_int.md b/commands/docs/into_int.md index 7c7b639143..133ad0ed53 100644 --- a/commands/docs/into_int.md +++ b/commands/docs/into_int.md @@ -2,7 +2,7 @@ title: into int categories: | conversions -version: 0.100.0 +version: 0.101.0 conversions: | Convert value to integer. usage: | diff --git a/commands/docs/into_record.md b/commands/docs/into_record.md index c72fa7127e..0123ad2d30 100644 --- a/commands/docs/into_record.md +++ b/commands/docs/into_record.md @@ -2,7 +2,7 @@ title: into record categories: | conversions -version: 0.100.0 +version: 0.101.0 conversions: | Convert value to record. usage: | @@ -92,3 +92,9 @@ convert date to record │ timezone │ +02:00 │ ╰─────────────┴────────╯ ``` + +convert date components to table columns +```nu +> 2020-04-12T22:10:57+02:00 | into record | transpose | transpose -r + +``` diff --git a/commands/docs/into_sqlite.md b/commands/docs/into_sqlite.md index 25a79705b3..99ce2b3bdd 100644 --- a/commands/docs/into_sqlite.md +++ b/commands/docs/into_sqlite.md @@ -2,7 +2,7 @@ title: into sqlite categories: | conversions -version: 0.100.0 +version: 0.101.0 conversions: | Convert table into a SQLite database. usage: | diff --git a/commands/docs/into_string.md b/commands/docs/into_string.md index f2bac1f4a9..0e744d8460 100644 --- a/commands/docs/into_string.md +++ b/commands/docs/into_string.md @@ -2,7 +2,7 @@ title: into string categories: | conversions -version: 0.100.0 +version: 0.101.0 conversions: | Convert value to string. usage: | diff --git a/commands/docs/into_value.md b/commands/docs/into_value.md index 8061d830fa..824817523b 100644 --- a/commands/docs/into_value.md +++ b/commands/docs/into_value.md @@ -2,7 +2,7 @@ title: into value categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Infer Nushell datatype for each cell. usage: | diff --git a/commands/docs/is-admin.md b/commands/docs/is-admin.md index 3e0f050d24..30a9e825a8 100644 --- a/commands/docs/is-admin.md +++ b/commands/docs/is-admin.md @@ -2,7 +2,7 @@ title: is-admin categories: | core -version: 0.100.0 +version: 0.101.0 core: | Check if nushell is running with administrator or root privileges. usage: | diff --git a/commands/docs/is-empty.md b/commands/docs/is-empty.md index a0df2a6818..d92383b3dc 100644 --- a/commands/docs/is-empty.md +++ b/commands/docs/is-empty.md @@ -2,7 +2,7 @@ title: is-empty categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Check for empty values. usage: | diff --git a/commands/docs/is-not-empty.md b/commands/docs/is-not-empty.md index 980825d732..a6ab6adadb 100644 --- a/commands/docs/is-not-empty.md +++ b/commands/docs/is-not-empty.md @@ -2,7 +2,7 @@ title: is-not-empty categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Check for non-empty values. usage: | diff --git a/commands/docs/is-terminal.md b/commands/docs/is-terminal.md index ed21f91c52..d718f8091a 100644 --- a/commands/docs/is-terminal.md +++ b/commands/docs/is-terminal.md @@ -2,7 +2,7 @@ title: is-terminal categories: | platform -version: 0.100.0 +version: 0.101.0 platform: | Check if stdin, stdout, or stderr is a terminal. usage: | diff --git a/commands/docs/items.md b/commands/docs/items.md index 16c0c07f77..f8cd65c3a7 100644 --- a/commands/docs/items.md +++ b/commands/docs/items.md @@ -2,7 +2,7 @@ title: items categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Given a record, iterate on each pair of column name and associated value. usage: | diff --git a/commands/docs/join.md b/commands/docs/join.md index a95b2aca20..a50242af8f 100644 --- a/commands/docs/join.md +++ b/commands/docs/join.md @@ -2,7 +2,7 @@ title: join categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Join two tables. usage: | diff --git a/commands/docs/keybindings.md b/commands/docs/keybindings.md index ad4000b9ed..d24215817b 100644 --- a/commands/docs/keybindings.md +++ b/commands/docs/keybindings.md @@ -2,7 +2,7 @@ title: keybindings categories: | platform -version: 0.100.0 +version: 0.101.0 platform: | Keybindings related commands. usage: | diff --git a/commands/docs/keybindings_default.md b/commands/docs/keybindings_default.md index d28062eb52..86d8e3a780 100644 --- a/commands/docs/keybindings_default.md +++ b/commands/docs/keybindings_default.md @@ -2,7 +2,7 @@ title: keybindings default categories: | platform -version: 0.100.0 +version: 0.101.0 platform: | List default keybindings. usage: | diff --git a/commands/docs/keybindings_list.md b/commands/docs/keybindings_list.md index 1007213f0f..6df7f13a8b 100644 --- a/commands/docs/keybindings_list.md +++ b/commands/docs/keybindings_list.md @@ -2,7 +2,7 @@ title: keybindings list categories: | platform -version: 0.100.0 +version: 0.101.0 platform: | List available options that can be used to create keybindings. usage: | diff --git a/commands/docs/keybindings_listen.md b/commands/docs/keybindings_listen.md index 0f3c601a57..efdd297d18 100644 --- a/commands/docs/keybindings_listen.md +++ b/commands/docs/keybindings_listen.md @@ -2,7 +2,7 @@ title: keybindings listen categories: | platform -version: 0.100.0 +version: 0.101.0 platform: | Get input from the user. usage: | diff --git a/commands/docs/kill.md b/commands/docs/kill.md index 4267aef717..4639c7d67b 100644 --- a/commands/docs/kill.md +++ b/commands/docs/kill.md @@ -2,7 +2,7 @@ title: kill categories: | platform -version: 0.100.0 +version: 0.101.0 platform: | Kill a process using the process id. usage: | diff --git a/commands/docs/last.md b/commands/docs/last.md index e8ebb93504..211647ee67 100644 --- a/commands/docs/last.md +++ b/commands/docs/last.md @@ -2,7 +2,7 @@ title: last categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Return only the last several rows of the input. Counterpart of `first`. Opposite of `drop`. usage: | diff --git a/commands/docs/length.md b/commands/docs/length.md index 2776c1740a..9f4bd3aacc 100644 --- a/commands/docs/length.md +++ b/commands/docs/length.md @@ -2,7 +2,7 @@ title: length categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Count the number of items in an input list, rows in a table, or bytes in binary data. usage: | @@ -25,6 +25,7 @@ usage: | | --------- | ------ | | binary | int | | list\ | int | +| nothing | int | ## Examples Count the number of items in a list @@ -44,3 +45,9 @@ Count the number of bytes in binary data > 0x[01 02] | length 2 ``` + +Count the length a null value +```nu +> null | length +0 +``` diff --git a/commands/docs/let-env.md b/commands/docs/let-env.md index 2127b1b3d1..e7a3f646f0 100644 --- a/commands/docs/let-env.md +++ b/commands/docs/let-env.md @@ -2,7 +2,7 @@ title: let-env categories: | removed -version: 0.100.0 +version: 0.101.0 removed: | `let-env FOO = ...` has been removed, use `$env.FOO = ...` instead. usage: | diff --git a/commands/docs/let.md b/commands/docs/let.md index 372016ef54..c3496136c0 100644 --- a/commands/docs/let.md +++ b/commands/docs/let.md @@ -2,7 +2,7 @@ title: let categories: | core -version: 0.100.0 +version: 0.101.0 core: | Create a variable and give it a value. usage: | diff --git a/commands/docs/lines.md b/commands/docs/lines.md index bb3e3ff497..866130bc75 100644 --- a/commands/docs/lines.md +++ b/commands/docs/lines.md @@ -2,7 +2,7 @@ title: lines categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Converts input to lines. usage: | diff --git a/commands/docs/load-env.md b/commands/docs/load-env.md index fde2ab55e4..bde70d3a4f 100644 --- a/commands/docs/load-env.md +++ b/commands/docs/load-env.md @@ -2,7 +2,7 @@ title: load-env categories: | filesystem -version: 0.100.0 +version: 0.101.0 filesystem: | Loads an environment update from a record. usage: | diff --git a/commands/docs/loop.md b/commands/docs/loop.md index b86227a394..6ba3b67eaf 100644 --- a/commands/docs/loop.md +++ b/commands/docs/loop.md @@ -2,7 +2,7 @@ title: loop categories: | core -version: 0.100.0 +version: 0.101.0 core: | Run a block in a loop. usage: | diff --git a/commands/docs/ls.md b/commands/docs/ls.md index 0d76cf1fdc..8e0798e997 100644 --- a/commands/docs/ls.md +++ b/commands/docs/ls.md @@ -2,7 +2,7 @@ title: ls categories: | filesystem -version: 0.100.0 +version: 0.101.0 filesystem: | List the filenames, sizes, and modification times of items in a directory. usage: | diff --git a/commands/docs/match.md b/commands/docs/match.md index cbf54d7d42..889666bfa5 100644 --- a/commands/docs/match.md +++ b/commands/docs/match.md @@ -2,7 +2,7 @@ title: match categories: | core -version: 0.100.0 +version: 0.101.0 core: | Conditionally run a block on a matched value. usage: | diff --git a/commands/docs/math.md b/commands/docs/math.md index d4b1f8e202..6bbf5955d3 100644 --- a/commands/docs/math.md +++ b/commands/docs/math.md @@ -2,7 +2,7 @@ title: math categories: | math -version: 0.100.0 +version: 0.101.0 math: | Use mathematical functions as aggregate functions on a list of numbers or tables. usage: | diff --git a/commands/docs/math_abs.md b/commands/docs/math_abs.md index 9817f6c254..8140977bf1 100644 --- a/commands/docs/math_abs.md +++ b/commands/docs/math_abs.md @@ -2,7 +2,7 @@ title: math abs categories: | math -version: 0.100.0 +version: 0.101.0 math: | Returns the absolute value of a number. usage: | diff --git a/commands/docs/math_arccos.md b/commands/docs/math_arccos.md index 900fde5585..bbd1897845 100644 --- a/commands/docs/math_arccos.md +++ b/commands/docs/math_arccos.md @@ -2,7 +2,7 @@ title: math arccos categories: | math -version: 0.100.0 +version: 0.101.0 math: | Returns the arccosine of the number. usage: | diff --git a/commands/docs/math_arccosh.md b/commands/docs/math_arccosh.md index ee48a73fff..ef5b467baf 100644 --- a/commands/docs/math_arccosh.md +++ b/commands/docs/math_arccosh.md @@ -2,7 +2,7 @@ title: math arccosh categories: | math -version: 0.100.0 +version: 0.101.0 math: | Returns the inverse of the hyperbolic cosine function. usage: | diff --git a/commands/docs/math_arcsin.md b/commands/docs/math_arcsin.md index f82a70f27d..5716cfdbef 100644 --- a/commands/docs/math_arcsin.md +++ b/commands/docs/math_arcsin.md @@ -2,7 +2,7 @@ title: math arcsin categories: | math -version: 0.100.0 +version: 0.101.0 math: | Returns the arcsine of the number. usage: | diff --git a/commands/docs/math_arcsinh.md b/commands/docs/math_arcsinh.md index c3ed1ad0a5..ce386c7e58 100644 --- a/commands/docs/math_arcsinh.md +++ b/commands/docs/math_arcsinh.md @@ -2,7 +2,7 @@ title: math arcsinh categories: | math -version: 0.100.0 +version: 0.101.0 math: | Returns the inverse of the hyperbolic sine function. usage: | diff --git a/commands/docs/math_arctan.md b/commands/docs/math_arctan.md index a0b6659ffc..54c7f39ad4 100644 --- a/commands/docs/math_arctan.md +++ b/commands/docs/math_arctan.md @@ -2,7 +2,7 @@ title: math arctan categories: | math -version: 0.100.0 +version: 0.101.0 math: | Returns the arctangent of the number. usage: | diff --git a/commands/docs/math_arctanh.md b/commands/docs/math_arctanh.md index bc344682ac..0564b16f73 100644 --- a/commands/docs/math_arctanh.md +++ b/commands/docs/math_arctanh.md @@ -2,7 +2,7 @@ title: math arctanh categories: | math -version: 0.100.0 +version: 0.101.0 math: | Returns the inverse of the hyperbolic tangent function. usage: | diff --git a/commands/docs/math_avg.md b/commands/docs/math_avg.md index 6ef2f6e20a..5a3a81b271 100644 --- a/commands/docs/math_avg.md +++ b/commands/docs/math_avg.md @@ -2,7 +2,7 @@ title: math avg categories: | math -version: 0.100.0 +version: 0.101.0 math: | Returns the average of a list of numbers. usage: | diff --git a/commands/docs/math_ceil.md b/commands/docs/math_ceil.md index c5357239dc..804be7d5f4 100644 --- a/commands/docs/math_ceil.md +++ b/commands/docs/math_ceil.md @@ -2,7 +2,7 @@ title: math ceil categories: | math -version: 0.100.0 +version: 0.101.0 math: | Returns the ceil of a number (smallest integer greater than or equal to that number). usage: | diff --git a/commands/docs/math_cos.md b/commands/docs/math_cos.md index 5203f78e58..bcba7ba697 100644 --- a/commands/docs/math_cos.md +++ b/commands/docs/math_cos.md @@ -2,7 +2,7 @@ title: math cos categories: | math -version: 0.100.0 +version: 0.101.0 math: | Returns the cosine of the number. usage: | diff --git a/commands/docs/math_cosh.md b/commands/docs/math_cosh.md index be0a5cd508..bf9006174a 100644 --- a/commands/docs/math_cosh.md +++ b/commands/docs/math_cosh.md @@ -2,7 +2,7 @@ title: math cosh categories: | math -version: 0.100.0 +version: 0.101.0 math: | Returns the hyperbolic cosine of the number. usage: | diff --git a/commands/docs/math_exp.md b/commands/docs/math_exp.md index 2f0064a596..3fb426f64e 100644 --- a/commands/docs/math_exp.md +++ b/commands/docs/math_exp.md @@ -2,7 +2,7 @@ title: math exp categories: | math -version: 0.100.0 +version: 0.101.0 math: | Returns e raised to the power of x. usage: | diff --git a/commands/docs/math_floor.md b/commands/docs/math_floor.md index 5655e0182b..d5f7cb30a4 100644 --- a/commands/docs/math_floor.md +++ b/commands/docs/math_floor.md @@ -2,7 +2,7 @@ title: math floor categories: | math -version: 0.100.0 +version: 0.101.0 math: | Returns the floor of a number (largest integer less than or equal to that number). usage: | diff --git a/commands/docs/math_ln.md b/commands/docs/math_ln.md index f1e36bb74a..4f825ed609 100644 --- a/commands/docs/math_ln.md +++ b/commands/docs/math_ln.md @@ -2,7 +2,7 @@ title: math ln categories: | math -version: 0.100.0 +version: 0.101.0 math: | Returns the natural logarithm. Base: (math e). usage: | diff --git a/commands/docs/math_log.md b/commands/docs/math_log.md index 719e4d88c7..6b3b0a4af7 100644 --- a/commands/docs/math_log.md +++ b/commands/docs/math_log.md @@ -2,7 +2,7 @@ title: math log categories: | math -version: 0.100.0 +version: 0.101.0 math: | Returns the logarithm for an arbitrary base. usage: | diff --git a/commands/docs/math_max.md b/commands/docs/math_max.md index 73b2ac00e1..635bc6db3d 100644 --- a/commands/docs/math_max.md +++ b/commands/docs/math_max.md @@ -2,7 +2,7 @@ title: math max categories: | math -version: 0.100.0 +version: 0.101.0 math: | Returns the maximum of a list of values, or of columns in a table. usage: | diff --git a/commands/docs/math_median.md b/commands/docs/math_median.md index a38bed5079..4883728aae 100644 --- a/commands/docs/math_median.md +++ b/commands/docs/math_median.md @@ -2,7 +2,7 @@ title: math median categories: | math -version: 0.100.0 +version: 0.101.0 math: | Computes the median of a list of numbers. usage: | diff --git a/commands/docs/math_min.md b/commands/docs/math_min.md index 8980693a54..95fe633fd3 100644 --- a/commands/docs/math_min.md +++ b/commands/docs/math_min.md @@ -2,7 +2,7 @@ title: math min categories: | math -version: 0.100.0 +version: 0.101.0 math: | Finds the minimum within a list of values or tables. usage: | diff --git a/commands/docs/math_mode.md b/commands/docs/math_mode.md index 5d8d61bd0e..1ae7c55d6f 100644 --- a/commands/docs/math_mode.md +++ b/commands/docs/math_mode.md @@ -2,7 +2,7 @@ title: math mode categories: | math -version: 0.100.0 +version: 0.101.0 math: | Returns the most frequent element(s) from a list of numbers or tables. usage: | diff --git a/commands/docs/math_product.md b/commands/docs/math_product.md index da1fb43a02..b8851e5f76 100644 --- a/commands/docs/math_product.md +++ b/commands/docs/math_product.md @@ -2,7 +2,7 @@ title: math product categories: | math -version: 0.100.0 +version: 0.101.0 math: | Returns the product of a list of numbers or the products of each column of a table. usage: | diff --git a/commands/docs/math_round.md b/commands/docs/math_round.md index c7bfcdeb01..17f1677a2d 100644 --- a/commands/docs/math_round.md +++ b/commands/docs/math_round.md @@ -2,7 +2,7 @@ title: math round categories: | math -version: 0.100.0 +version: 0.101.0 math: | Returns the input number rounded to the specified precision. usage: | diff --git a/commands/docs/math_sin.md b/commands/docs/math_sin.md index 9358683285..65cdd67567 100644 --- a/commands/docs/math_sin.md +++ b/commands/docs/math_sin.md @@ -2,7 +2,7 @@ title: math sin categories: | math -version: 0.100.0 +version: 0.101.0 math: | Returns the sine of the number. usage: | diff --git a/commands/docs/math_sinh.md b/commands/docs/math_sinh.md index cc855e7316..a0b676ee10 100644 --- a/commands/docs/math_sinh.md +++ b/commands/docs/math_sinh.md @@ -2,7 +2,7 @@ title: math sinh categories: | math -version: 0.100.0 +version: 0.101.0 math: | Returns the hyperbolic sine of the number. usage: | diff --git a/commands/docs/math_sqrt.md b/commands/docs/math_sqrt.md index 1eda85fcfa..112e01c4cf 100644 --- a/commands/docs/math_sqrt.md +++ b/commands/docs/math_sqrt.md @@ -2,7 +2,7 @@ title: math sqrt categories: | math -version: 0.100.0 +version: 0.101.0 math: | Returns the square root of the input number. usage: | diff --git a/commands/docs/math_stddev.md b/commands/docs/math_stddev.md index f069744fdc..b689c5d232 100644 --- a/commands/docs/math_stddev.md +++ b/commands/docs/math_stddev.md @@ -2,7 +2,7 @@ title: math stddev categories: | math -version: 0.100.0 +version: 0.101.0 math: | Returns the standard deviation of a list of numbers, or of each column in a table. usage: | diff --git a/commands/docs/math_sum.md b/commands/docs/math_sum.md index 14391e1591..d58a2e45f2 100644 --- a/commands/docs/math_sum.md +++ b/commands/docs/math_sum.md @@ -2,7 +2,7 @@ title: math sum categories: | math -version: 0.100.0 +version: 0.101.0 math: | Returns the sum of a list of numbers or of each column in a table. usage: | diff --git a/commands/docs/math_tan.md b/commands/docs/math_tan.md index a58f92048d..6cac18fbea 100644 --- a/commands/docs/math_tan.md +++ b/commands/docs/math_tan.md @@ -2,7 +2,7 @@ title: math tan categories: | math -version: 0.100.0 +version: 0.101.0 math: | Returns the tangent of the number. usage: | diff --git a/commands/docs/math_tanh.md b/commands/docs/math_tanh.md index 93019fc14d..e7de855062 100644 --- a/commands/docs/math_tanh.md +++ b/commands/docs/math_tanh.md @@ -2,7 +2,7 @@ title: math tanh categories: | math -version: 0.100.0 +version: 0.101.0 math: | Returns the hyperbolic tangent of the number. usage: | diff --git a/commands/docs/math_variance.md b/commands/docs/math_variance.md index fad23a3526..adc8de7e0b 100644 --- a/commands/docs/math_variance.md +++ b/commands/docs/math_variance.md @@ -2,7 +2,7 @@ title: math variance categories: | math -version: 0.100.0 +version: 0.101.0 math: | Returns the variance of a list of numbers or of each column in a table. usage: | diff --git a/commands/docs/merge.md b/commands/docs/merge.md index 105dccdc1c..ea0fb044fe 100644 --- a/commands/docs/merge.md +++ b/commands/docs/merge.md @@ -2,7 +2,7 @@ title: merge categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Merge the input with a record or table, overwriting values in matching columns. usage: | @@ -70,4 +70,10 @@ You may provide a column structure to merge When merging tables, row 0 of the input table is overwritten with values from row 0 of the provided table, then -repeating this process with row 1, and so on. \ No newline at end of file +repeating this process with row 1, and so on. + +## Subcommands: + +| name | description | type | +| -------------------------------------------- | --------------------------------------------------------------------------------------- | -------- | +| [`merge deep`](/commands/docs/merge_deep.md) | Merge the input with a record or table, recursively merging values in matching columns. | built-in | diff --git a/commands/docs/merge_deep.md b/commands/docs/merge_deep.md new file mode 100644 index 0000000000..fbba9a7906 --- /dev/null +++ b/commands/docs/merge_deep.md @@ -0,0 +1,103 @@ +--- +title: merge deep +categories: | + filters +version: 0.101.0 +filters: | + Merge the input with a record or table, recursively merging values in matching columns. +usage: | + Merge the input with a record or table, recursively merging values in matching columns. +--- + + +# `merge deep` for [filters](/commands/categories/filters.md) + +
Merge the input with a record or table, recursively merging values in matching columns.
+ +## Signature + +```> merge deep {flags} (value)``` + +## Flags + + - `--strategy, -s {string}`: The list merging strategy to use. One of: table (default), overwrite, append, prepend + +## Parameters + + - `value`: The new value to merge with. + + +## Input/output types: + +| input | output | +| ------ | ------ | +| record | record | +| table | table | +## Examples + +Merge two records recursively +```nu +> {a: 1, b: {c: 2, d: 3}} | merge deep {b: {d: 4, e: 5}} +╭───┬───────────╮ +│ a │ 1 │ +│ │ ╭───┬───╮ │ +│ b │ │ c │ 2 │ │ +│ │ │ d │ 4 │ │ +│ │ │ e │ 5 │ │ +│ │ ╰───┴───╯ │ +╰───┴───────────╯ +``` + +Merge two tables +```nu +> [{columnA: 0, columnB: [{B1: 1}]}] | merge deep [{columnB: [{B2: 2}]}] +╭───┬─────────┬─────────────────╮ +│ # │ columnA │ columnB │ +├───┼─────────┼─────────────────┤ +│ 0 │ 0 │ ╭───┬────┬────╮ │ +│ │ │ │ # │ B1 │ B2 │ │ +│ │ │ ├───┼────┼────┤ │ +│ │ │ │ 0 │ 1 │ 2 │ │ +│ │ │ ╰───┴────┴────╯ │ +╰───┴─────────┴─────────────────╯ + +``` + +Merge two records and their inner tables +```nu +> {inner: [{a: 1}, {b: 2}]} | merge deep {inner: [{c: 3}]} +╭───────┬──────────────────────╮ +│ │ ╭───┬────┬────┬────╮ │ +│ inner │ │ # │ a │ c │ b │ │ +│ │ ├───┼────┼────┼────┤ │ +│ │ │ 0 │ 1 │ 3 │ ❎ │ │ +│ │ │ 1 │ ❎ │ ❎ │ 2 │ │ +│ │ ╰───┴────┴────┴────╯ │ +╰───────┴──────────────────────╯ +``` + +Merge two records, appending their inner tables +```nu +> {inner: [{a: 1}, {b: 2}]} | merge deep {inner: [{c: 3}]} --strategy=append +╭───────┬──────────────────────╮ +│ │ ╭───┬────┬────┬────╮ │ +│ inner │ │ # │ a │ b │ c │ │ +│ │ ├───┼────┼────┼────┤ │ +│ │ │ 0 │ 1 │ ❎ │ ❎ │ │ +│ │ │ 1 │ ❎ │ 2 │ ❎ │ │ +│ │ │ 2 │ ❎ │ ❎ │ 3 │ │ +│ │ ╰───┴────┴────┴────╯ │ +╰───────┴──────────────────────╯ +``` + +## Notes +The way that key-value pairs which exist in both the input and the argument are merged depends on their types. + +Scalar values (like numbers and strings) in the input are overwritten by the corresponding value from the argument. +Records in the input are merged similarly to the merge command, but recursing rather than overwriting inner records. + +The way lists and tables are merged is controlled by the `--strategy` flag: + - table: Merges tables element-wise, similarly to the merge command. Non-table lists are overwritten. + - overwrite: Lists and tables are overwritten with their corresponding value from the argument, similarly to scalars. + - append: Lists and tables in the input are appended with the corresponding list from the argument. + - prepend: Lists and tables in the input are prepended with the corresponding list from the argument. \ No newline at end of file diff --git a/commands/docs/metadata.md b/commands/docs/metadata.md index 06a03f74ee..ac98882913 100644 --- a/commands/docs/metadata.md +++ b/commands/docs/metadata.md @@ -2,7 +2,7 @@ title: metadata categories: | debug -version: 0.100.0 +version: 0.101.0 debug: | Get the metadata for items in the stream. usage: | diff --git a/commands/docs/metadata_access.md b/commands/docs/metadata_access.md index eab15c9b53..7d5e52378a 100644 --- a/commands/docs/metadata_access.md +++ b/commands/docs/metadata_access.md @@ -2,7 +2,7 @@ title: metadata access categories: | debug -version: 0.100.0 +version: 0.101.0 debug: | Access the metadata for the input stream within a closure. usage: | diff --git a/commands/docs/metadata_set.md b/commands/docs/metadata_set.md index 0e7d614b2b..0762e9aef2 100644 --- a/commands/docs/metadata_set.md +++ b/commands/docs/metadata_set.md @@ -2,7 +2,7 @@ title: metadata set categories: | debug -version: 0.100.0 +version: 0.101.0 debug: | Set the metadata for items in the stream. usage: | diff --git a/commands/docs/mkdir.md b/commands/docs/mkdir.md index 18e09bb9d7..c12398c822 100644 --- a/commands/docs/mkdir.md +++ b/commands/docs/mkdir.md @@ -2,7 +2,7 @@ title: mkdir categories: | filesystem -version: 0.100.0 +version: 0.101.0 filesystem: | Create directories, with intermediary directories if required using uutils/coreutils mkdir. usage: | diff --git a/commands/docs/mktemp.md b/commands/docs/mktemp.md index 867ea2857b..030b2d5fc8 100644 --- a/commands/docs/mktemp.md +++ b/commands/docs/mktemp.md @@ -2,7 +2,7 @@ title: mktemp categories: | filesystem -version: 0.100.0 +version: 0.101.0 filesystem: | Create temporary files or directories using uutils/coreutils mktemp. usage: | diff --git a/commands/docs/module.md b/commands/docs/module.md index b89b9cde09..0b10a05408 100644 --- a/commands/docs/module.md +++ b/commands/docs/module.md @@ -2,7 +2,7 @@ title: module categories: | core -version: 0.100.0 +version: 0.101.0 core: | Define a custom module. usage: | diff --git a/commands/docs/move.md b/commands/docs/move.md index 849449c703..82d3c956d5 100644 --- a/commands/docs/move.md +++ b/commands/docs/move.md @@ -2,7 +2,7 @@ title: move categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Move columns before or after other columns. usage: | diff --git a/commands/docs/mut.md b/commands/docs/mut.md index 401a5c1585..a587f71e6d 100644 --- a/commands/docs/mut.md +++ b/commands/docs/mut.md @@ -2,7 +2,7 @@ title: mut categories: | core -version: 0.100.0 +version: 0.101.0 core: | Create a mutable variable and give it a value. usage: | diff --git a/commands/docs/mv.md b/commands/docs/mv.md index 653c0370fe..f4680276e2 100644 --- a/commands/docs/mv.md +++ b/commands/docs/mv.md @@ -2,7 +2,7 @@ title: mv categories: | filesystem -version: 0.100.0 +version: 0.101.0 filesystem: | Move files or directories using uutils/coreutils mv. usage: | diff --git a/commands/docs/nu-check.md b/commands/docs/nu-check.md index 82e866fead..fda1d13e0a 100644 --- a/commands/docs/nu-check.md +++ b/commands/docs/nu-check.md @@ -2,7 +2,7 @@ title: nu-check categories: | strings -version: 0.100.0 +version: 0.101.0 strings: | Validate and parse input content. usage: | diff --git a/commands/docs/nu-highlight.md b/commands/docs/nu-highlight.md index ce06671aae..6d8e19a8a3 100644 --- a/commands/docs/nu-highlight.md +++ b/commands/docs/nu-highlight.md @@ -2,7 +2,7 @@ title: nu-highlight categories: | strings -version: 0.100.0 +version: 0.101.0 strings: | Syntax highlight the input string. usage: | diff --git a/commands/docs/open.md b/commands/docs/open.md index 75f893e354..e4399ddc58 100644 --- a/commands/docs/open.md +++ b/commands/docs/open.md @@ -2,7 +2,7 @@ title: open categories: | filesystem -version: 0.100.0 +version: 0.101.0 filesystem: | Load a file into a cell, converting to table if possible (avoid by appending '--raw'). usage: | diff --git a/commands/docs/overlay.md b/commands/docs/overlay.md index d6c1325721..73937d70d6 100644 --- a/commands/docs/overlay.md +++ b/commands/docs/overlay.md @@ -2,7 +2,7 @@ title: overlay categories: | core -version: 0.100.0 +version: 0.101.0 core: | Commands for manipulating overlays. usage: | diff --git a/commands/docs/overlay_hide.md b/commands/docs/overlay_hide.md index 31e34c132d..3b78b62b49 100644 --- a/commands/docs/overlay_hide.md +++ b/commands/docs/overlay_hide.md @@ -2,7 +2,7 @@ title: overlay hide categories: | core -version: 0.100.0 +version: 0.101.0 core: | Hide an active overlay. usage: | diff --git a/commands/docs/overlay_list.md b/commands/docs/overlay_list.md index ee81ea373a..e4a68bc55b 100644 --- a/commands/docs/overlay_list.md +++ b/commands/docs/overlay_list.md @@ -2,7 +2,7 @@ title: overlay list categories: | core -version: 0.100.0 +version: 0.101.0 core: | List all active overlays. usage: | diff --git a/commands/docs/overlay_new.md b/commands/docs/overlay_new.md index a42d40372e..ea02970408 100644 --- a/commands/docs/overlay_new.md +++ b/commands/docs/overlay_new.md @@ -2,7 +2,7 @@ title: overlay new categories: | core -version: 0.100.0 +version: 0.101.0 core: | Create an empty overlay. usage: | diff --git a/commands/docs/overlay_use.md b/commands/docs/overlay_use.md index f26fd2147d..23faab65a9 100644 --- a/commands/docs/overlay_use.md +++ b/commands/docs/overlay_use.md @@ -2,7 +2,7 @@ title: overlay use categories: | core -version: 0.100.0 +version: 0.101.0 core: | Use definitions from a module as an overlay. usage: | diff --git a/commands/docs/panic.md b/commands/docs/panic.md index 67cdcce2bb..2c01741ec1 100644 --- a/commands/docs/panic.md +++ b/commands/docs/panic.md @@ -2,7 +2,7 @@ title: panic categories: | debug -version: 0.100.0 +version: 0.101.0 debug: | Causes nushell to panic. usage: | diff --git a/commands/docs/par-each.md b/commands/docs/par-each.md index fbc9dbe903..05ce604e53 100644 --- a/commands/docs/par-each.md +++ b/commands/docs/par-each.md @@ -2,7 +2,7 @@ title: par-each categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Run a closure on each row of the input list in parallel, creating a new list with the results. usage: | diff --git a/commands/docs/parse.md b/commands/docs/parse.md index 32059b230b..775dc312b9 100644 --- a/commands/docs/parse.md +++ b/commands/docs/parse.md @@ -2,7 +2,7 @@ title: parse categories: | strings -version: 0.100.0 +version: 0.101.0 strings: | Parse columns from string data using a simple pattern or a supplied regular expression. usage: | diff --git a/commands/docs/path.md b/commands/docs/path.md index bffb2de15a..89fe9500e9 100644 --- a/commands/docs/path.md +++ b/commands/docs/path.md @@ -2,7 +2,7 @@ title: path categories: | path -version: 0.100.0 +version: 0.101.0 path: | Explore and manipulate paths. usage: | @@ -43,14 +43,15 @@ the path literal. ## Subcommands: -| name | description | type | -| -------------------------------------------------------- | ----------------------------------------------------------------------- | -------- | -| [`path basename`](/commands/docs/path_basename.md) | Get the final component of a path. | built-in | -| [`path dirname`](/commands/docs/path_dirname.md) | Get the parent directory of a path. | built-in | -| [`path exists`](/commands/docs/path_exists.md) | Check whether a path exists. | built-in | -| [`path expand`](/commands/docs/path_expand.md) | Try to expand a path to its absolute form. | built-in | -| [`path join`](/commands/docs/path_join.md) | Join a structured path or a list of path parts. | built-in | -| [`path parse`](/commands/docs/path_parse.md) | Convert a path into structured data. | built-in | -| [`path relative-to`](/commands/docs/path_relative-to.md) | Express a path as relative to another path. | built-in | -| [`path split`](/commands/docs/path_split.md) | Split a path into a list based on the system's path separator. | built-in | -| [`path type`](/commands/docs/path_type.md) | Get the type of the object a path refers to (e.g., file, dir, symlink). | built-in | \ No newline at end of file +| name | description | type | +| -------------------------------------------------------- | ------------------------------------------------------------------------------------ | -------- | +| [`path basename`](/commands/docs/path_basename.md) | Get the final component of a path. | built-in | +| [`path dirname`](/commands/docs/path_dirname.md) | Get the parent directory of a path. | built-in | +| [`path exists`](/commands/docs/path_exists.md) | Check whether a path exists. | built-in | +| [`path expand`](/commands/docs/path_expand.md) | Try to expand a path to its absolute form. | built-in | +| [`path join`](/commands/docs/path_join.md) | Join a structured path or a list of path parts. | built-in | +| [`path parse`](/commands/docs/path_parse.md) | Convert a path into structured data. | built-in | +| [`path relative-to`](/commands/docs/path_relative-to.md) | Express a path as relative to another path. | built-in | +| [`path self`](/commands/docs/path_self.md) | Get the absolute path of the script or module containing this command at parse time. | built-in | +| [`path split`](/commands/docs/path_split.md) | Split a path into a list based on the system's path separator. | built-in | +| [`path type`](/commands/docs/path_type.md) | Get the type of the object a path refers to (e.g., file, dir, symlink). | built-in | \ No newline at end of file diff --git a/commands/docs/path_basename.md b/commands/docs/path_basename.md index b34d8a8ef6..57a83e622d 100644 --- a/commands/docs/path_basename.md +++ b/commands/docs/path_basename.md @@ -2,7 +2,7 @@ title: path basename categories: | path -version: 0.100.0 +version: 0.101.0 path: | Get the final component of a path. usage: | diff --git a/commands/docs/path_dirname.md b/commands/docs/path_dirname.md index 194524fba6..d0ab9b07bd 100644 --- a/commands/docs/path_dirname.md +++ b/commands/docs/path_dirname.md @@ -2,7 +2,7 @@ title: path dirname categories: | path -version: 0.100.0 +version: 0.101.0 path: | Get the parent directory of a path. usage: | diff --git a/commands/docs/path_exists.md b/commands/docs/path_exists.md index bdc32303b0..770764f4dc 100644 --- a/commands/docs/path_exists.md +++ b/commands/docs/path_exists.md @@ -2,7 +2,7 @@ title: path exists categories: | path -version: 0.100.0 +version: 0.101.0 path: | Check whether a path exists. usage: | diff --git a/commands/docs/path_expand.md b/commands/docs/path_expand.md index 2d80ee1f2e..a4cabcb7fc 100644 --- a/commands/docs/path_expand.md +++ b/commands/docs/path_expand.md @@ -2,7 +2,7 @@ title: path expand categories: | path -version: 0.100.0 +version: 0.101.0 path: | Try to expand a path to its absolute form. usage: | diff --git a/commands/docs/path_join.md b/commands/docs/path_join.md index 962f6ce3c4..e645de22ee 100644 --- a/commands/docs/path_join.md +++ b/commands/docs/path_join.md @@ -2,7 +2,7 @@ title: path join categories: | path -version: 0.100.0 +version: 0.101.0 path: | Join a structured path or a list of path parts. usage: | diff --git a/commands/docs/path_parse.md b/commands/docs/path_parse.md index 7af164c869..ed80700b37 100644 --- a/commands/docs/path_parse.md +++ b/commands/docs/path_parse.md @@ -2,7 +2,7 @@ title: path parse categories: | path -version: 0.100.0 +version: 0.101.0 path: | Convert a path into structured data. usage: | diff --git a/commands/docs/path_relative-to.md b/commands/docs/path_relative-to.md index 99a0c0b70c..037c4390a5 100644 --- a/commands/docs/path_relative-to.md +++ b/commands/docs/path_relative-to.md @@ -2,7 +2,7 @@ title: path relative-to categories: | path -version: 0.100.0 +version: 0.101.0 path: | Express a path as relative to another path. usage: | diff --git a/commands/docs/path_self.md b/commands/docs/path_self.md new file mode 100644 index 0000000000..4c8e8b2247 --- /dev/null +++ b/commands/docs/path_self.md @@ -0,0 +1,50 @@ +--- +title: path self +categories: | + path +version: 0.101.0 +path: | + Get the absolute path of the script or module containing this command at parse time. +usage: | + Get the absolute path of the script or module containing this command at parse time. +--- + + +# `path self` for [path](/commands/categories/path.md) + +
Get the absolute path of the script or module containing this command at parse time.
+ +## Signature + +```> path self {flags} (path)``` + +## Parameters + + - `path`: Path to get instead of the current file. + + +## Input/output types: + +| input | output | +| ------- | ------ | +| nothing | string | + +## Examples + +Get the path of the current file +```nu +> const current_file = path self + +``` + +Get the path of the directory containing the current file +```nu +> const current_file = path self . + +``` + +Get the absolute form of a path relative to the current file +```nu +> const current_file = path self ../foo + +``` diff --git a/commands/docs/path_split.md b/commands/docs/path_split.md index 2480acd84e..26049d399c 100644 --- a/commands/docs/path_split.md +++ b/commands/docs/path_split.md @@ -2,7 +2,7 @@ title: path split categories: | path -version: 0.100.0 +version: 0.101.0 path: | Split a path into a list based on the system's path separator. usage: | diff --git a/commands/docs/path_type.md b/commands/docs/path_type.md index b3ac0d35a0..50cf26d5fd 100644 --- a/commands/docs/path_type.md +++ b/commands/docs/path_type.md @@ -2,7 +2,7 @@ title: path type categories: | path -version: 0.100.0 +version: 0.101.0 path: | Get the type of the object a path refers to (e.g., file, dir, symlink). usage: | diff --git a/commands/docs/plugin.md b/commands/docs/plugin.md index 864269bd5d..01546dbd18 100644 --- a/commands/docs/plugin.md +++ b/commands/docs/plugin.md @@ -2,7 +2,7 @@ title: plugin categories: | plugin -version: 0.100.0 +version: 0.101.0 plugin: | Commands for managing plugins. usage: | diff --git a/commands/docs/plugin_add.md b/commands/docs/plugin_add.md index a1138f0e98..2757f33617 100644 --- a/commands/docs/plugin_add.md +++ b/commands/docs/plugin_add.md @@ -2,7 +2,7 @@ title: plugin add categories: | plugin -version: 0.100.0 +version: 0.101.0 plugin: | Add a plugin to the plugin registry file. usage: | diff --git a/commands/docs/plugin_list.md b/commands/docs/plugin_list.md index 7acd9eba37..68c2793430 100644 --- a/commands/docs/plugin_list.md +++ b/commands/docs/plugin_list.md @@ -2,7 +2,7 @@ title: plugin list categories: | plugin -version: 0.100.0 +version: 0.101.0 plugin: | List loaded and installed plugins. usage: | @@ -39,7 +39,7 @@ List installed plugins. ╭───┬──────┬─────────┬─────────┬────────┬───────────────────────────────┬───────┬─────────────╮ │ # │ name │ version │ status │ pid │ filename │ shell │ commands │ ├───┼──────┼─────────┼─────────┼────────┼───────────────────────────────┼───────┼─────────────┤ -│ 0 │ inc │ 0.100.0 │ running │ 106480 │ /opt/nu/plugins/nu_plugin_inc │ │ ╭───┬─────╮ │ +│ 0 │ inc │ 0.100.1 │ running │ 106480 │ /opt/nu/plugins/nu_plugin_inc │ │ ╭───┬─────╮ │ │ │ │ │ │ │ │ │ │ 0 │ inc │ │ │ │ │ │ │ │ │ │ ╰───┴─────╯ │ ╰───┴──────┴─────────┴─────────┴────────┴───────────────────────────────┴───────┴─────────────╯ diff --git a/commands/docs/plugin_rm.md b/commands/docs/plugin_rm.md index ee103685af..71ce141b51 100644 --- a/commands/docs/plugin_rm.md +++ b/commands/docs/plugin_rm.md @@ -2,7 +2,7 @@ title: plugin rm categories: | plugin -version: 0.100.0 +version: 0.101.0 plugin: | Remove a plugin from the plugin registry file. usage: | diff --git a/commands/docs/plugin_stop.md b/commands/docs/plugin_stop.md index 98564b47a1..f2977d27f2 100644 --- a/commands/docs/plugin_stop.md +++ b/commands/docs/plugin_stop.md @@ -2,7 +2,7 @@ title: plugin stop categories: | plugin -version: 0.100.0 +version: 0.101.0 plugin: | Stop an installed plugin if it was running. usage: | diff --git a/commands/docs/plugin_use.md b/commands/docs/plugin_use.md index 57916daba9..df935b4110 100644 --- a/commands/docs/plugin_use.md +++ b/commands/docs/plugin_use.md @@ -2,7 +2,7 @@ title: plugin use categories: | plugin -version: 0.100.0 +version: 0.101.0 plugin: | Load a plugin from the plugin registry file into scope. usage: | diff --git a/commands/docs/polars.md b/commands/docs/polars.md index 8593b0925b..7bf9e07446 100644 --- a/commands/docs/polars.md +++ b/commands/docs/polars.md @@ -2,7 +2,7 @@ title: polars categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Operate with data in a dataframe format. usage: | @@ -37,120 +37,118 @@ You must use one of the following subcommands. Using this command as-is will onl ## Subcommands: -| name | description | type | -| -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------ | -| [`polars agg`](/commands/docs/polars_agg.md) | Performs a series of aggregations from a group-by. | plugin | -| [`polars agg-groups`](/commands/docs/polars_agg-groups.md) | Creates an agg_groups expression. | plugin | -| [`polars all-false`](/commands/docs/polars_all-false.md) | Returns true if all values are false. | plugin | -| [`polars all-true`](/commands/docs/polars_all-true.md) | Returns true if all values are true. | plugin | -| [`polars append`](/commands/docs/polars_append.md) | Appends a new dataframe. | plugin | -| [`polars arg-max`](/commands/docs/polars_arg-max.md) | Return index for max value in series. | plugin | -| [`polars arg-min`](/commands/docs/polars_arg-min.md) | Return index for min value in series. | plugin | -| [`polars arg-sort`](/commands/docs/polars_arg-sort.md) | Returns indexes for a sorted series. | plugin | -| [`polars arg-true`](/commands/docs/polars_arg-true.md) | Returns indexes where values are true. | plugin | -| [`polars arg-unique`](/commands/docs/polars_arg-unique.md) | Returns indexes for unique values. | plugin | -| [`polars arg-where`](/commands/docs/polars_arg-where.md) | Creates an expression that returns the arguments where expression is true. | plugin | -| [`polars as`](/commands/docs/polars_as.md) | Creates an alias expression. | plugin | -| [`polars as-date`](/commands/docs/polars_as-date.md) | Converts string to date. | plugin | -| [`polars as-datetime`](/commands/docs/polars_as-datetime.md) | Converts string to datetime. | plugin | -| [`polars cache`](/commands/docs/polars_cache.md) | Caches operations in a new LazyFrame. | plugin | -| [`polars cast`](/commands/docs/polars_cast.md) | Cast a column to a different dtype. | plugin | -| [`polars col`](/commands/docs/polars_col.md) | Creates a named column expression. | plugin | -| [`polars collect`](/commands/docs/polars_collect.md) | Collect lazy dataframe into eager dataframe. | plugin | -| [`polars columns`](/commands/docs/polars_columns.md) | Show dataframe columns. | plugin | -| [`polars concat`](/commands/docs/polars_concat.md) | Concatenate two or more dataframes. | plugin | -| [`polars concat-str`](/commands/docs/polars_concat-str.md) | Creates a concat string expression. | plugin | -| [`polars contains`](/commands/docs/polars_contains.md) | Checks if a pattern is contained in a string. | plugin | -| [`polars count`](/commands/docs/polars_count.md) | Returns the number of non-null values in the column. | plugin | -| [`polars count-null`](/commands/docs/polars_count-null.md) | Counts null values. | plugin | -| [`polars cumulative`](/commands/docs/polars_cumulative.md) | Cumulative calculation for a column or series. | plugin | -| [`polars datepart`](/commands/docs/polars_datepart.md) | Creates an expression for capturing the specified datepart in a column. | plugin | -| [`polars decimal`](/commands/docs/polars_decimal.md) | Converts a string column into a decimal column | plugin | -| [`polars drop`](/commands/docs/polars_drop.md) | Creates a new dataframe by dropping the selected columns. | plugin | -| [`polars drop-duplicates`](/commands/docs/polars_drop-duplicates.md) | Drops duplicate values in dataframe. | plugin | -| [`polars drop-nulls`](/commands/docs/polars_drop-nulls.md) | Drops null values in dataframe. | plugin | -| [`polars dummies`](/commands/docs/polars_dummies.md) | Creates a new dataframe with dummy variables. | plugin | -| [`polars explode`](/commands/docs/polars_explode.md) | Explodes a dataframe or creates a explode expression. | plugin | -| [`polars expr-not`](/commands/docs/polars_expr-not.md) | Creates a not expression. | plugin | -| [`polars fetch`](/commands/docs/polars_fetch.md) | Collects the lazyframe to the selected rows. | plugin | -| [`polars fill-nan`](/commands/docs/polars_fill-nan.md) | Replaces NaN values with the given expression. | plugin | -| [`polars fill-null`](/commands/docs/polars_fill-null.md) | Replaces NULL values with the given expression. | plugin | -| [`polars filter`](/commands/docs/polars_filter.md) | Filter dataframe based in expression. | plugin | -| [`polars filter-with`](/commands/docs/polars_filter-with.md) | Filters dataframe using a mask or expression as reference. | plugin | -| [`polars first`](/commands/docs/polars_first.md) | Show only the first number of rows or create a first expression | plugin | -| [`polars flatten`](/commands/docs/polars_flatten.md) | An alias for polars explode. | plugin | -| [`polars get`](/commands/docs/polars_get.md) | Creates dataframe with the selected columns. | plugin | -| [`polars get-day`](/commands/docs/polars_get-day.md) | Gets day from date. | plugin | -| [`polars get-hour`](/commands/docs/polars_get-hour.md) | Gets hour from date. | plugin | -| [`polars get-minute`](/commands/docs/polars_get-minute.md) | Gets minute from date. | plugin | -| [`polars get-month`](/commands/docs/polars_get-month.md) | Gets month from date. | plugin | -| [`polars get-nanosecond`](/commands/docs/polars_get-nanosecond.md) | Gets nanosecond from date. | plugin | -| [`polars get-ordinal`](/commands/docs/polars_get-ordinal.md) | Gets ordinal from date. | plugin | -| [`polars get-second`](/commands/docs/polars_get-second.md) | Gets second from date. | plugin | -| [`polars get-week`](/commands/docs/polars_get-week.md) | Gets week from date. | plugin | -| [`polars get-weekday`](/commands/docs/polars_get-weekday.md) | Gets weekday from date. | plugin | -| [`polars get-year`](/commands/docs/polars_get-year.md) | Gets year from date. | plugin | -| [`polars group-by`](/commands/docs/polars_group-by.md) | Creates a group-by object that can be used for other aggregations. | plugin | -| [`polars implode`](/commands/docs/polars_implode.md) | Aggregates values into a list. | plugin | -| [`polars integer`](/commands/docs/polars_integer.md) | Converts a string column into a integer column | plugin | -| [`polars into-df`](/commands/docs/polars_into-df.md) | Converts a list, table or record into a dataframe. | plugin | -| [`polars into-lazy`](/commands/docs/polars_into-lazy.md) | Converts a dataframe into a lazy dataframe. | plugin | -| [`polars into-nu`](/commands/docs/polars_into-nu.md) | Converts a dataframe or an expression into nushell value for access and exploration. | plugin | -| [`polars is-duplicated`](/commands/docs/polars_is-duplicated.md) | Creates mask indicating duplicated values. | plugin | -| [`polars is-in`](/commands/docs/polars_is-in.md) | Creates an is-in expression or checks to see if the elements are contained in the right series | plugin | -| [`polars is-not-null`](/commands/docs/polars_is-not-null.md) | Creates mask where value is not null. | plugin | -| [`polars is-null`](/commands/docs/polars_is-null.md) | Creates mask where value is null. | plugin | -| [`polars is-unique`](/commands/docs/polars_is-unique.md) | Creates mask indicating unique values. | plugin | -| [`polars join`](/commands/docs/polars_join.md) | Joins a lazy frame with other lazy frame. | plugin | -| [`polars last`](/commands/docs/polars_last.md) | Creates new dataframe with tail rows or creates a last expression. | plugin | -| [`polars len`](/commands/docs/polars_len.md) | Return the number of rows in the context. This is similar to COUNT(*) in SQL. | plugin | -| [`polars lit`](/commands/docs/polars_lit.md) | Creates a literal expression. | plugin | -| [`polars lowercase`](/commands/docs/polars_lowercase.md) | Lowercase the strings in the column. | plugin | -| [`polars max`](/commands/docs/polars_max.md) | Creates a max expression or aggregates columns to their max value. | plugin | -| [`polars mean`](/commands/docs/polars_mean.md) | Creates a mean expression for an aggregation or aggregates columns to their mean value. | plugin | -| [`polars median`](/commands/docs/polars_median.md) | Median value from columns in a dataframe or creates expression for an aggregation | plugin | -| [`polars min`](/commands/docs/polars_min.md) | Creates a min expression or aggregates columns to their min value. | plugin | -| [`polars n-unique`](/commands/docs/polars_n-unique.md) | Counts unique values. | plugin | -| [`polars not`](/commands/docs/polars_not.md) | Inverts boolean mask. | plugin | -| [`polars open`](/commands/docs/polars_open.md) | Opens CSV, JSON, NDJSON/JSON lines, arrow, avro, or parquet file to create dataframe. A lazy dataframe will be created by default, if supported. | plugin | -| [`polars otherwise`](/commands/docs/polars_otherwise.md) | Completes a when expression. | plugin | -| [`polars pivot`](/commands/docs/polars_pivot.md) | Pivot a DataFrame from wide to long format. | plugin | -| [`polars profile`](/commands/docs/polars_profile.md) | Profile a lazy dataframe. This will run the query and return a record containing the materialized DataFrame and a DataFrame that contains profiling information of each node that is executed. - -The units of the timings are microseconds. | plugin | -| [`polars quantile`](/commands/docs/polars_quantile.md) | Aggregates the columns to the selected quantile. | plugin | -| [`polars query`](/commands/docs/polars_query.md) | Query dataframe using SQL. Note: The dataframe is always named 'df' in your query's from clause. | plugin | -| [`polars rename`](/commands/docs/polars_rename.md) | Rename a dataframe column. | plugin | -| [`polars replace`](/commands/docs/polars_replace.md) | Replace the leftmost (sub)string by a regex pattern. | plugin | -| [`polars replace-all`](/commands/docs/polars_replace-all.md) | Replace all (sub)strings by a regex pattern. | plugin | -| [`polars reverse`](/commands/docs/polars_reverse.md) | Reverses the LazyFrame | plugin | -| [`polars rolling`](/commands/docs/polars_rolling.md) | Rolling calculation for a series. | plugin | -| [`polars sample`](/commands/docs/polars_sample.md) | Create sample dataframe. | plugin | -| [`polars save`](/commands/docs/polars_save.md) | Saves a dataframe to disk. For lazy dataframes a sink operation will be used if the file type supports it (parquet, ipc/arrow, csv, and ndjson). | plugin | -| [`polars schema`](/commands/docs/polars_schema.md) | Show schema for a dataframe. | plugin | -| [`polars select`](/commands/docs/polars_select.md) | Selects columns from lazyframe. | plugin | -| [`polars set`](/commands/docs/polars_set.md) | Sets value where given mask is true. | plugin | -| [`polars set-with-idx`](/commands/docs/polars_set-with-idx.md) | Sets value in the given index. | plugin | -| [`polars shape`](/commands/docs/polars_shape.md) | Shows column and row size for a dataframe. | plugin | -| [`polars shift`](/commands/docs/polars_shift.md) | Shifts the values by a given period. | plugin | -| [`polars slice`](/commands/docs/polars_slice.md) | Creates new dataframe from a slice of rows. | plugin | -| [`polars sort-by`](/commands/docs/polars_sort-by.md) | Sorts a lazy dataframe based on expression(s). | plugin | -| [`polars std`](/commands/docs/polars_std.md) | Creates a std expression for an aggregation of std value from columns in a dataframe. | plugin | -| [`polars store-get`](/commands/docs/polars_store-get.md) | Gets a Dataframe or other object from the plugin cache. | plugin | -| [`polars store-ls`](/commands/docs/polars_store-ls.md) | Lists stored polars objects. | plugin | -| [`polars store-rm`](/commands/docs/polars_store-rm.md) | Removes a stored Dataframe or other object from the plugin cache. | plugin | -| [`polars str-join`](/commands/docs/polars_str-join.md) | Concatenates strings within a column or dataframes | plugin | -| [`polars str-lengths`](/commands/docs/polars_str-lengths.md) | Get lengths of all strings. | plugin | -| [`polars str-slice`](/commands/docs/polars_str-slice.md) | Slices the string from the start position until the selected length. | plugin | -| [`polars strftime`](/commands/docs/polars_strftime.md) | Formats date based on string rule. | plugin | -| [`polars sum`](/commands/docs/polars_sum.md) | Creates a sum expression for an aggregation or aggregates columns to their sum value. | plugin | -| [`polars summary`](/commands/docs/polars_summary.md) | For a dataframe, produces descriptive statistics (summary statistics) for its numeric columns. | plugin | -| [`polars take`](/commands/docs/polars_take.md) | Creates new dataframe using the given indices. | plugin | -| [`polars unique`](/commands/docs/polars_unique.md) | Returns unique values from a dataframe. | plugin | -| [`polars unnest`](/commands/docs/polars_unnest.md) | Decompose struct columns into separate columns for each of their fields. The new columns will be inserted into the dataframe at the location of the struct column. | plugin | -| [`polars unpivot`](/commands/docs/polars_unpivot.md) | Unpivot a DataFrame from wide to long format. | plugin | -| [`polars uppercase`](/commands/docs/polars_uppercase.md) | Uppercase the strings in the column. | plugin | -| [`polars value-counts`](/commands/docs/polars_value-counts.md) | Returns a dataframe with the counts for unique values in series. | plugin | -| [`polars var`](/commands/docs/polars_var.md) | Create a var expression for an aggregation. | plugin | -| [`polars when`](/commands/docs/polars_when.md) | Creates and modifies a when expression. | plugin | -| [`polars with-column`](/commands/docs/polars_with-column.md) | Adds a series to the dataframe. | plugin | \ No newline at end of file +| name | description | type | +| -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------ | +| [`polars agg`](/commands/docs/polars_agg.md) | Performs a series of aggregations from a group-by. | plugin | +| [`polars agg-groups`](/commands/docs/polars_agg-groups.md) | Creates an agg_groups expression. | plugin | +| [`polars all-false`](/commands/docs/polars_all-false.md) | Returns true if all values are false. | plugin | +| [`polars all-true`](/commands/docs/polars_all-true.md) | Returns true if all values are true. | plugin | +| [`polars append`](/commands/docs/polars_append.md) | Appends a new dataframe. | plugin | +| [`polars arg-max`](/commands/docs/polars_arg-max.md) | Return index for max value in series. | plugin | +| [`polars arg-min`](/commands/docs/polars_arg-min.md) | Return index for min value in series. | plugin | +| [`polars arg-sort`](/commands/docs/polars_arg-sort.md) | Returns indexes for a sorted series. | plugin | +| [`polars arg-true`](/commands/docs/polars_arg-true.md) | Returns indexes where values are true. | plugin | +| [`polars arg-unique`](/commands/docs/polars_arg-unique.md) | Returns indexes for unique values. | plugin | +| [`polars arg-where`](/commands/docs/polars_arg-where.md) | Creates an expression that returns the arguments where expression is true. | plugin | +| [`polars as`](/commands/docs/polars_as.md) | Creates an alias expression. | plugin | +| [`polars as-date`](/commands/docs/polars_as-date.md) | Converts string to date. | plugin | +| [`polars as-datetime`](/commands/docs/polars_as-datetime.md) | Converts string to datetime. | plugin | +| [`polars cache`](/commands/docs/polars_cache.md) | Caches operations in a new LazyFrame. | plugin | +| [`polars cast`](/commands/docs/polars_cast.md) | Cast a column to a different dtype. | plugin | +| [`polars col`](/commands/docs/polars_col.md) | Creates a named column expression. | plugin | +| [`polars collect`](/commands/docs/polars_collect.md) | Collect lazy dataframe into eager dataframe. | plugin | +| [`polars columns`](/commands/docs/polars_columns.md) | Show dataframe columns. | plugin | +| [`polars concat`](/commands/docs/polars_concat.md) | Concatenate two or more dataframes. | plugin | +| [`polars concat-str`](/commands/docs/polars_concat-str.md) | Creates a concat string expression. | plugin | +| [`polars contains`](/commands/docs/polars_contains.md) | Checks if a pattern is contained in a string. | plugin | +| [`polars count`](/commands/docs/polars_count.md) | Returns the number of non-null values in the column. | plugin | +| [`polars count-null`](/commands/docs/polars_count-null.md) | Counts null values. | plugin | +| [`polars cumulative`](/commands/docs/polars_cumulative.md) | Cumulative calculation for a column or series. | plugin | +| [`polars datepart`](/commands/docs/polars_datepart.md) | Creates an expression for capturing the specified datepart in a column. | plugin | +| [`polars decimal`](/commands/docs/polars_decimal.md) | Converts a string column into a decimal column | plugin | +| [`polars drop`](/commands/docs/polars_drop.md) | Creates a new dataframe by dropping the selected columns. | plugin | +| [`polars drop-duplicates`](/commands/docs/polars_drop-duplicates.md) | Drops duplicate values in dataframe. | plugin | +| [`polars drop-nulls`](/commands/docs/polars_drop-nulls.md) | Drops null values in dataframe. | plugin | +| [`polars dummies`](/commands/docs/polars_dummies.md) | Creates a new dataframe with dummy variables. | plugin | +| [`polars explode`](/commands/docs/polars_explode.md) | Explodes a dataframe or creates a explode expression. | plugin | +| [`polars expr-not`](/commands/docs/polars_expr-not.md) | Creates a not expression. | plugin | +| [`polars fetch`](/commands/docs/polars_fetch.md) | Collects the lazyframe to the selected rows. | plugin | +| [`polars fill-nan`](/commands/docs/polars_fill-nan.md) | Replaces NaN values with the given expression. | plugin | +| [`polars fill-null`](/commands/docs/polars_fill-null.md) | Replaces NULL values with the given expression. | plugin | +| [`polars filter`](/commands/docs/polars_filter.md) | Filter dataframe based in expression. | plugin | +| [`polars filter-with`](/commands/docs/polars_filter-with.md) | Filters dataframe using a mask or expression as reference. | plugin | +| [`polars first`](/commands/docs/polars_first.md) | Show only the first number of rows or create a first expression | plugin | +| [`polars flatten`](/commands/docs/polars_flatten.md) | An alias for polars explode. | plugin | +| [`polars get`](/commands/docs/polars_get.md) | Creates dataframe with the selected columns. | plugin | +| [`polars get-day`](/commands/docs/polars_get-day.md) | Gets day from date. | plugin | +| [`polars get-hour`](/commands/docs/polars_get-hour.md) | Gets hour from date. | plugin | +| [`polars get-minute`](/commands/docs/polars_get-minute.md) | Gets minute from date. | plugin | +| [`polars get-month`](/commands/docs/polars_get-month.md) | Gets month from date. | plugin | +| [`polars get-nanosecond`](/commands/docs/polars_get-nanosecond.md) | Gets nanosecond from date. | plugin | +| [`polars get-ordinal`](/commands/docs/polars_get-ordinal.md) | Gets ordinal from date. | plugin | +| [`polars get-second`](/commands/docs/polars_get-second.md) | Gets second from date. | plugin | +| [`polars get-week`](/commands/docs/polars_get-week.md) | Gets week from date. | plugin | +| [`polars get-weekday`](/commands/docs/polars_get-weekday.md) | Gets weekday from date. | plugin | +| [`polars get-year`](/commands/docs/polars_get-year.md) | Gets year from date. | plugin | +| [`polars group-by`](/commands/docs/polars_group-by.md) | Creates a group-by object that can be used for other aggregations. | plugin | +| [`polars implode`](/commands/docs/polars_implode.md) | Aggregates values into a list. | plugin | +| [`polars integer`](/commands/docs/polars_integer.md) | Converts a string column into a integer column | plugin | +| [`polars into-df`](/commands/docs/polars_into-df.md) | Converts a list, table or record into a dataframe. | plugin | +| [`polars into-lazy`](/commands/docs/polars_into-lazy.md) | Converts a dataframe into a lazy dataframe. | plugin | +| [`polars into-nu`](/commands/docs/polars_into-nu.md) | Converts a dataframe or an expression into nushell value for access and exploration. | plugin | +| [`polars is-duplicated`](/commands/docs/polars_is-duplicated.md) | Creates mask indicating duplicated values. | plugin | +| [`polars is-in`](/commands/docs/polars_is-in.md) | Creates an is-in expression or checks to see if the elements are contained in the right series | plugin | +| [`polars is-not-null`](/commands/docs/polars_is-not-null.md) | Creates mask where value is not null. | plugin | +| [`polars is-null`](/commands/docs/polars_is-null.md) | Creates mask where value is null. | plugin | +| [`polars is-unique`](/commands/docs/polars_is-unique.md) | Creates mask indicating unique values. | plugin | +| [`polars join`](/commands/docs/polars_join.md) | Joins a lazy frame with other lazy frame. | plugin | +| [`polars last`](/commands/docs/polars_last.md) | Creates new dataframe with tail rows or creates a last expression. | plugin | +| [`polars len`](/commands/docs/polars_len.md) | Return the number of rows in the context. This is similar to COUNT(*) in SQL. | plugin | +| [`polars lit`](/commands/docs/polars_lit.md) | Creates a literal expression. | plugin | +| [`polars lowercase`](/commands/docs/polars_lowercase.md) | Lowercase the strings in the column. | plugin | +| [`polars max`](/commands/docs/polars_max.md) | Creates a max expression or aggregates columns to their max value. | plugin | +| [`polars mean`](/commands/docs/polars_mean.md) | Creates a mean expression for an aggregation or aggregates columns to their mean value. | plugin | +| [`polars median`](/commands/docs/polars_median.md) | Median value from columns in a dataframe or creates expression for an aggregation | plugin | +| [`polars min`](/commands/docs/polars_min.md) | Creates a min expression or aggregates columns to their min value. | plugin | +| [`polars n-unique`](/commands/docs/polars_n-unique.md) | Counts unique values. | plugin | +| [`polars not`](/commands/docs/polars_not.md) | Inverts boolean mask. | plugin | +| [`polars open`](/commands/docs/polars_open.md) | Opens CSV, JSON, NDJSON/JSON lines, arrow, avro, or parquet file to create dataframe. A lazy dataframe will be created by default, if supported. | plugin | +| [`polars otherwise`](/commands/docs/polars_otherwise.md) | Completes a when expression. | plugin | +| [`polars pivot`](/commands/docs/polars_pivot.md) | Pivot a DataFrame from wide to long format. | plugin | +| [`polars profile`](/commands/docs/polars_profile.md) | Profile a lazy dataframe. | plugin | +| [`polars quantile`](/commands/docs/polars_quantile.md) | Aggregates the columns to the selected quantile. | plugin | +| [`polars query`](/commands/docs/polars_query.md) | Query dataframe using SQL. Note: The dataframe is always named 'df' in your query's from clause. | plugin | +| [`polars rename`](/commands/docs/polars_rename.md) | Rename a dataframe column. | plugin | +| [`polars replace`](/commands/docs/polars_replace.md) | Replace the leftmost (sub)string by a regex pattern. | plugin | +| [`polars replace-all`](/commands/docs/polars_replace-all.md) | Replace all (sub)strings by a regex pattern. | plugin | +| [`polars reverse`](/commands/docs/polars_reverse.md) | Reverses the LazyFrame | plugin | +| [`polars rolling`](/commands/docs/polars_rolling.md) | Rolling calculation for a series. | plugin | +| [`polars sample`](/commands/docs/polars_sample.md) | Create sample dataframe. | plugin | +| [`polars save`](/commands/docs/polars_save.md) | Saves a dataframe to disk. For lazy dataframes a sink operation will be used if the file type supports it (parquet, ipc/arrow, csv, and ndjson). | plugin | +| [`polars schema`](/commands/docs/polars_schema.md) | Show schema for a dataframe. | plugin | +| [`polars select`](/commands/docs/polars_select.md) | Selects columns from lazyframe. | plugin | +| [`polars set`](/commands/docs/polars_set.md) | Sets value where given mask is true. | plugin | +| [`polars set-with-idx`](/commands/docs/polars_set-with-idx.md) | Sets value in the given index. | plugin | +| [`polars shape`](/commands/docs/polars_shape.md) | Shows column and row size for a dataframe. | plugin | +| [`polars shift`](/commands/docs/polars_shift.md) | Shifts the values by a given period. | plugin | +| [`polars slice`](/commands/docs/polars_slice.md) | Creates new dataframe from a slice of rows. | plugin | +| [`polars sort-by`](/commands/docs/polars_sort-by.md) | Sorts a lazy dataframe based on expression(s). | plugin | +| [`polars std`](/commands/docs/polars_std.md) | Creates a std expression for an aggregation of std value from columns in a dataframe. | plugin | +| [`polars store-get`](/commands/docs/polars_store-get.md) | Gets a Dataframe or other object from the plugin cache. | plugin | +| [`polars store-ls`](/commands/docs/polars_store-ls.md) | Lists stored polars objects. | plugin | +| [`polars store-rm`](/commands/docs/polars_store-rm.md) | Removes a stored Dataframe or other object from the plugin cache. | plugin | +| [`polars str-join`](/commands/docs/polars_str-join.md) | Concatenates strings within a column or dataframes | plugin | +| [`polars str-lengths`](/commands/docs/polars_str-lengths.md) | Get lengths of all strings. | plugin | +| [`polars str-slice`](/commands/docs/polars_str-slice.md) | Slices the string from the start position until the selected length. | plugin | +| [`polars strftime`](/commands/docs/polars_strftime.md) | Formats date based on string rule. | plugin | +| [`polars sum`](/commands/docs/polars_sum.md) | Creates a sum expression for an aggregation or aggregates columns to their sum value. | plugin | +| [`polars summary`](/commands/docs/polars_summary.md) | For a dataframe, produces descriptive statistics (summary statistics) for its numeric columns. | plugin | +| [`polars take`](/commands/docs/polars_take.md) | Creates new dataframe using the given indices. | plugin | +| [`polars unique`](/commands/docs/polars_unique.md) | Returns unique values from a dataframe. | plugin | +| [`polars unnest`](/commands/docs/polars_unnest.md) | Decompose struct columns into separate columns for each of their fields. The new columns will be inserted into the dataframe at the location of the struct column. | plugin | +| [`polars unpivot`](/commands/docs/polars_unpivot.md) | Unpivot a DataFrame from wide to long format. | plugin | +| [`polars uppercase`](/commands/docs/polars_uppercase.md) | Uppercase the strings in the column. | plugin | +| [`polars value-counts`](/commands/docs/polars_value-counts.md) | Returns a dataframe with the counts for unique values in series. | plugin | +| [`polars var`](/commands/docs/polars_var.md) | Create a var expression for an aggregation. | plugin | +| [`polars when`](/commands/docs/polars_when.md) | Creates and modifies a when expression. | plugin | +| [`polars with-column`](/commands/docs/polars_with-column.md) | Adds a series to the dataframe. | plugin | \ No newline at end of file diff --git a/commands/docs/polars_agg-groups.md b/commands/docs/polars_agg-groups.md index f6033e3eb5..052356ef1a 100644 --- a/commands/docs/polars_agg-groups.md +++ b/commands/docs/polars_agg-groups.md @@ -2,7 +2,7 @@ title: polars agg-groups categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Creates an agg_groups expression. usage: | @@ -34,7 +34,7 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Examples -Get the groiup index of the group by operations. +Get the group index of the group by operations. ```nu > [[group value]; [one 94] [one 95] [one 96] [two 97] [two 98] [two 99]] | polars into-df diff --git a/commands/docs/polars_agg.md b/commands/docs/polars_agg.md index f782533999..b292252bd2 100644 --- a/commands/docs/polars_agg.md +++ b/commands/docs/polars_agg.md @@ -2,7 +2,7 @@ title: polars agg categories: | lazyframe -version: 0.100.0 +version: 0.101.0 lazyframe: | Performs a series of aggregations from a group-by. usage: | diff --git a/commands/docs/polars_all-false.md b/commands/docs/polars_all-false.md index 22c95f942a..686f339b02 100644 --- a/commands/docs/polars_all-false.md +++ b/commands/docs/polars_all-false.md @@ -2,7 +2,7 @@ title: polars all-false categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Returns true if all values are false. usage: | diff --git a/commands/docs/polars_all-true.md b/commands/docs/polars_all-true.md index 8a6823d4b5..3593755598 100644 --- a/commands/docs/polars_all-true.md +++ b/commands/docs/polars_all-true.md @@ -2,7 +2,7 @@ title: polars all-true categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Returns true if all values are true. usage: | diff --git a/commands/docs/polars_append.md b/commands/docs/polars_append.md index 21c6e52d92..cd05ec5c22 100644 --- a/commands/docs/polars_append.md +++ b/commands/docs/polars_append.md @@ -2,7 +2,7 @@ title: polars append categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Appends a new dataframe. usage: | diff --git a/commands/docs/polars_arg-max.md b/commands/docs/polars_arg-max.md index b4a3165b43..afd48980a5 100644 --- a/commands/docs/polars_arg-max.md +++ b/commands/docs/polars_arg-max.md @@ -2,7 +2,7 @@ title: polars arg-max categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Return index for max value in series. usage: | diff --git a/commands/docs/polars_arg-min.md b/commands/docs/polars_arg-min.md index fb0d482d84..86cf78b600 100644 --- a/commands/docs/polars_arg-min.md +++ b/commands/docs/polars_arg-min.md @@ -2,7 +2,7 @@ title: polars arg-min categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Return index for min value in series. usage: | diff --git a/commands/docs/polars_arg-sort.md b/commands/docs/polars_arg-sort.md index e588265f48..43c6b7be4b 100644 --- a/commands/docs/polars_arg-sort.md +++ b/commands/docs/polars_arg-sort.md @@ -2,7 +2,7 @@ title: polars arg-sort categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Returns indexes for a sorted series. usage: | diff --git a/commands/docs/polars_arg-true.md b/commands/docs/polars_arg-true.md index 13f570610b..221b5bcc3f 100644 --- a/commands/docs/polars_arg-true.md +++ b/commands/docs/polars_arg-true.md @@ -2,7 +2,7 @@ title: polars arg-true categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Returns indexes where values are true. usage: | diff --git a/commands/docs/polars_arg-unique.md b/commands/docs/polars_arg-unique.md index ec72c9ba28..e8703cf46b 100644 --- a/commands/docs/polars_arg-unique.md +++ b/commands/docs/polars_arg-unique.md @@ -2,7 +2,7 @@ title: polars arg-unique categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Returns indexes for unique values. usage: | diff --git a/commands/docs/polars_arg-where.md b/commands/docs/polars_arg-where.md index 256447c720..139df390e1 100644 --- a/commands/docs/polars_arg-where.md +++ b/commands/docs/polars_arg-where.md @@ -2,7 +2,7 @@ title: polars arg-where categories: | expression -version: 0.100.0 +version: 0.101.0 expression: | Creates an expression that returns the arguments where expression is true. usage: | diff --git a/commands/docs/polars_as-date.md b/commands/docs/polars_as-date.md index 01f019fb61..ad138efe25 100644 --- a/commands/docs/polars_as-date.md +++ b/commands/docs/polars_as-date.md @@ -2,7 +2,7 @@ title: polars as-date categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Converts string to date. usage: | diff --git a/commands/docs/polars_as-datetime.md b/commands/docs/polars_as-datetime.md index a064e44f39..e23aa0d993 100644 --- a/commands/docs/polars_as-datetime.md +++ b/commands/docs/polars_as-datetime.md @@ -2,7 +2,7 @@ title: polars as-datetime categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Converts string to datetime. usage: | diff --git a/commands/docs/polars_as.md b/commands/docs/polars_as.md index c1c678374d..b71b00a6ca 100644 --- a/commands/docs/polars_as.md +++ b/commands/docs/polars_as.md @@ -2,7 +2,7 @@ title: polars as categories: | expression -version: 0.100.0 +version: 0.101.0 expression: | Creates an alias expression. usage: | diff --git a/commands/docs/polars_cache.md b/commands/docs/polars_cache.md index f426ac8ed0..45ba587fbd 100644 --- a/commands/docs/polars_cache.md +++ b/commands/docs/polars_cache.md @@ -2,7 +2,7 @@ title: polars cache categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Caches operations in a new LazyFrame. usage: | diff --git a/commands/docs/polars_cast.md b/commands/docs/polars_cast.md index 7f1f3e530b..b98cbdbe16 100644 --- a/commands/docs/polars_cast.md +++ b/commands/docs/polars_cast.md @@ -2,7 +2,7 @@ title: polars cast categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Cast a column to a different dtype. usage: | diff --git a/commands/docs/polars_col.md b/commands/docs/polars_col.md index a23541059b..0d562ff951 100644 --- a/commands/docs/polars_col.md +++ b/commands/docs/polars_col.md @@ -2,7 +2,7 @@ title: polars col categories: | expression -version: 0.100.0 +version: 0.101.0 expression: | Creates a named column expression. usage: | diff --git a/commands/docs/polars_collect.md b/commands/docs/polars_collect.md index 45265cfa92..9d18fa6d72 100644 --- a/commands/docs/polars_collect.md +++ b/commands/docs/polars_collect.md @@ -2,7 +2,7 @@ title: polars collect categories: | lazyframe -version: 0.100.0 +version: 0.101.0 lazyframe: | Collect lazy dataframe into eager dataframe. usage: | diff --git a/commands/docs/polars_columns.md b/commands/docs/polars_columns.md index f0cc70573c..e022981959 100644 --- a/commands/docs/polars_columns.md +++ b/commands/docs/polars_columns.md @@ -2,7 +2,7 @@ title: polars columns categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Show dataframe columns. usage: | diff --git a/commands/docs/polars_concat-str.md b/commands/docs/polars_concat-str.md index 4fdc6f55ed..6d0cdc6d88 100644 --- a/commands/docs/polars_concat-str.md +++ b/commands/docs/polars_concat-str.md @@ -2,7 +2,7 @@ title: polars concat-str categories: | expression -version: 0.100.0 +version: 0.101.0 expression: | Creates a concat string expression. usage: | diff --git a/commands/docs/polars_concat.md b/commands/docs/polars_concat.md index 45b495714b..bd5dad14b0 100644 --- a/commands/docs/polars_concat.md +++ b/commands/docs/polars_concat.md @@ -2,7 +2,7 @@ title: polars concat categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Concatenate two or more dataframes. usage: | diff --git a/commands/docs/polars_contains.md b/commands/docs/polars_contains.md index 608efc1502..c06a0c9785 100644 --- a/commands/docs/polars_contains.md +++ b/commands/docs/polars_contains.md @@ -2,7 +2,7 @@ title: polars contains categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Checks if a pattern is contained in a string. usage: | diff --git a/commands/docs/polars_count-null.md b/commands/docs/polars_count-null.md index a5b4dd5155..13d4aa0b2f 100644 --- a/commands/docs/polars_count-null.md +++ b/commands/docs/polars_count-null.md @@ -2,7 +2,7 @@ title: polars count-null categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Counts null values. usage: | diff --git a/commands/docs/polars_count.md b/commands/docs/polars_count.md index 4fae4c18f9..4ae4ac0481 100644 --- a/commands/docs/polars_count.md +++ b/commands/docs/polars_count.md @@ -2,7 +2,7 @@ title: polars count categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Returns the number of non-null values in the column. usage: | diff --git a/commands/docs/polars_cumulative.md b/commands/docs/polars_cumulative.md index dc2947832d..910245d27a 100644 --- a/commands/docs/polars_cumulative.md +++ b/commands/docs/polars_cumulative.md @@ -2,7 +2,7 @@ title: polars cumulative categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Cumulative calculation for a column or series. usage: | diff --git a/commands/docs/polars_datepart.md b/commands/docs/polars_datepart.md index e0bf65d976..5dfedd8966 100644 --- a/commands/docs/polars_datepart.md +++ b/commands/docs/polars_datepart.md @@ -2,7 +2,7 @@ title: polars datepart categories: | expression -version: 0.100.0 +version: 0.101.0 expression: | Creates an expression for capturing the specified datepart in a column. usage: | @@ -59,10 +59,10 @@ Creates an expression to capture multiple date parts (polars col datetime | polars datepart minute | polars as datetime_minute ), (polars col datetime | polars datepart second | polars as datetime_second ), (polars col datetime | polars datepart nanosecond | polars as datetime_ns ) ] -╭───┬─────────────┬───────────────┬────────────────┬──────────────┬───────────────┬─────────────────┬─────────────────┬─────────────╮ -│ # │ datetime │ datetime_year │ datetime_month │ datetime_day │ datetime_hour │ datetime_minute │ datetime_second │ datetime_ns │ -├───┼─────────────┼───────────────┼────────────────┼──────────────┼───────────────┼─────────────────┼─────────────────┼─────────────┤ -│ 0 │ 2 years ago │ 2021 │ 12 │ 30 │ 1 │ 2 │ 3 │ 123456789 │ -╰───┴─────────────┴───────────────┴────────────────┴──────────────┴───────────────┴─────────────────┴─────────────────┴─────────────╯ +╭─────┬───────────────┬─────────────────┬──────────────────┬───────────────┬────────────────┬──────────────────┬──────╮ +│ # │ datetime │ datetime_year │ datetime_month │ datetime_day │ datetime_hour │ datetime_minute │ ... │ +├─────┼───────────────┼─────────────────┼──────────────────┼───────────────┼────────────────┼──────────────────┼──────┤ +│ 0 │ 2 years ago │ 2021 │ 12 │ 30 │ 1 │ 2 │ ... │ +╰─────┴───────────────┴─────────────────┴──────────────────┴───────────────┴────────────────┴──────────────────┴──────╯ ``` diff --git a/commands/docs/polars_decimal.md b/commands/docs/polars_decimal.md index cb872e0b4e..91a0e7388b 100644 --- a/commands/docs/polars_decimal.md +++ b/commands/docs/polars_decimal.md @@ -2,7 +2,7 @@ title: polars decimal categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Converts a string column into a decimal column usage: | diff --git a/commands/docs/polars_drop-duplicates.md b/commands/docs/polars_drop-duplicates.md index b803fb6a09..5496bf71d8 100644 --- a/commands/docs/polars_drop-duplicates.md +++ b/commands/docs/polars_drop-duplicates.md @@ -2,7 +2,7 @@ title: polars drop-duplicates categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Drops duplicate values in dataframe. usage: | diff --git a/commands/docs/polars_drop-nulls.md b/commands/docs/polars_drop-nulls.md index 387b85367e..39a9b20965 100644 --- a/commands/docs/polars_drop-nulls.md +++ b/commands/docs/polars_drop-nulls.md @@ -2,7 +2,7 @@ title: polars drop-nulls categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Drops null values in dataframe. usage: | diff --git a/commands/docs/polars_drop.md b/commands/docs/polars_drop.md index 4f8b2f502b..429b9c2628 100644 --- a/commands/docs/polars_drop.md +++ b/commands/docs/polars_drop.md @@ -2,7 +2,7 @@ title: polars drop categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Creates a new dataframe by dropping the selected columns. usage: | diff --git a/commands/docs/polars_dummies.md b/commands/docs/polars_dummies.md index 24e5156ee9..38fb6296af 100644 --- a/commands/docs/polars_dummies.md +++ b/commands/docs/polars_dummies.md @@ -2,7 +2,7 @@ title: polars dummies categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Creates a new dataframe with dummy variables. usage: | diff --git a/commands/docs/polars_explode.md b/commands/docs/polars_explode.md index 071e7eab4d..8b7da366ee 100644 --- a/commands/docs/polars_explode.md +++ b/commands/docs/polars_explode.md @@ -2,7 +2,7 @@ title: polars explode categories: | lazyframe -version: 0.100.0 +version: 0.101.0 lazyframe: | Explodes a dataframe or creates a explode expression. usage: | diff --git a/commands/docs/polars_expr-not.md b/commands/docs/polars_expr-not.md index 7b84bad569..27619e1229 100644 --- a/commands/docs/polars_expr-not.md +++ b/commands/docs/polars_expr-not.md @@ -2,7 +2,7 @@ title: polars expr-not categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Creates a not expression. usage: | diff --git a/commands/docs/polars_fetch.md b/commands/docs/polars_fetch.md index 6f386b00d6..137280959f 100644 --- a/commands/docs/polars_fetch.md +++ b/commands/docs/polars_fetch.md @@ -2,7 +2,7 @@ title: polars fetch categories: | lazyframe -version: 0.100.0 +version: 0.101.0 lazyframe: | Collects the lazyframe to the selected rows. usage: | diff --git a/commands/docs/polars_fill-nan.md b/commands/docs/polars_fill-nan.md index 2d8ff5b6ff..755c1602c6 100644 --- a/commands/docs/polars_fill-nan.md +++ b/commands/docs/polars_fill-nan.md @@ -2,7 +2,7 @@ title: polars fill-nan categories: | lazyframe -version: 0.100.0 +version: 0.101.0 lazyframe: | Replaces NaN values with the given expression. usage: | diff --git a/commands/docs/polars_fill-null.md b/commands/docs/polars_fill-null.md index 5990ee0929..e5247074f6 100644 --- a/commands/docs/polars_fill-null.md +++ b/commands/docs/polars_fill-null.md @@ -2,7 +2,7 @@ title: polars fill-null categories: | lazyframe -version: 0.100.0 +version: 0.101.0 lazyframe: | Replaces NULL values with the given expression. usage: | diff --git a/commands/docs/polars_filter-with.md b/commands/docs/polars_filter-with.md index f190f3f677..d99c691a5f 100644 --- a/commands/docs/polars_filter-with.md +++ b/commands/docs/polars_filter-with.md @@ -2,7 +2,7 @@ title: polars filter-with categories: | dataframe or lazyframe -version: 0.100.0 +version: 0.101.0 dataframe_or_lazyframe: | Filters dataframe using a mask or expression as reference. usage: | diff --git a/commands/docs/polars_filter.md b/commands/docs/polars_filter.md index ab82c7d3c1..8bb267dc98 100644 --- a/commands/docs/polars_filter.md +++ b/commands/docs/polars_filter.md @@ -2,7 +2,7 @@ title: polars filter categories: | lazyframe -version: 0.100.0 +version: 0.101.0 lazyframe: | Filter dataframe based in expression. usage: | diff --git a/commands/docs/polars_first.md b/commands/docs/polars_first.md index 6f95f7cb4e..fa6103c751 100644 --- a/commands/docs/polars_first.md +++ b/commands/docs/polars_first.md @@ -2,7 +2,7 @@ title: polars first categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Show only the first number of rows or create a first expression usage: | diff --git a/commands/docs/polars_flatten.md b/commands/docs/polars_flatten.md index 367f0915d5..334f854f44 100644 --- a/commands/docs/polars_flatten.md +++ b/commands/docs/polars_flatten.md @@ -2,7 +2,7 @@ title: polars flatten categories: | lazyframe -version: 0.100.0 +version: 0.101.0 lazyframe: | An alias for polars explode. usage: | diff --git a/commands/docs/polars_get-day.md b/commands/docs/polars_get-day.md index 7342b8f85a..c6077d215e 100644 --- a/commands/docs/polars_get-day.md +++ b/commands/docs/polars_get-day.md @@ -2,7 +2,7 @@ title: polars get-day categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Gets day from date. usage: | diff --git a/commands/docs/polars_get-hour.md b/commands/docs/polars_get-hour.md index 6a288f8e18..fee59c9c39 100644 --- a/commands/docs/polars_get-hour.md +++ b/commands/docs/polars_get-hour.md @@ -2,7 +2,7 @@ title: polars get-hour categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Gets hour from date. usage: | diff --git a/commands/docs/polars_get-minute.md b/commands/docs/polars_get-minute.md index 862f54a2ef..46fc5ea467 100644 --- a/commands/docs/polars_get-minute.md +++ b/commands/docs/polars_get-minute.md @@ -2,7 +2,7 @@ title: polars get-minute categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Gets minute from date. usage: | diff --git a/commands/docs/polars_get-month.md b/commands/docs/polars_get-month.md index 964c6cec05..30eecef781 100644 --- a/commands/docs/polars_get-month.md +++ b/commands/docs/polars_get-month.md @@ -2,7 +2,7 @@ title: polars get-month categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Gets month from date. usage: | diff --git a/commands/docs/polars_get-nanosecond.md b/commands/docs/polars_get-nanosecond.md index 7428f28222..ba88e2d53e 100644 --- a/commands/docs/polars_get-nanosecond.md +++ b/commands/docs/polars_get-nanosecond.md @@ -2,7 +2,7 @@ title: polars get-nanosecond categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Gets nanosecond from date. usage: | diff --git a/commands/docs/polars_get-ordinal.md b/commands/docs/polars_get-ordinal.md index e0e32ddf49..75b1632082 100644 --- a/commands/docs/polars_get-ordinal.md +++ b/commands/docs/polars_get-ordinal.md @@ -2,7 +2,7 @@ title: polars get-ordinal categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Gets ordinal from date. usage: | diff --git a/commands/docs/polars_get-second.md b/commands/docs/polars_get-second.md index 8df36be16d..809fcdc7e6 100644 --- a/commands/docs/polars_get-second.md +++ b/commands/docs/polars_get-second.md @@ -2,7 +2,7 @@ title: polars get-second categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Gets second from date. usage: | diff --git a/commands/docs/polars_get-week.md b/commands/docs/polars_get-week.md index 41ae6ca44c..29f13188b0 100644 --- a/commands/docs/polars_get-week.md +++ b/commands/docs/polars_get-week.md @@ -2,7 +2,7 @@ title: polars get-week categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Gets week from date. usage: | diff --git a/commands/docs/polars_get-weekday.md b/commands/docs/polars_get-weekday.md index 08bfc2366b..0cd51c9bb6 100644 --- a/commands/docs/polars_get-weekday.md +++ b/commands/docs/polars_get-weekday.md @@ -2,7 +2,7 @@ title: polars get-weekday categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Gets weekday from date. usage: | diff --git a/commands/docs/polars_get-year.md b/commands/docs/polars_get-year.md index c7db47089f..7be5f375b6 100644 --- a/commands/docs/polars_get-year.md +++ b/commands/docs/polars_get-year.md @@ -2,7 +2,7 @@ title: polars get-year categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Gets year from date. usage: | diff --git a/commands/docs/polars_get.md b/commands/docs/polars_get.md index 41e92aa5a8..f286e31114 100644 --- a/commands/docs/polars_get.md +++ b/commands/docs/polars_get.md @@ -2,7 +2,7 @@ title: polars get categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Creates dataframe with the selected columns. usage: | diff --git a/commands/docs/polars_group-by.md b/commands/docs/polars_group-by.md index 161a7655d4..2827cffb38 100644 --- a/commands/docs/polars_group-by.md +++ b/commands/docs/polars_group-by.md @@ -2,7 +2,7 @@ title: polars group-by categories: | lazyframe -version: 0.100.0 +version: 0.101.0 lazyframe: | Creates a group-by object that can be used for other aggregations. usage: | diff --git a/commands/docs/polars_implode.md b/commands/docs/polars_implode.md index c5ab8a38fd..d6eb30d1f4 100644 --- a/commands/docs/polars_implode.md +++ b/commands/docs/polars_implode.md @@ -2,7 +2,7 @@ title: polars implode categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Aggregates values into a list. usage: | diff --git a/commands/docs/polars_integer.md b/commands/docs/polars_integer.md index 6f5624fe6e..5965943e8c 100644 --- a/commands/docs/polars_integer.md +++ b/commands/docs/polars_integer.md @@ -2,7 +2,7 @@ title: polars integer categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Converts a string column into a integer column usage: | diff --git a/commands/docs/polars_into-df.md b/commands/docs/polars_into-df.md index 7fc18e5bc6..d8ef326623 100644 --- a/commands/docs/polars_into-df.md +++ b/commands/docs/polars_into-df.md @@ -2,7 +2,7 @@ title: polars into-df categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Converts a list, table or record into a dataframe. usage: | diff --git a/commands/docs/polars_into-lazy.md b/commands/docs/polars_into-lazy.md index 2df2dbaf26..8e6fbacbbb 100644 --- a/commands/docs/polars_into-lazy.md +++ b/commands/docs/polars_into-lazy.md @@ -2,7 +2,7 @@ title: polars into-lazy categories: | lazyframe -version: 0.100.0 +version: 0.101.0 lazyframe: | Converts a dataframe into a lazy dataframe. usage: | diff --git a/commands/docs/polars_into-nu.md b/commands/docs/polars_into-nu.md index 0248a9eb84..17d512ec9d 100644 --- a/commands/docs/polars_into-nu.md +++ b/commands/docs/polars_into-nu.md @@ -2,7 +2,7 @@ title: polars into-nu categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Converts a dataframe or an expression into nushell value for access and exploration. usage: | diff --git a/commands/docs/polars_is-duplicated.md b/commands/docs/polars_is-duplicated.md index 24537dbba2..38bfd61506 100644 --- a/commands/docs/polars_is-duplicated.md +++ b/commands/docs/polars_is-duplicated.md @@ -2,7 +2,7 @@ title: polars is-duplicated categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Creates mask indicating duplicated values. usage: | diff --git a/commands/docs/polars_is-in.md b/commands/docs/polars_is-in.md index 09383f3346..4d93fa9f2d 100644 --- a/commands/docs/polars_is-in.md +++ b/commands/docs/polars_is-in.md @@ -2,7 +2,7 @@ title: polars is-in categories: | expression -version: 0.100.0 +version: 0.101.0 expression: | Creates an is-in expression or checks to see if the elements are contained in the right series usage: | diff --git a/commands/docs/polars_is-not-null.md b/commands/docs/polars_is-not-null.md index d2b751c817..25e70891a6 100644 --- a/commands/docs/polars_is-not-null.md +++ b/commands/docs/polars_is-not-null.md @@ -2,7 +2,7 @@ title: polars is-not-null categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Creates mask where value is not null. usage: | diff --git a/commands/docs/polars_is-null.md b/commands/docs/polars_is-null.md index cbde451b40..d6cc5be2b1 100644 --- a/commands/docs/polars_is-null.md +++ b/commands/docs/polars_is-null.md @@ -2,7 +2,7 @@ title: polars is-null categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Creates mask where value is null. usage: | diff --git a/commands/docs/polars_is-unique.md b/commands/docs/polars_is-unique.md index 4018f36ec8..0d85c1b32d 100644 --- a/commands/docs/polars_is-unique.md +++ b/commands/docs/polars_is-unique.md @@ -2,7 +2,7 @@ title: polars is-unique categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Creates mask indicating unique values. usage: | diff --git a/commands/docs/polars_join.md b/commands/docs/polars_join.md index c0f677b9ac..53d3a75a1b 100644 --- a/commands/docs/polars_join.md +++ b/commands/docs/polars_join.md @@ -2,7 +2,7 @@ title: polars join categories: | lazyframe -version: 0.100.0 +version: 0.101.0 lazyframe: | Joins a lazy frame with other lazy frame. usage: | @@ -31,6 +31,7 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. - `--left, -l`: left join between lazyframes - `--full, -f`: full join between lazyframes - `--cross, -c`: cross join between lazyframes + - `--coalesce-columns`: Sets the join coalesce strategy to colesce columns. Most useful when used with --full, which will not otherwise coalesce. - `--suffix, -s {string}`: Suffix to use on columns with same name ## Parameters @@ -50,8 +51,8 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. Join two lazy dataframes ```nu -> let df_a = ([[a b c];[1 "a" 0] [2 "b" 1] [1 "c" 2] [1 "c" 3]] | polars into-lazy); - let df_b = ([["foo" "bar" "ham"];[1 "a" "let"] [2 "c" "var"] [3 "c" "const"]] | polars into-lazy); +> let df_a = ([[a b c];[1 "a" 0] [2 "b" 1] [1 "c" 2] [1 "c" 3]] | polars into-lazy) + let df_b = ([["foo" "bar" "ham"];[1 "a" "let"] [2 "c" "var"] [3 "c" "const"]] | polars into-lazy) $df_a | polars join $df_b a foo | polars collect ╭───┬───┬───┬───┬─────┬─────╮ │ # │ a │ b │ c │ bar │ ham │ @@ -66,8 +67,8 @@ Join two lazy dataframes Join one eager dataframe with a lazy dataframe ```nu -> let df_a = ([[a b c];[1 "a" 0] [2 "b" 1] [1 "c" 2] [1 "c" 3]] | polars into-df); - let df_b = ([["foo" "bar" "ham"];[1 "a" "let"] [2 "c" "var"] [3 "c" "const"]] | polars into-lazy); +> let df_a = ([[a b c];[1 "a" 0] [2 "b" 1] [1 "c" 2] [1 "c" 3]] | polars into-df) + let df_b = ([["foo" "bar" "ham"];[1 "a" "let"] [2 "c" "var"] [3 "c" "const"]] | polars into-lazy) $df_a | polars join $df_b a foo ╭───┬───┬───┬───┬─────┬─────╮ │ # │ a │ b │ c │ bar │ ham │ @@ -79,3 +80,36 @@ Join one eager dataframe with a lazy dataframe ╰───┴───┴───┴───┴─────┴─────╯ ``` + +Perform a full join of two dataframes and coalesce columns +```nu +> let table1 = [[A B]; ["common" "common"] ["table1" "only"]] | polars into-df + let table2 = [[A C]; ["common" "common"] ["table2" "only"]] | polars into-df + $table1 | polars join -f $table2 --coalesce-columns A A +╭───┬────────┬────────┬────────╮ +│ # │ A │ B │ C │ +├───┼────────┼────────┼────────┤ +│ 0 │ common │ common │ common │ +│ 1 │ table2 │ │ only │ +│ 2 │ table1 │ only │ │ +╰───┴────────┴────────┴────────╯ + +``` + +Join one eager dataframe with another using a cross join +```nu +> let tokens = [[monopoly_token]; [hat] [shoe] [boat]] | polars into-df + let players = [[name, cash]; [Alice, 78] [Bob, 135]] | polars into-df + $players | polars select (polars col name) | polars join --cross $tokens | polars collect +╭───┬───────┬────────────────╮ +│ # │ name │ monopoly_token │ +├───┼───────┼────────────────┤ +│ 0 │ Alice │ hat │ +│ 1 │ Alice │ shoe │ +│ 2 │ Alice │ boat │ +│ 3 │ Bob │ hat │ +│ 4 │ Bob │ shoe │ +│ 5 │ Bob │ boat │ +╰───┴───────┴────────────────╯ + +``` diff --git a/commands/docs/polars_last.md b/commands/docs/polars_last.md index 465b4d3676..cd0e948380 100644 --- a/commands/docs/polars_last.md +++ b/commands/docs/polars_last.md @@ -2,7 +2,7 @@ title: polars last categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Creates new dataframe with tail rows or creates a last expression. usage: | diff --git a/commands/docs/polars_len.md b/commands/docs/polars_len.md index 3c1dbe5221..e499b577ba 100644 --- a/commands/docs/polars_len.md +++ b/commands/docs/polars_len.md @@ -2,7 +2,7 @@ title: polars len categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Return the number of rows in the context. This is similar to COUNT(*) in SQL. usage: | diff --git a/commands/docs/polars_lit.md b/commands/docs/polars_lit.md index 53d2341004..a5b2efa327 100644 --- a/commands/docs/polars_lit.md +++ b/commands/docs/polars_lit.md @@ -2,7 +2,7 @@ title: polars lit categories: | expression -version: 0.100.0 +version: 0.101.0 expression: | Creates a literal expression. usage: | diff --git a/commands/docs/polars_lowercase.md b/commands/docs/polars_lowercase.md index 50a0978065..a7e34bbe85 100644 --- a/commands/docs/polars_lowercase.md +++ b/commands/docs/polars_lowercase.md @@ -2,7 +2,7 @@ title: polars lowercase categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Lowercase the strings in the column. usage: | diff --git a/commands/docs/polars_max.md b/commands/docs/polars_max.md index 93fe80f56b..1417f1af1d 100644 --- a/commands/docs/polars_max.md +++ b/commands/docs/polars_max.md @@ -2,7 +2,7 @@ title: polars max categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Creates a max expression or aggregates columns to their max value. usage: | diff --git a/commands/docs/polars_mean.md b/commands/docs/polars_mean.md index 9ab16bc825..7777a7e5e9 100644 --- a/commands/docs/polars_mean.md +++ b/commands/docs/polars_mean.md @@ -2,7 +2,7 @@ title: polars mean categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Creates a mean expression for an aggregation or aggregates columns to their mean value. usage: | diff --git a/commands/docs/polars_median.md b/commands/docs/polars_median.md index 40c888d279..cf1e9e8ae5 100644 --- a/commands/docs/polars_median.md +++ b/commands/docs/polars_median.md @@ -2,7 +2,7 @@ title: polars median categories: | lazyframe -version: 0.100.0 +version: 0.101.0 lazyframe: | Median value from columns in a dataframe or creates expression for an aggregation usage: | diff --git a/commands/docs/polars_min.md b/commands/docs/polars_min.md index aeb249899f..e33618c360 100644 --- a/commands/docs/polars_min.md +++ b/commands/docs/polars_min.md @@ -2,7 +2,7 @@ title: polars min categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Creates a min expression or aggregates columns to their min value. usage: | diff --git a/commands/docs/polars_n-unique.md b/commands/docs/polars_n-unique.md index 54587910a5..103c98efa9 100644 --- a/commands/docs/polars_n-unique.md +++ b/commands/docs/polars_n-unique.md @@ -2,7 +2,7 @@ title: polars n-unique categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Counts unique values. usage: | diff --git a/commands/docs/polars_not.md b/commands/docs/polars_not.md index 11f1dd4691..37b334db5d 100644 --- a/commands/docs/polars_not.md +++ b/commands/docs/polars_not.md @@ -2,7 +2,7 @@ title: polars not categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Inverts boolean mask. usage: | diff --git a/commands/docs/polars_open.md b/commands/docs/polars_open.md index a1c91ccb3e..f12ebefe17 100644 --- a/commands/docs/polars_open.md +++ b/commands/docs/polars_open.md @@ -2,7 +2,7 @@ title: polars open categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Opens CSV, JSON, NDJSON/JSON lines, arrow, avro, or parquet file to create dataframe. A lazy dataframe will be created by default, if supported. usage: | diff --git a/commands/docs/polars_otherwise.md b/commands/docs/polars_otherwise.md index f307dec58a..a73e3a7613 100644 --- a/commands/docs/polars_otherwise.md +++ b/commands/docs/polars_otherwise.md @@ -2,7 +2,7 @@ title: polars otherwise categories: | expression -version: 0.100.0 +version: 0.101.0 expression: | Completes a when expression. usage: | diff --git a/commands/docs/polars_pivot.md b/commands/docs/polars_pivot.md index d9ebda6800..8ca0cf7f2e 100644 --- a/commands/docs/polars_pivot.md +++ b/commands/docs/polars_pivot.md @@ -2,7 +2,7 @@ title: polars pivot categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Pivot a DataFrame from wide to long format. usage: | diff --git a/commands/docs/polars_profile.md b/commands/docs/polars_profile.md index b61581f73d..376be92553 100644 --- a/commands/docs/polars_profile.md +++ b/commands/docs/polars_profile.md @@ -2,21 +2,17 @@ title: polars profile categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | - Profile a lazy dataframe. This will run the query and return a record containing the materialized DataFrame and a DataFrame that contains profiling information of each node that is executed. - - The units of the timings are microseconds. + Profile a lazy dataframe. usage: | - Profile a lazy dataframe. This will run the query and return a record containing the materialized DataFrame and a DataFrame that contains profiling information of each node that is executed. - - The units of the timings are microseconds. + Profile a lazy dataframe. --- # `polars profile` for [dataframe](/commands/categories/dataframe.md) -
Profile a lazy dataframe. This will run the query and return a record containing the materialized DataFrame and a DataFrame that contains profiling information of each node that is executed.

The units of the timings are microseconds.
+
Profile a lazy dataframe.
::: warning This command requires a plugin The `polars profile` command resides in the `polars` plugin. @@ -52,3 +48,8 @@ Profile a lazy dataframe ``` + +## Notes +This will run the query and return a record containing the materialized DataFrame and a DataFrame that contains profiling information of each node that is executed. + +The units of the timings are microseconds. \ No newline at end of file diff --git a/commands/docs/polars_quantile.md b/commands/docs/polars_quantile.md index 6529d12257..c0d83ef873 100644 --- a/commands/docs/polars_quantile.md +++ b/commands/docs/polars_quantile.md @@ -2,7 +2,7 @@ title: polars quantile categories: | lazyframe -version: 0.100.0 +version: 0.101.0 lazyframe: | Aggregates the columns to the selected quantile. usage: | diff --git a/commands/docs/polars_query.md b/commands/docs/polars_query.md index 61395a89e1..fea3f54820 100644 --- a/commands/docs/polars_query.md +++ b/commands/docs/polars_query.md @@ -2,7 +2,7 @@ title: polars query categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Query dataframe using SQL. Note: The dataframe is always named 'df' in your query's from clause. usage: | diff --git a/commands/docs/polars_rename.md b/commands/docs/polars_rename.md index 606661ef42..5fadc1c599 100644 --- a/commands/docs/polars_rename.md +++ b/commands/docs/polars_rename.md @@ -2,7 +2,7 @@ title: polars rename categories: | dataframe or lazyframe -version: 0.100.0 +version: 0.101.0 dataframe_or_lazyframe: | Rename a dataframe column. usage: | diff --git a/commands/docs/polars_replace-all.md b/commands/docs/polars_replace-all.md index 0e4b2170ba..5f0e43dc04 100644 --- a/commands/docs/polars_replace-all.md +++ b/commands/docs/polars_replace-all.md @@ -2,7 +2,7 @@ title: polars replace-all categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Replace all (sub)strings by a regex pattern. usage: | diff --git a/commands/docs/polars_replace.md b/commands/docs/polars_replace.md index 34af6f802d..5c79c4d46a 100644 --- a/commands/docs/polars_replace.md +++ b/commands/docs/polars_replace.md @@ -2,7 +2,7 @@ title: polars replace categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Replace the leftmost (sub)string by a regex pattern. usage: | diff --git a/commands/docs/polars_reverse.md b/commands/docs/polars_reverse.md index 7cb707baa8..1261d5e65f 100644 --- a/commands/docs/polars_reverse.md +++ b/commands/docs/polars_reverse.md @@ -2,7 +2,7 @@ title: polars reverse categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Reverses the LazyFrame usage: | diff --git a/commands/docs/polars_rolling.md b/commands/docs/polars_rolling.md index 9bc58aeac4..66ac2b95f6 100644 --- a/commands/docs/polars_rolling.md +++ b/commands/docs/polars_rolling.md @@ -2,7 +2,7 @@ title: polars rolling categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Rolling calculation for a series. usage: | diff --git a/commands/docs/polars_sample.md b/commands/docs/polars_sample.md index 0526a7d606..576413320d 100644 --- a/commands/docs/polars_sample.md +++ b/commands/docs/polars_sample.md @@ -2,7 +2,7 @@ title: polars sample categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Create sample dataframe. usage: | diff --git a/commands/docs/polars_save.md b/commands/docs/polars_save.md index 15a60e0d7e..0e49ca6bf3 100644 --- a/commands/docs/polars_save.md +++ b/commands/docs/polars_save.md @@ -2,7 +2,7 @@ title: polars save categories: | lazyframe -version: 0.100.0 +version: 0.101.0 lazyframe: | Saves a dataframe to disk. For lazy dataframes a sink operation will be used if the file type supports it (parquet, ipc/arrow, csv, and ndjson). usage: | diff --git a/commands/docs/polars_schema.md b/commands/docs/polars_schema.md index 99e729c9d7..10b79a2b64 100644 --- a/commands/docs/polars_schema.md +++ b/commands/docs/polars_schema.md @@ -2,7 +2,7 @@ title: polars schema categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Show schema for a dataframe. usage: | diff --git a/commands/docs/polars_select.md b/commands/docs/polars_select.md index 4370d39f23..520c24ad09 100644 --- a/commands/docs/polars_select.md +++ b/commands/docs/polars_select.md @@ -2,7 +2,7 @@ title: polars select categories: | lazyframe -version: 0.100.0 +version: 0.101.0 lazyframe: | Selects columns from lazyframe. usage: | diff --git a/commands/docs/polars_set-with-idx.md b/commands/docs/polars_set-with-idx.md index 7c5cb94d8b..dd23f57a5f 100644 --- a/commands/docs/polars_set-with-idx.md +++ b/commands/docs/polars_set-with-idx.md @@ -2,7 +2,7 @@ title: polars set-with-idx categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Sets value in the given index. usage: | diff --git a/commands/docs/polars_set.md b/commands/docs/polars_set.md index 859a2fd844..502465cf5d 100644 --- a/commands/docs/polars_set.md +++ b/commands/docs/polars_set.md @@ -2,7 +2,7 @@ title: polars set categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Sets value where given mask is true. usage: | diff --git a/commands/docs/polars_shape.md b/commands/docs/polars_shape.md index 7e3716f60f..0180a8754c 100644 --- a/commands/docs/polars_shape.md +++ b/commands/docs/polars_shape.md @@ -2,7 +2,7 @@ title: polars shape categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Shows column and row size for a dataframe. usage: | diff --git a/commands/docs/polars_shift.md b/commands/docs/polars_shift.md index b4b20042ab..136fc7e65d 100644 --- a/commands/docs/polars_shift.md +++ b/commands/docs/polars_shift.md @@ -2,7 +2,7 @@ title: polars shift categories: | dataframe or lazyframe -version: 0.100.0 +version: 0.101.0 dataframe_or_lazyframe: | Shifts the values by a given period. usage: | diff --git a/commands/docs/polars_slice.md b/commands/docs/polars_slice.md index 6b2b2e655d..cb36768308 100644 --- a/commands/docs/polars_slice.md +++ b/commands/docs/polars_slice.md @@ -2,7 +2,7 @@ title: polars slice categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Creates new dataframe from a slice of rows. usage: | diff --git a/commands/docs/polars_sort-by.md b/commands/docs/polars_sort-by.md index 4af0a35e10..4d6cbcf610 100644 --- a/commands/docs/polars_sort-by.md +++ b/commands/docs/polars_sort-by.md @@ -2,7 +2,7 @@ title: polars sort-by categories: | lazyframe -version: 0.100.0 +version: 0.101.0 lazyframe: | Sorts a lazy dataframe based on expression(s). usage: | diff --git a/commands/docs/polars_std.md b/commands/docs/polars_std.md index 58872ede9b..0ad4ca504d 100644 --- a/commands/docs/polars_std.md +++ b/commands/docs/polars_std.md @@ -2,7 +2,7 @@ title: polars std categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Creates a std expression for an aggregation of std value from columns in a dataframe. usage: | diff --git a/commands/docs/polars_store-get.md b/commands/docs/polars_store-get.md index 1c24308980..a94f12850c 100644 --- a/commands/docs/polars_store-get.md +++ b/commands/docs/polars_store-get.md @@ -2,7 +2,7 @@ title: polars store-get categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Gets a Dataframe or other object from the plugin cache. usage: | diff --git a/commands/docs/polars_store-ls.md b/commands/docs/polars_store-ls.md index 0f208288bb..d190810b6e 100644 --- a/commands/docs/polars_store-ls.md +++ b/commands/docs/polars_store-ls.md @@ -2,7 +2,7 @@ title: polars store-ls categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Lists stored polars objects. usage: | diff --git a/commands/docs/polars_store-rm.md b/commands/docs/polars_store-rm.md index ba6ad7f090..22b1e89511 100644 --- a/commands/docs/polars_store-rm.md +++ b/commands/docs/polars_store-rm.md @@ -2,7 +2,7 @@ title: polars store-rm categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Removes a stored Dataframe or other object from the plugin cache. usage: | diff --git a/commands/docs/polars_str-join.md b/commands/docs/polars_str-join.md index f7b119db1e..f495f64096 100644 --- a/commands/docs/polars_str-join.md +++ b/commands/docs/polars_str-join.md @@ -2,7 +2,7 @@ title: polars str-join categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Concatenates strings within a column or dataframes usage: | diff --git a/commands/docs/polars_str-lengths.md b/commands/docs/polars_str-lengths.md index 856e4dc0aa..78d1f6d03f 100644 --- a/commands/docs/polars_str-lengths.md +++ b/commands/docs/polars_str-lengths.md @@ -2,7 +2,7 @@ title: polars str-lengths categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Get lengths of all strings. usage: | diff --git a/commands/docs/polars_str-slice.md b/commands/docs/polars_str-slice.md index 310ef500af..50a8b7d377 100644 --- a/commands/docs/polars_str-slice.md +++ b/commands/docs/polars_str-slice.md @@ -2,7 +2,7 @@ title: polars str-slice categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Slices the string from the start position until the selected length. usage: | diff --git a/commands/docs/polars_strftime.md b/commands/docs/polars_strftime.md index f423ef664d..863e4cec6e 100644 --- a/commands/docs/polars_strftime.md +++ b/commands/docs/polars_strftime.md @@ -2,7 +2,7 @@ title: polars strftime categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Formats date based on string rule. usage: | diff --git a/commands/docs/polars_sum.md b/commands/docs/polars_sum.md index 449b8324b4..a596240143 100644 --- a/commands/docs/polars_sum.md +++ b/commands/docs/polars_sum.md @@ -2,7 +2,7 @@ title: polars sum categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Creates a sum expression for an aggregation or aggregates columns to their sum value. usage: | diff --git a/commands/docs/polars_summary.md b/commands/docs/polars_summary.md index 10630200a9..a3e7dc78e9 100644 --- a/commands/docs/polars_summary.md +++ b/commands/docs/polars_summary.md @@ -2,7 +2,7 @@ title: polars summary categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | For a dataframe, produces descriptive statistics (summary statistics) for its numeric columns. usage: | diff --git a/commands/docs/polars_take.md b/commands/docs/polars_take.md index 0a0e110e7a..53c455a220 100644 --- a/commands/docs/polars_take.md +++ b/commands/docs/polars_take.md @@ -2,7 +2,7 @@ title: polars take categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Creates new dataframe using the given indices. usage: | diff --git a/commands/docs/polars_unique.md b/commands/docs/polars_unique.md index 5aef050c42..ac496b9d59 100644 --- a/commands/docs/polars_unique.md +++ b/commands/docs/polars_unique.md @@ -2,7 +2,7 @@ title: polars unique categories: | dataframe or lazyframe -version: 0.100.0 +version: 0.101.0 dataframe_or_lazyframe: | Returns unique values from a dataframe. usage: | diff --git a/commands/docs/polars_unnest.md b/commands/docs/polars_unnest.md index 597317173f..8279feea26 100644 --- a/commands/docs/polars_unnest.md +++ b/commands/docs/polars_unnest.md @@ -2,7 +2,7 @@ title: polars unnest categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Decompose struct columns into separate columns for each of their fields. The new columns will be inserted into the dataframe at the location of the struct column. usage: | diff --git a/commands/docs/polars_unpivot.md b/commands/docs/polars_unpivot.md index 1deb948a2f..de6c4bce81 100644 --- a/commands/docs/polars_unpivot.md +++ b/commands/docs/polars_unpivot.md @@ -2,7 +2,7 @@ title: polars unpivot categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Unpivot a DataFrame from wide to long format. usage: | diff --git a/commands/docs/polars_uppercase.md b/commands/docs/polars_uppercase.md index 78d3eb10f4..bc9824824e 100644 --- a/commands/docs/polars_uppercase.md +++ b/commands/docs/polars_uppercase.md @@ -2,7 +2,7 @@ title: polars uppercase categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Uppercase the strings in the column. usage: | diff --git a/commands/docs/polars_value-counts.md b/commands/docs/polars_value-counts.md index 9a2481693a..c32a38ac15 100644 --- a/commands/docs/polars_value-counts.md +++ b/commands/docs/polars_value-counts.md @@ -2,7 +2,7 @@ title: polars value-counts categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Returns a dataframe with the counts for unique values in series. usage: | @@ -27,7 +27,7 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Flags - - `--column, -c {string}`: Provide a custom name for the coutn column + - `--column, -c {string}`: Provide a custom name for the count column - `--sort, -s`: Whether or not values should be sorted - `--parallel, -p`: Use multiple threads when processing - `--normalize, -n {string}`: Normalize the counts diff --git a/commands/docs/polars_var.md b/commands/docs/polars_var.md index 73fe57625a..ddf354747a 100644 --- a/commands/docs/polars_var.md +++ b/commands/docs/polars_var.md @@ -2,7 +2,7 @@ title: polars var categories: | dataframe -version: 0.100.0 +version: 0.101.0 dataframe: | Create a var expression for an aggregation. usage: | diff --git a/commands/docs/polars_when.md b/commands/docs/polars_when.md index 782bc9012e..59bd0215a7 100644 --- a/commands/docs/polars_when.md +++ b/commands/docs/polars_when.md @@ -2,7 +2,7 @@ title: polars when categories: | expression -version: 0.100.0 +version: 0.101.0 expression: | Creates and modifies a when expression. usage: | diff --git a/commands/docs/polars_with-column.md b/commands/docs/polars_with-column.md index d26c2410ed..b88e473c82 100644 --- a/commands/docs/polars_with-column.md +++ b/commands/docs/polars_with-column.md @@ -2,7 +2,7 @@ title: polars with-column categories: | dataframe or lazyframe -version: 0.100.0 +version: 0.101.0 dataframe_or_lazyframe: | Adds a series to the dataframe. usage: | @@ -27,7 +27,7 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Flags - - `--name, -n {string}`: new column name + - `--name, -n {string}`: New column name. For lazy dataframes and expressions syntax, use a `polars as` expression to name a column. ## Parameters diff --git a/commands/docs/port.md b/commands/docs/port.md index 442367affe..e9f35cf61d 100644 --- a/commands/docs/port.md +++ b/commands/docs/port.md @@ -2,7 +2,7 @@ title: port categories: | network -version: 0.100.0 +version: 0.101.0 network: | Get a free port from system. usage: | diff --git a/commands/docs/prepend.md b/commands/docs/prepend.md index c8673918b8..563ecb026b 100644 --- a/commands/docs/prepend.md +++ b/commands/docs/prepend.md @@ -2,7 +2,7 @@ title: prepend categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Prepend any number of rows to a table. usage: | diff --git a/commands/docs/print.md b/commands/docs/print.md index 61cd85608d..f9c5ddfefd 100644 --- a/commands/docs/print.md +++ b/commands/docs/print.md @@ -2,7 +2,7 @@ title: print categories: | strings -version: 0.100.0 +version: 0.101.0 strings: | Print the given values to stdout. usage: | diff --git a/commands/docs/ps.md b/commands/docs/ps.md index 81c3b37210..f189f664ea 100644 --- a/commands/docs/ps.md +++ b/commands/docs/ps.md @@ -2,7 +2,7 @@ title: ps categories: | system -version: 0.100.0 +version: 0.101.0 system: | View information about system processes. usage: | diff --git a/commands/docs/pwd.md b/commands/docs/pwd.md index 33de1c141d..0117a5bbed 100644 --- a/commands/docs/pwd.md +++ b/commands/docs/pwd.md @@ -2,7 +2,7 @@ title: pwd categories: | default -version: 0.100.0 +version: 0.101.0 default: | Return the current working directory usage: | diff --git a/commands/docs/query.md b/commands/docs/query.md index 3f1902a2b6..a8a983c999 100644 --- a/commands/docs/query.md +++ b/commands/docs/query.md @@ -2,7 +2,7 @@ title: query categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Show all the query commands usage: | diff --git a/commands/docs/query_db.md b/commands/docs/query_db.md index e77ae782f2..6ea35b9695 100644 --- a/commands/docs/query_db.md +++ b/commands/docs/query_db.md @@ -2,7 +2,7 @@ title: query db categories: | database -version: 0.100.0 +version: 0.101.0 database: | Query a database using SQL. usage: | diff --git a/commands/docs/query_json.md b/commands/docs/query_json.md index 7d0bb8a5d8..3b1c01ba55 100644 --- a/commands/docs/query_json.md +++ b/commands/docs/query_json.md @@ -2,7 +2,7 @@ title: query json categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | execute json query on json file (open --raw | query json 'query string') usage: | diff --git a/commands/docs/query_web.md b/commands/docs/query_web.md index 7f209becca..7cc00a2160 100644 --- a/commands/docs/query_web.md +++ b/commands/docs/query_web.md @@ -2,7 +2,7 @@ title: query web categories: | network -version: 0.100.0 +version: 0.101.0 network: | execute selector query on html/web usage: | diff --git a/commands/docs/query_webpage-info.md b/commands/docs/query_webpage-info.md index bbab3a2f3d..a6546531f6 100644 --- a/commands/docs/query_webpage-info.md +++ b/commands/docs/query_webpage-info.md @@ -2,7 +2,7 @@ title: query webpage-info categories: | network -version: 0.100.0 +version: 0.101.0 network: | uses the webpage crate to extract info from html: title, description, language, links, RSS feeds, Opengraph, Schema.org, and more usage: | diff --git a/commands/docs/query_xml.md b/commands/docs/query_xml.md index 338ccb8aa1..1500329440 100644 --- a/commands/docs/query_xml.md +++ b/commands/docs/query_xml.md @@ -2,7 +2,7 @@ title: query xml categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | execute xpath query on xml usage: | diff --git a/commands/docs/random.md b/commands/docs/random.md index 251ef29f0b..907db1d9a3 100644 --- a/commands/docs/random.md +++ b/commands/docs/random.md @@ -2,7 +2,7 @@ title: random categories: | random -version: 0.100.0 +version: 0.101.0 random: | Generate a random value. usage: | diff --git a/commands/docs/random_binary.md b/commands/docs/random_binary.md index 022bdb84d9..e0fb13fa3a 100644 --- a/commands/docs/random_binary.md +++ b/commands/docs/random_binary.md @@ -2,7 +2,7 @@ title: random binary categories: | random -version: 0.100.0 +version: 0.101.0 random: | Generate random bytes. usage: | diff --git a/commands/docs/random_bool.md b/commands/docs/random_bool.md index 9e0739872d..116119eb8a 100644 --- a/commands/docs/random_bool.md +++ b/commands/docs/random_bool.md @@ -2,7 +2,7 @@ title: random bool categories: | random -version: 0.100.0 +version: 0.101.0 random: | Generate a random boolean value. usage: | diff --git a/commands/docs/random_chars.md b/commands/docs/random_chars.md index 8aad5f9040..eac6d316bd 100644 --- a/commands/docs/random_chars.md +++ b/commands/docs/random_chars.md @@ -2,7 +2,7 @@ title: random chars categories: | random -version: 0.100.0 +version: 0.101.0 random: | Generate random chars uniformly distributed over ASCII letters and numbers: a-z, A-Z and 0-9. usage: | diff --git a/commands/docs/random_dice.md b/commands/docs/random_dice.md index fde9bfdb9d..61d5960edf 100644 --- a/commands/docs/random_dice.md +++ b/commands/docs/random_dice.md @@ -2,7 +2,7 @@ title: random dice categories: | random -version: 0.100.0 +version: 0.101.0 random: | Generate a random dice roll. usage: | @@ -28,7 +28,7 @@ usage: | | input | output | | ------- | --------- | -| nothing | list\ | +| nothing | list\ | ## Examples diff --git a/commands/docs/random_float.md b/commands/docs/random_float.md index 4f0127cd42..2f3c34b1d9 100644 --- a/commands/docs/random_float.md +++ b/commands/docs/random_float.md @@ -2,7 +2,7 @@ title: random float categories: | random -version: 0.100.0 +version: 0.101.0 random: | Generate a random float within a range [min..max]. usage: | diff --git a/commands/docs/random_int.md b/commands/docs/random_int.md index 0e0fa26dd7..b63edd8ded 100644 --- a/commands/docs/random_int.md +++ b/commands/docs/random_int.md @@ -2,7 +2,7 @@ title: random int categories: | random -version: 0.100.0 +version: 0.101.0 random: | Generate a random integer [min..max]. usage: | diff --git a/commands/docs/random_uuid.md b/commands/docs/random_uuid.md index ebe763362d..b485a784ea 100644 --- a/commands/docs/random_uuid.md +++ b/commands/docs/random_uuid.md @@ -2,7 +2,7 @@ title: random uuid categories: | random -version: 0.100.0 +version: 0.101.0 random: | Generate a random uuid4 string. usage: | diff --git a/commands/docs/range.md b/commands/docs/range.md index 395dcf04e7..d44b6db245 100644 --- a/commands/docs/range.md +++ b/commands/docs/range.md @@ -2,7 +2,7 @@ title: range categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Return only the selected rows. usage: | diff --git a/commands/docs/reduce.md b/commands/docs/reduce.md index b0bf42d489..5745e8e73c 100644 --- a/commands/docs/reduce.md +++ b/commands/docs/reduce.md @@ -2,7 +2,7 @@ title: reduce categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Aggregate a list (starting from the left) to a single value using an accumulator closure. usage: | @@ -83,3 +83,13 @@ Concatenate a string with itself, using a range to determine the number of times > let s = "Str"; 0..2 | reduce --fold '' {|it, acc| $acc + $s} StrStrStr ``` + +Merge multiple records together, making use of the fact that the accumulated value is also supplied as pipeline input to the closure. +```nu +> [{a: 1} {b: 2} {c: 3}] | reduce {|it| merge $it} +╭───┬───╮ +│ a │ 1 │ +│ b │ 2 │ +│ c │ 3 │ +╰───┴───╯ +``` diff --git a/commands/docs/registry_query.md b/commands/docs/registry_query.md index cfc0cdbd59..e339c8f927 100644 --- a/commands/docs/registry_query.md +++ b/commands/docs/registry_query.md @@ -2,7 +2,7 @@ title: registry query categories: | system -version: 0.100.0 +version: 0.101.0 system: | Query the Windows registry. usage: | diff --git a/commands/docs/reject.md b/commands/docs/reject.md index 92e4fb292c..1128b58a2a 100644 --- a/commands/docs/reject.md +++ b/commands/docs/reject.md @@ -2,7 +2,7 @@ title: reject categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Remove the given columns or rows from the table. Opposite of `select`. usage: | diff --git a/commands/docs/rename.md b/commands/docs/rename.md index 7019a269d8..d7f56e6d71 100644 --- a/commands/docs/rename.md +++ b/commands/docs/rename.md @@ -2,7 +2,7 @@ title: rename categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Creates a new table with columns renamed. usage: | diff --git a/commands/docs/return.md b/commands/docs/return.md index cbed26cfa5..44d8162839 100644 --- a/commands/docs/return.md +++ b/commands/docs/return.md @@ -2,7 +2,7 @@ title: return categories: | core -version: 0.100.0 +version: 0.101.0 core: | Return early from a function. usage: | diff --git a/commands/docs/reverse.md b/commands/docs/reverse.md index 3f36f57290..0a2947cc74 100644 --- a/commands/docs/reverse.md +++ b/commands/docs/reverse.md @@ -2,7 +2,7 @@ title: reverse categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Reverses the input list or table. usage: | diff --git a/commands/docs/rm.md b/commands/docs/rm.md index 09975704f6..f5efa27c08 100644 --- a/commands/docs/rm.md +++ b/commands/docs/rm.md @@ -2,7 +2,7 @@ title: rm categories: | filesystem -version: 0.100.0 +version: 0.101.0 filesystem: | Remove files and directories. usage: | diff --git a/commands/docs/roll.md b/commands/docs/roll.md index 8bb3258470..8313e251f3 100644 --- a/commands/docs/roll.md +++ b/commands/docs/roll.md @@ -2,7 +2,7 @@ title: roll categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Rolling commands for tables. usage: | diff --git a/commands/docs/roll_down.md b/commands/docs/roll_down.md index 1130684dc3..a67b7e822e 100644 --- a/commands/docs/roll_down.md +++ b/commands/docs/roll_down.md @@ -2,7 +2,7 @@ title: roll down categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Roll table rows down. usage: | diff --git a/commands/docs/roll_left.md b/commands/docs/roll_left.md index 3970800972..ba90ac43dc 100644 --- a/commands/docs/roll_left.md +++ b/commands/docs/roll_left.md @@ -2,7 +2,7 @@ title: roll left categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Roll record or table columns left. usage: | diff --git a/commands/docs/roll_right.md b/commands/docs/roll_right.md index 35f78cdde7..deb3cd3c74 100644 --- a/commands/docs/roll_right.md +++ b/commands/docs/roll_right.md @@ -2,7 +2,7 @@ title: roll right categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Roll table columns right. usage: | diff --git a/commands/docs/roll_up.md b/commands/docs/roll_up.md index 16bbba56a2..ff0c93cd1f 100644 --- a/commands/docs/roll_up.md +++ b/commands/docs/roll_up.md @@ -2,7 +2,7 @@ title: roll up categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Roll table rows up. usage: | diff --git a/commands/docs/rotate.md b/commands/docs/rotate.md index b394843f6f..d927521bb9 100644 --- a/commands/docs/rotate.md +++ b/commands/docs/rotate.md @@ -2,7 +2,7 @@ title: rotate categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Rotates a table or record clockwise (default) or counter-clockwise (use --ccw flag). usage: | diff --git a/commands/docs/run-external.md b/commands/docs/run-external.md index dc54b76463..ea38423d82 100644 --- a/commands/docs/run-external.md +++ b/commands/docs/run-external.md @@ -2,7 +2,7 @@ title: run-external categories: | system -version: 0.100.0 +version: 0.101.0 system: | Runs external command. usage: | diff --git a/commands/docs/save.md b/commands/docs/save.md index 23e568fa64..142c7b3990 100644 --- a/commands/docs/save.md +++ b/commands/docs/save.md @@ -2,7 +2,7 @@ title: save categories: | filesystem -version: 0.100.0 +version: 0.101.0 filesystem: | Save a file. usage: | diff --git a/commands/docs/schema.md b/commands/docs/schema.md index fb9d16817b..d83b66ac54 100644 --- a/commands/docs/schema.md +++ b/commands/docs/schema.md @@ -2,7 +2,7 @@ title: schema categories: | database -version: 0.100.0 +version: 0.101.0 database: | Show the schema of a SQLite database. usage: | diff --git a/commands/docs/scope.md b/commands/docs/scope.md index 6439507cc4..8029817b84 100644 --- a/commands/docs/scope.md +++ b/commands/docs/scope.md @@ -2,7 +2,7 @@ title: scope categories: | core -version: 0.100.0 +version: 0.101.0 core: | Commands for getting info about what is in scope. usage: | diff --git a/commands/docs/scope_aliases.md b/commands/docs/scope_aliases.md index 55857de885..a4f0f5f057 100644 --- a/commands/docs/scope_aliases.md +++ b/commands/docs/scope_aliases.md @@ -2,7 +2,7 @@ title: scope aliases categories: | core -version: 0.100.0 +version: 0.101.0 core: | Output info on the aliases in the current scope. usage: | diff --git a/commands/docs/scope_commands.md b/commands/docs/scope_commands.md index 387be508a4..67478e2952 100644 --- a/commands/docs/scope_commands.md +++ b/commands/docs/scope_commands.md @@ -2,7 +2,7 @@ title: scope commands categories: | core -version: 0.100.0 +version: 0.101.0 core: | Output info on the commands in the current scope. usage: | diff --git a/commands/docs/scope_engine-stats.md b/commands/docs/scope_engine-stats.md index e3d661f323..ed1fd382c1 100644 --- a/commands/docs/scope_engine-stats.md +++ b/commands/docs/scope_engine-stats.md @@ -2,7 +2,7 @@ title: scope engine-stats categories: | core -version: 0.100.0 +version: 0.101.0 core: | Output stats on the engine in the current state. usage: | diff --git a/commands/docs/scope_externs.md b/commands/docs/scope_externs.md index 252a4b8483..a5e0944065 100644 --- a/commands/docs/scope_externs.md +++ b/commands/docs/scope_externs.md @@ -2,7 +2,7 @@ title: scope externs categories: | core -version: 0.100.0 +version: 0.101.0 core: | Output info on the known externals in the current scope. usage: | diff --git a/commands/docs/scope_modules.md b/commands/docs/scope_modules.md index ed83439c70..0caa26b347 100644 --- a/commands/docs/scope_modules.md +++ b/commands/docs/scope_modules.md @@ -2,7 +2,7 @@ title: scope modules categories: | core -version: 0.100.0 +version: 0.101.0 core: | Output info on the modules in the current scope. usage: | diff --git a/commands/docs/scope_variables.md b/commands/docs/scope_variables.md index 07d2c2dd79..f83ef1c8ae 100644 --- a/commands/docs/scope_variables.md +++ b/commands/docs/scope_variables.md @@ -2,7 +2,7 @@ title: scope variables categories: | core -version: 0.100.0 +version: 0.101.0 core: | Output info on the variables in the current scope. usage: | diff --git a/commands/docs/select.md b/commands/docs/select.md index 16327b23b0..d3735f3400 100644 --- a/commands/docs/select.md +++ b/commands/docs/select.md @@ -2,7 +2,7 @@ title: select categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Select only these columns or rows from the input. Opposite of `reject`. usage: | diff --git a/commands/docs/seq.md b/commands/docs/seq.md index 52663886e8..299491e1e1 100644 --- a/commands/docs/seq.md +++ b/commands/docs/seq.md @@ -2,7 +2,7 @@ title: seq categories: | generators -version: 0.100.0 +version: 0.101.0 generators: | Output sequences of numbers. usage: | diff --git a/commands/docs/seq_char.md b/commands/docs/seq_char.md index ac056a8ff8..fe2cd6a971 100644 --- a/commands/docs/seq_char.md +++ b/commands/docs/seq_char.md @@ -2,7 +2,7 @@ title: seq char categories: | generators -version: 0.100.0 +version: 0.101.0 generators: | Print a sequence of ASCII characters. usage: | @@ -45,7 +45,7 @@ sequence a to e ``` -sequence a to e, and put the characters in a pipe-separated string +Sequence a to e, and join the characters with a pipe ```nu > seq char a e | str join '|' diff --git a/commands/docs/seq_date.md b/commands/docs/seq_date.md index 940e403ab0..6533db336c 100644 --- a/commands/docs/seq_date.md +++ b/commands/docs/seq_date.md @@ -2,7 +2,7 @@ title: seq date categories: | generators -version: 0.100.0 +version: 0.101.0 generators: | Print sequences of dates. usage: | diff --git a/commands/docs/shuffle.md b/commands/docs/shuffle.md index 1aca4876cc..649412f08b 100644 --- a/commands/docs/shuffle.md +++ b/commands/docs/shuffle.md @@ -2,7 +2,7 @@ title: shuffle categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Shuffle rows randomly. usage: | diff --git a/commands/docs/skip.md b/commands/docs/skip.md index 2716d35354..09475c7082 100644 --- a/commands/docs/skip.md +++ b/commands/docs/skip.md @@ -2,7 +2,7 @@ title: skip categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Skip the first several rows of the input. Counterpart of `drop`. Opposite of `first`. usage: | diff --git a/commands/docs/skip_until.md b/commands/docs/skip_until.md index 0d2cc8b8dd..79d39b754c 100644 --- a/commands/docs/skip_until.md +++ b/commands/docs/skip_until.md @@ -2,7 +2,7 @@ title: skip until categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Skip elements of the input until a predicate is true. usage: | diff --git a/commands/docs/skip_while.md b/commands/docs/skip_while.md index 70ed08cd2c..cb772bf392 100644 --- a/commands/docs/skip_while.md +++ b/commands/docs/skip_while.md @@ -2,7 +2,7 @@ title: skip while categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Skip elements of the input while a predicate is true. usage: | diff --git a/commands/docs/sleep.md b/commands/docs/sleep.md index 311d1d2b15..a1a1b1e821 100644 --- a/commands/docs/sleep.md +++ b/commands/docs/sleep.md @@ -2,7 +2,7 @@ title: sleep categories: | platform -version: 0.100.0 +version: 0.101.0 platform: | Delay for a specified amount of time. usage: | @@ -38,9 +38,9 @@ Sleep for 1sec ``` -Sleep for 3sec +Use multiple arguments to write a duration with multiple units, which is unsupported by duration literals ```nu -> sleep 1sec 1sec 1sec +> sleep 1min 30sec ``` diff --git a/commands/docs/sort-by.md b/commands/docs/sort-by.md index 67c3d2640d..fccc974b16 100644 --- a/commands/docs/sort-by.md +++ b/commands/docs/sort-by.md @@ -2,7 +2,7 @@ title: sort-by categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Sort by the given cell path or closure. usage: | diff --git a/commands/docs/sort.md b/commands/docs/sort.md index 4054ae3188..75a6fa1349 100644 --- a/commands/docs/sort.md +++ b/commands/docs/sort.md @@ -2,7 +2,7 @@ title: sort categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Sort in increasing order. usage: | diff --git a/commands/docs/source-env.md b/commands/docs/source-env.md index 93d15a4a22..04f60554e3 100644 --- a/commands/docs/source-env.md +++ b/commands/docs/source-env.md @@ -2,7 +2,7 @@ title: source-env categories: | core -version: 0.100.0 +version: 0.101.0 core: | Source the environment from a source file into the current environment. usage: | diff --git a/commands/docs/source.md b/commands/docs/source.md index 720375e9fa..e44d26f968 100644 --- a/commands/docs/source.md +++ b/commands/docs/source.md @@ -2,7 +2,7 @@ title: source categories: | core -version: 0.100.0 +version: 0.101.0 core: | Runs a script file in the current context. usage: | diff --git a/commands/docs/split-by.md b/commands/docs/split-by.md index 8d971ec694..6a8802cce2 100644 --- a/commands/docs/split-by.md +++ b/commands/docs/split-by.md @@ -1,16 +1,16 @@ --- title: split-by categories: | - filters -version: 0.100.0 -filters: | + deprecated +version: 0.101.0 +deprecated: | Split a record into groups. usage: | Split a record into groups. --- -# `split-by` for [filters](/commands/categories/filters.md) +# `split-by` for [deprecated](/commands/categories/deprecated.md)
Split a record into groups.
diff --git a/commands/docs/split.md b/commands/docs/split.md index 1910d7ccc2..b8d1db049c 100644 --- a/commands/docs/split.md +++ b/commands/docs/split.md @@ -2,7 +2,7 @@ title: split categories: | strings -version: 0.100.0 +version: 0.101.0 strings: | Split contents across desired subcommand (like row, column) via the separator. usage: | diff --git a/commands/docs/split_cell-path.md b/commands/docs/split_cell-path.md index 606dd76828..f34182a126 100644 --- a/commands/docs/split_cell-path.md +++ b/commands/docs/split_cell-path.md @@ -2,7 +2,7 @@ title: split cell-path categories: | conversions -version: 0.100.0 +version: 0.101.0 conversions: | Split a cell-path into its components. usage: | diff --git a/commands/docs/split_chars.md b/commands/docs/split_chars.md index 2fea6dc087..82483272c2 100644 --- a/commands/docs/split_chars.md +++ b/commands/docs/split_chars.md @@ -2,7 +2,7 @@ title: split chars categories: | strings -version: 0.100.0 +version: 0.101.0 strings: | Split a string into a list of characters. usage: | diff --git a/commands/docs/split_column.md b/commands/docs/split_column.md index 9d2a0d17e9..58a943aa3e 100644 --- a/commands/docs/split_column.md +++ b/commands/docs/split_column.md @@ -2,7 +2,7 @@ title: split column categories: | strings -version: 0.100.0 +version: 0.101.0 strings: | Split a string into multiple columns using a separator. usage: | diff --git a/commands/docs/split_list.md b/commands/docs/split_list.md index fa7a4eaa12..a474e6d778 100644 --- a/commands/docs/split_list.md +++ b/commands/docs/split_list.md @@ -2,7 +2,7 @@ title: split list categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Split a list into multiple lists using a separator. usage: | diff --git a/commands/docs/split_row.md b/commands/docs/split_row.md index d47cdfdd8c..25e2304282 100644 --- a/commands/docs/split_row.md +++ b/commands/docs/split_row.md @@ -2,7 +2,7 @@ title: split row categories: | strings -version: 0.100.0 +version: 0.101.0 strings: | Split a string into multiple rows using a separator. usage: | diff --git a/commands/docs/split_words.md b/commands/docs/split_words.md index 0ec8198d8c..bb63a6f485 100644 --- a/commands/docs/split_words.md +++ b/commands/docs/split_words.md @@ -2,7 +2,7 @@ title: split words categories: | strings -version: 0.100.0 +version: 0.101.0 strings: | Split a string's words into separate rows. usage: | diff --git a/commands/docs/start.md b/commands/docs/start.md index 15d313020c..e04d2097e3 100644 --- a/commands/docs/start.md +++ b/commands/docs/start.md @@ -2,7 +2,7 @@ title: start categories: | filesystem -version: 0.100.0 +version: 0.101.0 filesystem: | Open a folder, file or website in the default application or viewer. usage: | diff --git a/commands/docs/stor.md b/commands/docs/stor.md index 0546af06f2..14a0a80d53 100644 --- a/commands/docs/stor.md +++ b/commands/docs/stor.md @@ -2,7 +2,7 @@ title: stor categories: | database -version: 0.100.0 +version: 0.101.0 database: | Various commands for working with the in-memory sqlite database. usage: | diff --git a/commands/docs/stor_create.md b/commands/docs/stor_create.md index d2a07161a9..868decbd51 100644 --- a/commands/docs/stor_create.md +++ b/commands/docs/stor_create.md @@ -2,7 +2,7 @@ title: stor create categories: | database -version: 0.100.0 +version: 0.101.0 database: | Create a table in the in-memory sqlite database. usage: | diff --git a/commands/docs/stor_delete.md b/commands/docs/stor_delete.md index ac036b8afb..4b428987c7 100644 --- a/commands/docs/stor_delete.md +++ b/commands/docs/stor_delete.md @@ -2,7 +2,7 @@ title: stor delete categories: | database -version: 0.100.0 +version: 0.101.0 database: | Delete a table or specified rows in the in-memory sqlite database. usage: | diff --git a/commands/docs/stor_export.md b/commands/docs/stor_export.md index 6b12a1f401..9f44b44a85 100644 --- a/commands/docs/stor_export.md +++ b/commands/docs/stor_export.md @@ -2,7 +2,7 @@ title: stor export categories: | database -version: 0.100.0 +version: 0.101.0 database: | Export the in-memory sqlite database to a sqlite database file. usage: | diff --git a/commands/docs/stor_import.md b/commands/docs/stor_import.md index 8587ce6be0..5030ffe6c8 100644 --- a/commands/docs/stor_import.md +++ b/commands/docs/stor_import.md @@ -2,7 +2,7 @@ title: stor import categories: | database -version: 0.100.0 +version: 0.101.0 database: | Import a sqlite database file into the in-memory sqlite database. usage: | diff --git a/commands/docs/stor_insert.md b/commands/docs/stor_insert.md index 4af7f436b6..45c38a233f 100644 --- a/commands/docs/stor_insert.md +++ b/commands/docs/stor_insert.md @@ -2,7 +2,7 @@ title: stor insert categories: | database -version: 0.100.0 +version: 0.101.0 database: | Insert information into a specified table in the in-memory sqlite database. usage: | diff --git a/commands/docs/stor_open.md b/commands/docs/stor_open.md index 5e8eb420ad..2d618311f6 100644 --- a/commands/docs/stor_open.md +++ b/commands/docs/stor_open.md @@ -2,7 +2,7 @@ title: stor open categories: | database -version: 0.100.0 +version: 0.101.0 database: | Opens the in-memory sqlite database. usage: | diff --git a/commands/docs/stor_reset.md b/commands/docs/stor_reset.md index a2b2f8ed76..6b81e8b3dc 100644 --- a/commands/docs/stor_reset.md +++ b/commands/docs/stor_reset.md @@ -2,7 +2,7 @@ title: stor reset categories: | database -version: 0.100.0 +version: 0.101.0 database: | Reset the in-memory database by dropping all tables. usage: | diff --git a/commands/docs/stor_update.md b/commands/docs/stor_update.md index 626127f1f4..0ca45e3270 100644 --- a/commands/docs/stor_update.md +++ b/commands/docs/stor_update.md @@ -2,7 +2,7 @@ title: stor update categories: | database -version: 0.100.0 +version: 0.101.0 database: | Update information in a specified table in the in-memory sqlite database. usage: | diff --git a/commands/docs/str.md b/commands/docs/str.md index bbd8b4263b..245f383ff4 100644 --- a/commands/docs/str.md +++ b/commands/docs/str.md @@ -2,7 +2,7 @@ title: str categories: | strings -version: 0.100.0 +version: 0.101.0 strings: | Various commands for working with string data. usage: | diff --git a/commands/docs/str_camel-case.md b/commands/docs/str_camel-case.md index 83375b4dd6..a2d1f770f3 100644 --- a/commands/docs/str_camel-case.md +++ b/commands/docs/str_camel-case.md @@ -2,7 +2,7 @@ title: str camel-case categories: | strings -version: 0.100.0 +version: 0.101.0 strings: | Convert a string to camelCase. usage: | diff --git a/commands/docs/str_capitalize.md b/commands/docs/str_capitalize.md index 2fd369d500..d1dc1e0fc8 100644 --- a/commands/docs/str_capitalize.md +++ b/commands/docs/str_capitalize.md @@ -2,7 +2,7 @@ title: str capitalize categories: | strings -version: 0.100.0 +version: 0.101.0 strings: | Capitalize first letter of text. usage: | diff --git a/commands/docs/str_contains.md b/commands/docs/str_contains.md index 2fb1a076d2..8b7f5c79eb 100644 --- a/commands/docs/str_contains.md +++ b/commands/docs/str_contains.md @@ -2,7 +2,7 @@ title: str contains categories: | strings -version: 0.100.0 +version: 0.101.0 strings: | Checks if string input contains a substring. usage: | diff --git a/commands/docs/str_distance.md b/commands/docs/str_distance.md index 2105eea2b8..71b65b93e2 100644 --- a/commands/docs/str_distance.md +++ b/commands/docs/str_distance.md @@ -2,7 +2,7 @@ title: str distance categories: | strings -version: 0.100.0 +version: 0.101.0 strings: | Compare two strings and return the edit distance/Levenshtein distance. usage: | diff --git a/commands/docs/str_downcase.md b/commands/docs/str_downcase.md index fd208bfc12..88671d2c3f 100644 --- a/commands/docs/str_downcase.md +++ b/commands/docs/str_downcase.md @@ -2,7 +2,7 @@ title: str downcase categories: | strings -version: 0.100.0 +version: 0.101.0 strings: | Make text lowercase. usage: | diff --git a/commands/docs/str_ends-with.md b/commands/docs/str_ends-with.md index 6f4785f9ff..5ea033ba43 100644 --- a/commands/docs/str_ends-with.md +++ b/commands/docs/str_ends-with.md @@ -2,7 +2,7 @@ title: str ends-with categories: | strings -version: 0.100.0 +version: 0.101.0 strings: | Check if an input ends with a string. usage: | diff --git a/commands/docs/str_expand.md b/commands/docs/str_expand.md index 7ca9115540..ebacccfc59 100644 --- a/commands/docs/str_expand.md +++ b/commands/docs/str_expand.md @@ -2,7 +2,7 @@ title: str expand categories: | strings -version: 0.100.0 +version: 0.101.0 strings: | Generates all possible combinations defined in brace expansion syntax. usage: | diff --git a/commands/docs/str_index-of.md b/commands/docs/str_index-of.md index 359824e207..1c01f6a5ac 100644 --- a/commands/docs/str_index-of.md +++ b/commands/docs/str_index-of.md @@ -2,7 +2,7 @@ title: str index-of categories: | strings -version: 0.100.0 +version: 0.101.0 strings: | Returns start index of first occurrence of string in input, or -1 if no match. usage: | diff --git a/commands/docs/str_join.md b/commands/docs/str_join.md index ad4f80cd91..5514657111 100644 --- a/commands/docs/str_join.md +++ b/commands/docs/str_join.md @@ -2,7 +2,7 @@ title: str join categories: | strings -version: 0.100.0 +version: 0.101.0 strings: | Concatenate multiple strings into a single string, with an optional separator between each. usage: | diff --git a/commands/docs/str_kebab-case.md b/commands/docs/str_kebab-case.md index 277c557298..ac4ffc694c 100644 --- a/commands/docs/str_kebab-case.md +++ b/commands/docs/str_kebab-case.md @@ -2,7 +2,7 @@ title: str kebab-case categories: | strings -version: 0.100.0 +version: 0.101.0 strings: | Convert a string to kebab-case. usage: | diff --git a/commands/docs/str_length.md b/commands/docs/str_length.md index e6689145bf..a126bbae21 100644 --- a/commands/docs/str_length.md +++ b/commands/docs/str_length.md @@ -2,7 +2,7 @@ title: str length categories: | strings -version: 0.100.0 +version: 0.101.0 strings: | Output the length of any strings in the pipeline. usage: | diff --git a/commands/docs/str_pascal-case.md b/commands/docs/str_pascal-case.md index 7db341bfe0..f27d428e94 100644 --- a/commands/docs/str_pascal-case.md +++ b/commands/docs/str_pascal-case.md @@ -2,7 +2,7 @@ title: str pascal-case categories: | strings -version: 0.100.0 +version: 0.101.0 strings: | Convert a string to PascalCase. usage: | diff --git a/commands/docs/str_replace.md b/commands/docs/str_replace.md index c608779a86..e9edba82a2 100644 --- a/commands/docs/str_replace.md +++ b/commands/docs/str_replace.md @@ -2,7 +2,7 @@ title: str replace categories: | strings -version: 0.100.0 +version: 0.101.0 strings: | Find and replace text. usage: | diff --git a/commands/docs/str_reverse.md b/commands/docs/str_reverse.md index d61a3a6717..5a7f410a0a 100644 --- a/commands/docs/str_reverse.md +++ b/commands/docs/str_reverse.md @@ -2,7 +2,7 @@ title: str reverse categories: | strings -version: 0.100.0 +version: 0.101.0 strings: | Reverse every string in the pipeline. usage: | diff --git a/commands/docs/str_screaming-snake-case.md b/commands/docs/str_screaming-snake-case.md index 8f48259951..9d4646bd89 100644 --- a/commands/docs/str_screaming-snake-case.md +++ b/commands/docs/str_screaming-snake-case.md @@ -2,7 +2,7 @@ title: str screaming-snake-case categories: | strings -version: 0.100.0 +version: 0.101.0 strings: | Convert a string to SCREAMING_SNAKE_CASE. usage: | diff --git a/commands/docs/str_snake-case.md b/commands/docs/str_snake-case.md index 6708ac1943..70407e00d3 100644 --- a/commands/docs/str_snake-case.md +++ b/commands/docs/str_snake-case.md @@ -2,7 +2,7 @@ title: str snake-case categories: | strings -version: 0.100.0 +version: 0.101.0 strings: | Convert a string to snake_case. usage: | diff --git a/commands/docs/str_starts-with.md b/commands/docs/str_starts-with.md index cbc675c4ae..a49e53aa8d 100644 --- a/commands/docs/str_starts-with.md +++ b/commands/docs/str_starts-with.md @@ -2,7 +2,7 @@ title: str starts-with categories: | strings -version: 0.100.0 +version: 0.101.0 strings: | Check if an input starts with a string. usage: | diff --git a/commands/docs/str_stats.md b/commands/docs/str_stats.md index 1ff06775c4..95732831d0 100644 --- a/commands/docs/str_stats.md +++ b/commands/docs/str_stats.md @@ -2,7 +2,7 @@ title: str stats categories: | strings -version: 0.100.0 +version: 0.101.0 strings: | Gather word count statistics on the text. usage: | diff --git a/commands/docs/str_substring.md b/commands/docs/str_substring.md index e6e4acb230..85d786bfcb 100644 --- a/commands/docs/str_substring.md +++ b/commands/docs/str_substring.md @@ -2,7 +2,7 @@ title: str substring categories: | strings -version: 0.100.0 +version: 0.101.0 strings: | Get part of a string. Note that the first character of a string is index 0. usage: | diff --git a/commands/docs/str_title-case.md b/commands/docs/str_title-case.md index 3d082da582..02d3391c07 100644 --- a/commands/docs/str_title-case.md +++ b/commands/docs/str_title-case.md @@ -2,7 +2,7 @@ title: str title-case categories: | strings -version: 0.100.0 +version: 0.101.0 strings: | Convert a string to Title Case. usage: | diff --git a/commands/docs/str_trim.md b/commands/docs/str_trim.md index d6432ae5bd..1626b4f427 100644 --- a/commands/docs/str_trim.md +++ b/commands/docs/str_trim.md @@ -2,7 +2,7 @@ title: str trim categories: | strings -version: 0.100.0 +version: 0.101.0 strings: | Trim whitespace or specific character. usage: | diff --git a/commands/docs/str_upcase.md b/commands/docs/str_upcase.md index 0c47803177..41f97ca6ad 100644 --- a/commands/docs/str_upcase.md +++ b/commands/docs/str_upcase.md @@ -2,7 +2,7 @@ title: str upcase categories: | strings -version: 0.100.0 +version: 0.101.0 strings: | Make text uppercase. usage: | diff --git a/commands/docs/sys.md b/commands/docs/sys.md index 6e5409608a..912f5b7837 100644 --- a/commands/docs/sys.md +++ b/commands/docs/sys.md @@ -2,7 +2,7 @@ title: sys categories: | system -version: 0.100.0 +version: 0.101.0 system: | View information about the system. usage: | diff --git a/commands/docs/sys_cpu.md b/commands/docs/sys_cpu.md index a01cd67999..a76baa683e 100644 --- a/commands/docs/sys_cpu.md +++ b/commands/docs/sys_cpu.md @@ -2,7 +2,7 @@ title: sys cpu categories: | system -version: 0.100.0 +version: 0.101.0 system: | View information about the system CPUs. usage: | @@ -18,6 +18,10 @@ usage: | ```> sys cpu {flags} ``` +## Flags + + - `--long, -l`: Get all available columns (slower, needs to sample CPU over time) + ## Input/output types: diff --git a/commands/docs/sys_disks.md b/commands/docs/sys_disks.md index ee3f751245..f8b4a21846 100644 --- a/commands/docs/sys_disks.md +++ b/commands/docs/sys_disks.md @@ -2,7 +2,7 @@ title: sys disks categories: | system -version: 0.100.0 +version: 0.101.0 system: | View information about the system disks. usage: | diff --git a/commands/docs/sys_host.md b/commands/docs/sys_host.md index ec795d8de8..5af9f1b8e2 100644 --- a/commands/docs/sys_host.md +++ b/commands/docs/sys_host.md @@ -2,7 +2,7 @@ title: sys host categories: | system -version: 0.100.0 +version: 0.101.0 system: | View information about the system host. usage: | diff --git a/commands/docs/sys_mem.md b/commands/docs/sys_mem.md index dbc4af66b3..dfe4dc6c93 100644 --- a/commands/docs/sys_mem.md +++ b/commands/docs/sys_mem.md @@ -2,7 +2,7 @@ title: sys mem categories: | system -version: 0.100.0 +version: 0.101.0 system: | View information about the system memory. usage: | diff --git a/commands/docs/sys_net.md b/commands/docs/sys_net.md index 0c5194b976..4138d4ba6e 100644 --- a/commands/docs/sys_net.md +++ b/commands/docs/sys_net.md @@ -2,7 +2,7 @@ title: sys net categories: | system -version: 0.100.0 +version: 0.101.0 system: | View information about the system network interfaces. usage: | diff --git a/commands/docs/sys_temp.md b/commands/docs/sys_temp.md index 1c56e51387..1215553ace 100644 --- a/commands/docs/sys_temp.md +++ b/commands/docs/sys_temp.md @@ -2,7 +2,7 @@ title: sys temp categories: | system -version: 0.100.0 +version: 0.101.0 system: | View the temperatures of system components. usage: | diff --git a/commands/docs/sys_users.md b/commands/docs/sys_users.md index 157f1a9a56..c3f169fc68 100644 --- a/commands/docs/sys_users.md +++ b/commands/docs/sys_users.md @@ -2,7 +2,7 @@ title: sys users categories: | system -version: 0.100.0 +version: 0.101.0 system: | View information about the users on the system. usage: | diff --git a/commands/docs/table.md b/commands/docs/table.md index 83ef33d26a..748aeb3b0a 100644 --- a/commands/docs/table.md +++ b/commands/docs/table.md @@ -2,7 +2,7 @@ title: table categories: | viewers -version: 0.100.0 +version: 0.101.0 viewers: | Render the table. usage: | diff --git a/commands/docs/take.md b/commands/docs/take.md index 0a8730510a..0176720d2c 100644 --- a/commands/docs/take.md +++ b/commands/docs/take.md @@ -2,7 +2,7 @@ title: take categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Take only the first n elements of a list, or the first n bytes of a binary value. usage: | diff --git a/commands/docs/take_until.md b/commands/docs/take_until.md index 6c8123d87f..bcd57d0259 100644 --- a/commands/docs/take_until.md +++ b/commands/docs/take_until.md @@ -2,7 +2,7 @@ title: take until categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Take elements of the input until a predicate is true. usage: | diff --git a/commands/docs/take_while.md b/commands/docs/take_while.md index dfc6136e56..61fa5595a3 100644 --- a/commands/docs/take_while.md +++ b/commands/docs/take_while.md @@ -2,7 +2,7 @@ title: take while categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Take elements of the input while a predicate is true. usage: | diff --git a/commands/docs/tee.md b/commands/docs/tee.md index 85fcc2c833..fe73025c11 100644 --- a/commands/docs/tee.md +++ b/commands/docs/tee.md @@ -2,7 +2,7 @@ title: tee categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Copy a stream to another command in parallel. usage: | diff --git a/commands/docs/term.md b/commands/docs/term.md new file mode 100644 index 0000000000..a772e7afea --- /dev/null +++ b/commands/docs/term.md @@ -0,0 +1,36 @@ +--- +title: term +categories: | + platform +version: 0.101.0 +platform: | + Commands for querying information about the terminal. +usage: | + Commands for querying information about the terminal. +--- + + +# `term` for [platform](/commands/categories/platform.md) + +
Commands for querying information about the terminal.
+ +## Signature + +```> term {flags} ``` + + +## Input/output types: + +| input | output | +| ------- | ------ | +| nothing | string | + +## Notes +You must use one of the following subcommands. Using this command as-is will only produce this help message. + +## Subcommands: + +| name | description | type | +| -------------------------------------------- | -------------------------------------------------------------------------------------------- | -------- | +| [`term query`](/commands/docs/term_query.md) | Query the terminal for information. | built-in | +| [`term size`](/commands/docs/term_size.md) | Returns a record containing the number of columns (width) and rows (height) of the terminal. | built-in | \ No newline at end of file diff --git a/commands/docs/term_query.md b/commands/docs/term_query.md new file mode 100644 index 0000000000..e8b810e688 --- /dev/null +++ b/commands/docs/term_query.md @@ -0,0 +1,73 @@ +--- +title: term query +categories: | + platform +version: 0.101.0 +platform: | + Query the terminal for information. +usage: | + Query the terminal for information. +--- + + +# `term query` for [platform](/commands/categories/platform.md) + +
Query the terminal for information.
+ +## Signature + +```> term query {flags} (query)``` + +## Flags + + - `--prefix, -p {one_of(binary, string)}`: Prefix sequence for the expected reply. + - `--terminator, -t {one_of(binary, string)}`: Terminator sequence for the expected reply. + - `--keep, -k`: Include prefix and terminator in the output. + +## Parameters + + - `query`: The query that will be printed to stdout. + + +## Input/output types: + +| input | output | +| ------- | ------ | +| nothing | binary | + +## Examples + +Get cursor position. +```nu +> term query (ansi cursor_position) --prefix (ansi csi) --terminator 'R' + +``` + +Get terminal background color. +```nu +> term query $'(ansi osc)10;?(ansi st)' --prefix $'(ansi osc)10;' --terminator (ansi st) + +``` + +Get terminal background color. (some terminals prefer `char bel` rather than `ansi st` as string terminator) +```nu +> term query $'(ansi osc)10;?(char bel)' --prefix $'(ansi osc)10;' --terminator (char bel) + +``` + +Read clipboard content on terminals supporting OSC-52. +```nu +> term query $'(ansi osc)52;c;?(ansi st)' --prefix $'(ansi osc)52;c;' --terminator (ansi st) + +``` + +## Notes +Print the given query, and read the immediate result from stdin. + +The standard input will be read right after `query` is printed, and consumed until the `terminator` +sequence is encountered. The `terminator` is not included in the output. + +If `terminator` is not supplied, input will be read until Ctrl-C is pressed. + +If `prefix` is supplied, input's initial bytes will be validated against it. +The `prefix` is not included in the output. \ No newline at end of file diff --git a/commands/docs/term_size.md b/commands/docs/term_size.md index 534ad30952..e2d9f8ed7d 100644 --- a/commands/docs/term_size.md +++ b/commands/docs/term_size.md @@ -2,7 +2,7 @@ title: term size categories: | platform -version: 0.100.0 +version: 0.101.0 platform: | Returns a record containing the number of columns (width) and rows (height) of the terminal. usage: | diff --git a/commands/docs/timeit.md b/commands/docs/timeit.md index 7dac9d3e9c..79756a22eb 100644 --- a/commands/docs/timeit.md +++ b/commands/docs/timeit.md @@ -2,17 +2,17 @@ title: timeit categories: | debug -version: 0.100.0 +version: 0.101.0 debug: | - Time the running time of a block. + Time how long it takes a closure to run. usage: | - Time the running time of a block. + Time how long it takes a closure to run. --- # `timeit` for [debug](/commands/categories/debug.md) -
Time the running time of a block.
+
Time how long it takes a closure to run.
## Signature @@ -20,7 +20,7 @@ usage: | ## Parameters - - `command`: The command or block to run. + - `command`: The closure to run. ## Input/output types: @@ -31,20 +31,31 @@ usage: | | nothing | duration | ## Examples -Times a command within a closure +Time a closure containing one command ```nu > timeit { sleep 500ms } ``` -Times a command using an existing input +Time a closure with an input value ```nu -> http get https://www.nushell.sh/book/ | timeit { split chars } +> 'A really long string' | timeit { split chars } ``` -Times a command invocation +Time a closure with an input stream ```nu -> timeit ls -la +> open some_file.txt | collect | timeit { split chars } ``` + +Time a closure containing a pipeline +```nu +> timeit { open some_file.txt | split chars } + +``` + +## Notes +Any pipeline input given to this command is passed to the closure. Note that streaming inputs may affect timing results, and it is recommended to add a `collect` command before this if the input is a stream. + +This command will bubble up any errors encountered when running the closure. The return pipeline of the closure is collected into a value and then discarded. \ No newline at end of file diff --git a/commands/docs/to.md b/commands/docs/to.md index 007805955b..ce334c2603 100644 --- a/commands/docs/to.md +++ b/commands/docs/to.md @@ -2,7 +2,7 @@ title: to categories: | formats -version: 0.100.0 +version: 0.101.0 formats: | Translate structured data to a format. usage: | diff --git a/commands/docs/to_csv.md b/commands/docs/to_csv.md index 2948bf77bf..c675196c61 100644 --- a/commands/docs/to_csv.md +++ b/commands/docs/to_csv.md @@ -2,7 +2,7 @@ title: to csv categories: | formats -version: 0.100.0 +version: 0.101.0 formats: | Convert table into .csv text . usage: | diff --git a/commands/docs/to_html.md b/commands/docs/to_html.md index 92631e5ee7..442b61155c 100644 --- a/commands/docs/to_html.md +++ b/commands/docs/to_html.md @@ -2,7 +2,7 @@ title: to html categories: | formats -version: 0.100.0 +version: 0.101.0 formats: | Convert table into simple HTML. usage: | diff --git a/commands/docs/to_json.md b/commands/docs/to_json.md index e4c3c71dcf..0fd5c8c7fd 100644 --- a/commands/docs/to_json.md +++ b/commands/docs/to_json.md @@ -2,7 +2,7 @@ title: to json categories: | formats -version: 0.100.0 +version: 0.101.0 formats: | Converts table data into JSON text. usage: | diff --git a/commands/docs/to_md.md b/commands/docs/to_md.md index 825b7b3578..38b69d441b 100644 --- a/commands/docs/to_md.md +++ b/commands/docs/to_md.md @@ -2,7 +2,7 @@ title: to md categories: | formats -version: 0.100.0 +version: 0.101.0 formats: | Convert table into simple Markdown. usage: | diff --git a/commands/docs/to_msgpack.md b/commands/docs/to_msgpack.md index a6febc8d25..6ced502c8b 100644 --- a/commands/docs/to_msgpack.md +++ b/commands/docs/to_msgpack.md @@ -2,7 +2,7 @@ title: to msgpack categories: | formats -version: 0.100.0 +version: 0.101.0 formats: | Convert Nu values into MessagePack. usage: | diff --git a/commands/docs/to_msgpackz.md b/commands/docs/to_msgpackz.md index 7088558214..57a48b7a54 100644 --- a/commands/docs/to_msgpackz.md +++ b/commands/docs/to_msgpackz.md @@ -2,7 +2,7 @@ title: to msgpackz categories: | formats -version: 0.100.0 +version: 0.101.0 formats: | Convert Nu values into brotli-compressed MessagePack. usage: | diff --git a/commands/docs/to_nuon.md b/commands/docs/to_nuon.md index b0247488cd..d3a549e6ee 100644 --- a/commands/docs/to_nuon.md +++ b/commands/docs/to_nuon.md @@ -2,7 +2,7 @@ title: to nuon categories: | formats -version: 0.100.0 +version: 0.101.0 formats: | Converts table data into Nuon (Nushell Object Notation) text. usage: | diff --git a/commands/docs/to_plist.md b/commands/docs/to_plist.md index 68d0b26490..f9c936e1ed 100644 --- a/commands/docs/to_plist.md +++ b/commands/docs/to_plist.md @@ -2,7 +2,7 @@ title: to plist categories: | formats -version: 0.100.0 +version: 0.101.0 formats: | Convert Nu values into plist usage: | diff --git a/commands/docs/to_text.md b/commands/docs/to_text.md index 431aa74add..7f5cc40cf3 100644 --- a/commands/docs/to_text.md +++ b/commands/docs/to_text.md @@ -2,7 +2,7 @@ title: to text categories: | formats -version: 0.100.0 +version: 0.101.0 formats: | Converts data into simple text. usage: | diff --git a/commands/docs/to_toml.md b/commands/docs/to_toml.md index 055cdeecc4..6f8bbc02ec 100644 --- a/commands/docs/to_toml.md +++ b/commands/docs/to_toml.md @@ -2,7 +2,7 @@ title: to toml categories: | formats -version: 0.100.0 +version: 0.101.0 formats: | Convert record into .toml text. usage: | diff --git a/commands/docs/to_tsv.md b/commands/docs/to_tsv.md index b374c58043..804d45d21c 100644 --- a/commands/docs/to_tsv.md +++ b/commands/docs/to_tsv.md @@ -2,7 +2,7 @@ title: to tsv categories: | formats -version: 0.100.0 +version: 0.101.0 formats: | Convert table into .tsv text. usage: | diff --git a/commands/docs/to_xml.md b/commands/docs/to_xml.md index 119bb686f3..0aced66ded 100644 --- a/commands/docs/to_xml.md +++ b/commands/docs/to_xml.md @@ -2,7 +2,7 @@ title: to xml categories: | formats -version: 0.100.0 +version: 0.101.0 formats: | Convert special record structure into .xml text. usage: | diff --git a/commands/docs/to_yaml.md b/commands/docs/to_yaml.md index b255b16ee6..56eb7ad20f 100644 --- a/commands/docs/to_yaml.md +++ b/commands/docs/to_yaml.md @@ -2,7 +2,7 @@ title: to yaml categories: | formats -version: 0.100.0 +version: 0.101.0 formats: | Convert table into .yaml/.yml text. usage: | diff --git a/commands/docs/touch.md b/commands/docs/touch.md index 415f2a7026..2f3dd7fc33 100644 --- a/commands/docs/touch.md +++ b/commands/docs/touch.md @@ -2,7 +2,7 @@ title: touch categories: | filesystem -version: 0.100.0 +version: 0.101.0 filesystem: | Creates one or more files. usage: | diff --git a/commands/docs/transpose.md b/commands/docs/transpose.md index 39a18110bb..a08b070c88 100644 --- a/commands/docs/transpose.md +++ b/commands/docs/transpose.md @@ -2,7 +2,7 @@ title: transpose categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Transposes the table contents so rows become columns and columns become rows. usage: | diff --git a/commands/docs/try.md b/commands/docs/try.md index ba5b23b40e..49dc9849d1 100644 --- a/commands/docs/try.md +++ b/commands/docs/try.md @@ -2,7 +2,7 @@ title: try categories: | core -version: 0.100.0 +version: 0.101.0 core: | Try to run a block, if it fails optionally run a catch closure. usage: | diff --git a/commands/docs/tutor.md b/commands/docs/tutor.md index 14c773bcb5..47d854da97 100644 --- a/commands/docs/tutor.md +++ b/commands/docs/tutor.md @@ -2,7 +2,7 @@ title: tutor categories: | misc -version: 0.100.0 +version: 0.101.0 misc: | Run the tutorial. To begin, run: tutor. usage: | diff --git a/commands/docs/ulimit.md b/commands/docs/ulimit.md index 4496066048..9a8d914d6b 100644 --- a/commands/docs/ulimit.md +++ b/commands/docs/ulimit.md @@ -2,7 +2,7 @@ title: ulimit categories: | platform -version: 0.100.0 +version: 0.101.0 platform: | Set or get resource usage limits. usage: | @@ -25,20 +25,11 @@ usage: | - `--all, -a`: Prints all current limits - `--core-size, -c`: Maximum size of core files created - `--data-size, -d`: Maximum size of a process's data segment - - `--nice, -e`: Controls of maximum nice priority - `--file-size, -f`: Maximum size of files created by the shell - - `--pending-signals, -i`: Maximum number of pending signals - - `--lock-size, -l`: Maximum size that may be locked into memory - - `--resident-set-size, -m`: Maximum resident set size - `--file-descriptor-count, -n`: Maximum number of open file descriptors - - `--queue-size, -q`: Maximum bytes in POSIX message queues - - `--realtime-priority, -r`: Maximum realtime scheduling priority - `--stack-size, -s`: Maximum stack size - `--cpu-time, -t`: Maximum amount of CPU time in seconds - - `--process-count, -u`: Maximum number of processes available to the current user - `--virtual-memory-size, -v`: Maximum amount of virtual memory available to each process - - `--file-locks, -x`: Maximum number of file locks - - `--realtime-maxtime, -y`: Maximum contiguous realtime CPU time ## Parameters diff --git a/commands/docs/uname.md b/commands/docs/uname.md index 9178c87b52..bc84deeedb 100644 --- a/commands/docs/uname.md +++ b/commands/docs/uname.md @@ -2,7 +2,7 @@ title: uname categories: | system -version: 0.100.0 +version: 0.101.0 system: | Print certain system information using uutils/coreutils uname. usage: | diff --git a/commands/docs/uniq-by.md b/commands/docs/uniq-by.md index e1589209be..9b5dc8a083 100644 --- a/commands/docs/uniq-by.md +++ b/commands/docs/uniq-by.md @@ -2,7 +2,7 @@ title: uniq-by categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Return the distinct values in the input by the given column(s). usage: | diff --git a/commands/docs/uniq.md b/commands/docs/uniq.md index 92bd5bdea3..8626df5fff 100644 --- a/commands/docs/uniq.md +++ b/commands/docs/uniq.md @@ -2,7 +2,7 @@ title: uniq categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Return the distinct values in the input. usage: | diff --git a/commands/docs/update.md b/commands/docs/update.md index f16e570edb..fc2d96702d 100644 --- a/commands/docs/update.md +++ b/commands/docs/update.md @@ -2,7 +2,7 @@ title: update categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Update an existing column to have a new value. usage: | diff --git a/commands/docs/update_cells.md b/commands/docs/update_cells.md index afd8e85510..d7e6d19eed 100644 --- a/commands/docs/update_cells.md +++ b/commands/docs/update_cells.md @@ -2,7 +2,7 @@ title: update cells categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Update the table cells. usage: | @@ -47,11 +47,11 @@ Update the zero value cells to empty strings. $value } } -╭───┬────────────┬────────────┬────────────┬────────────┬────────────┬────────────┬────────────╮ -│ # │ 2021-04-16 │ 2021-06-10 │ 2021-09-18 │ 2021-10-15 │ 2021-11-16 │ 2021-11-17 │ 2021-11-18 │ -├───┼────────────┼────────────┼────────────┼────────────┼────────────┼────────────┼────────────┤ -│ 0 │ 37 │ │ │ │ 37 │ │ │ -╰───┴────────────┴────────────┴────────────┴────────────┴────────────┴────────────┴────────────╯ +╭──────┬───────────────┬───────────────┬───────────────┬───────────────┬───────────────┬───────────────┬──────────────╮ +│ # │ 2021-04-16 │ 2021-06-10 │ 2021-09-18 │ 2021-10-15 │ 2021-11-16 │ 2021-11-17 │ 2021-11-18 │ +├──────┼───────────────┼───────────────┼───────────────┼───────────────┼───────────────┼───────────────┼──────────────┤ +│ 0 │ 37 │ │ │ │ 37 │ │ │ +╰──────┴───────────────┴───────────────┴───────────────┴───────────────┴───────────────┴───────────────┴──────────────╯ ``` @@ -67,10 +67,10 @@ Update the zero value cells to empty strings in 2 last columns. $value } } -╭───┬────────────┬────────────┬────────────┬────────────┬────────────┬────────────┬────────────╮ -│ # │ 2021-04-16 │ 2021-06-10 │ 2021-09-18 │ 2021-10-15 │ 2021-11-16 │ 2021-11-17 │ 2021-11-18 │ -├───┼────────────┼────────────┼────────────┼────────────┼────────────┼────────────┼────────────┤ -│ 0 │ 37 │ 0 │ 0 │ 0 │ 37 │ │ │ -╰───┴────────────┴────────────┴────────────┴────────────┴────────────┴────────────┴────────────╯ +╭──────┬───────────────┬───────────────┬───────────────┬───────────────┬───────────────┬───────────────┬──────────────╮ +│ # │ 2021-04-16 │ 2021-06-10 │ 2021-09-18 │ 2021-10-15 │ 2021-11-16 │ 2021-11-17 │ 2021-11-18 │ +├──────┼───────────────┼───────────────┼───────────────┼───────────────┼───────────────┼───────────────┼──────────────┤ +│ 0 │ 37 │ 0 │ 0 │ 0 │ 37 │ │ │ +╰──────┴───────────────┴───────────────┴───────────────┴───────────────┴───────────────┴───────────────┴──────────────╯ ``` diff --git a/commands/docs/upsert.md b/commands/docs/upsert.md index 0d0f153697..0034576266 100644 --- a/commands/docs/upsert.md +++ b/commands/docs/upsert.md @@ -2,7 +2,7 @@ title: upsert categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Update an existing column to have a new value, or insert a new column. usage: | diff --git a/commands/docs/url.md b/commands/docs/url.md index 36c320ad9d..1747d30491 100644 --- a/commands/docs/url.md +++ b/commands/docs/url.md @@ -2,7 +2,7 @@ title: url categories: | network -version: 0.100.0 +version: 0.101.0 network: | Various commands for working with URLs. usage: | diff --git a/commands/docs/url_build-query.md b/commands/docs/url_build-query.md index 12813de622..10d87f4f76 100644 --- a/commands/docs/url_build-query.md +++ b/commands/docs/url_build-query.md @@ -2,7 +2,7 @@ title: url build-query categories: | network -version: 0.100.0 +version: 0.101.0 network: | Converts record or table into query string applying percent-encoding. usage: | diff --git a/commands/docs/url_decode.md b/commands/docs/url_decode.md index a5c7138c7b..22422e5406 100644 --- a/commands/docs/url_decode.md +++ b/commands/docs/url_decode.md @@ -2,7 +2,7 @@ title: url decode categories: | strings -version: 0.100.0 +version: 0.101.0 strings: | Converts a percent-encoded web safe string to a string. usage: | diff --git a/commands/docs/url_encode.md b/commands/docs/url_encode.md index c9f73b5d51..3ff1bd37c7 100644 --- a/commands/docs/url_encode.md +++ b/commands/docs/url_encode.md @@ -2,7 +2,7 @@ title: url encode categories: | strings -version: 0.100.0 +version: 0.101.0 strings: | Converts a string to a percent encoded web safe string. usage: | diff --git a/commands/docs/url_join.md b/commands/docs/url_join.md index 4bd595c762..d9441be875 100644 --- a/commands/docs/url_join.md +++ b/commands/docs/url_join.md @@ -2,7 +2,7 @@ title: url join categories: | network -version: 0.100.0 +version: 0.101.0 network: | Converts a record to url. usage: | diff --git a/commands/docs/url_parse.md b/commands/docs/url_parse.md index d2993e1e0c..a8d8570bf6 100644 --- a/commands/docs/url_parse.md +++ b/commands/docs/url_parse.md @@ -2,7 +2,7 @@ title: url parse categories: | network -version: 0.100.0 +version: 0.101.0 network: | Parses a url. usage: | diff --git a/commands/docs/url_split-query.md b/commands/docs/url_split-query.md index 6e2a3889d4..d2eced9298 100644 --- a/commands/docs/url_split-query.md +++ b/commands/docs/url_split-query.md @@ -2,7 +2,7 @@ title: url split-query categories: | network -version: 0.100.0 +version: 0.101.0 network: | Converts query string into table applying percent-decoding. usage: | diff --git a/commands/docs/use.md b/commands/docs/use.md index 78e9e4d03a..97d89a269a 100644 --- a/commands/docs/use.md +++ b/commands/docs/use.md @@ -2,7 +2,7 @@ title: use categories: | core -version: 0.100.0 +version: 0.101.0 core: | Use definitions from a module, making them available in your shell. usage: | diff --git a/commands/docs/utouch.md b/commands/docs/utouch.md new file mode 100644 index 0000000000..b89ff9788b --- /dev/null +++ b/commands/docs/utouch.md @@ -0,0 +1,90 @@ +--- +title: utouch +categories: | + filesystem +version: 0.101.0 +filesystem: | + Creates one or more files. +usage: | + Creates one or more files. +--- + + +# `utouch` for [filesystem](/commands/categories/filesystem.md) + +
Creates one or more files.
+ +## Signature + +```> utouch {flags} ...rest``` + +## Flags + + - `--reference, -r {path}`: Use the access and modification times of the reference file/directory instead of the current time + - `--timestamp, -t {datetime}`: Use the given timestamp instead of the current time + - `--date, -d {string}`: Use the given time instead of the current time. This can be a full timestamp or it can be relative to either the current time or reference file time (if given). For more information, see https://www.gnu.org/software/coreutils/manual/html_node/touch-invocation.html + - `--modified, -m`: Change only the modification time (if used with -a, access time is changed too) + - `--access, -a`: Change only the access time (if used with -m, modification time is changed too) + - `--no-create, -c`: Don't create the file if it doesn't exist + - `--no-deref, -s`: Affect each symbolic link instead of any referenced file (only for systems that can change the timestamps of a symlink). Ignored if touching stdout + +## Parameters + + - `...rest`: The file(s) to create. '-' is used to represent stdout. + + +## Input/output types: + +| input | output | +| ------- | ------- | +| nothing | nothing | + +## Examples + +Creates "fixture.json" +```nu +> utouch fixture.json + +``` + +Creates files a, b and c +```nu +> utouch a b c + +``` + +Changes the last modified time of "fixture.json" to today's date +```nu +> utouch -m fixture.json + +``` + +Changes the last accessed and modified times of files a, b and c to the current time but yesterday +```nu +> utouch -d "yesterday" a b c + +``` + +Changes the last modified time of files d and e to "fixture.json"'s last modified time +```nu +> utouch -m -r fixture.json d e + +``` + +Changes the last accessed time of "fixture.json" to a datetime +```nu +> utouch -a -t 2019-08-24T12:30:30 fixture.json + +``` + +Change the last accessed and modified times of stdout +```nu +> utouch - + +``` + +Changes the last accessed and modified times of file a to 1 month before "fixture.json"'s last modified time +```nu +> utouch -r fixture.json -d "-1 month" a + +``` diff --git a/commands/docs/values.md b/commands/docs/values.md index c71717aa31..c198d20833 100644 --- a/commands/docs/values.md +++ b/commands/docs/values.md @@ -2,7 +2,7 @@ title: values categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Given a record or table, produce a list of its columns' values. usage: | diff --git a/commands/docs/version.md b/commands/docs/version.md index 265693f0fe..5cad03570c 100644 --- a/commands/docs/version.md +++ b/commands/docs/version.md @@ -2,7 +2,7 @@ title: version categories: | core -version: 0.100.0 +version: 0.101.0 core: | Display Nu version, and its build configuration. usage: | diff --git a/commands/docs/view.md b/commands/docs/view.md index aef24356ab..5154a3c596 100644 --- a/commands/docs/view.md +++ b/commands/docs/view.md @@ -2,7 +2,7 @@ title: view categories: | debug -version: 0.100.0 +version: 0.101.0 debug: | Various commands for viewing debug information. usage: | @@ -30,9 +30,10 @@ You must use one of the following subcommands. Using this command as-is will onl ## Subcommands: -| name | description | type | -| ---------------------------------------------- | ---------------------------------------------------------- | -------- | -| [`view files`](/commands/docs/view_files.md) | View the files registered in nushell's EngineState memory. | built-in | -| [`view ir`](/commands/docs/view_ir.md) | View the compiled IR code for a block of code. | built-in | -| [`view source`](/commands/docs/view_source.md) | View a block, module, or a definition. | built-in | -| [`view span`](/commands/docs/view_span.md) | View the contents of a span. | built-in | \ No newline at end of file +| name | description | type | +| ---------------------------------------------- | ----------------------------------------------------------- | -------- | +| [`view blocks`](/commands/docs/view_blocks.md) | View the blocks registered in nushell's EngineState memory. | built-in | +| [`view files`](/commands/docs/view_files.md) | View the files registered in nushell's EngineState memory. | built-in | +| [`view ir`](/commands/docs/view_ir.md) | View the compiled IR code for a block of code. | built-in | +| [`view source`](/commands/docs/view_source.md) | View a block, module, or a definition. | built-in | +| [`view span`](/commands/docs/view_span.md) | View the contents of a span. | built-in | \ No newline at end of file diff --git a/commands/docs/view_blocks.md b/commands/docs/view_blocks.md new file mode 100644 index 0000000000..3dc9f43aea --- /dev/null +++ b/commands/docs/view_blocks.md @@ -0,0 +1,37 @@ +--- +title: view blocks +categories: | + debug +version: 0.101.0 +debug: | + View the blocks registered in nushell's EngineState memory. +usage: | + View the blocks registered in nushell's EngineState memory. +--- + + +# `view blocks` for [debug](/commands/categories/debug.md) + +
View the blocks registered in nushell's EngineState memory.
+ +## Signature + +```> view blocks {flags} ``` + + +## Input/output types: + +| input | output | +| ------- | ----------------------------------------------------------- | +| nothing | table\ | + +## Examples + +View the blocks registered in Nushell's EngineState memory +```nu +> view blocks + +``` + +## Notes +These are blocks parsed and loaded at runtime as well as any blocks that accumulate in the repl. \ No newline at end of file diff --git a/commands/docs/view_files.md b/commands/docs/view_files.md index a4a9dfcc2c..0c9a140a71 100644 --- a/commands/docs/view_files.md +++ b/commands/docs/view_files.md @@ -2,7 +2,7 @@ title: view files categories: | debug -version: 0.100.0 +version: 0.101.0 debug: | View the files registered in nushell's EngineState memory. usage: | diff --git a/commands/docs/view_ir.md b/commands/docs/view_ir.md index 98dc9db00b..18da54f57b 100644 --- a/commands/docs/view_ir.md +++ b/commands/docs/view_ir.md @@ -2,7 +2,7 @@ title: view ir categories: | debug -version: 0.100.0 +version: 0.101.0 debug: | View the compiled IR code for a block of code. usage: | diff --git a/commands/docs/view_source.md b/commands/docs/view_source.md index 4c1673ae24..160c9f2a4a 100644 --- a/commands/docs/view_source.md +++ b/commands/docs/view_source.md @@ -2,7 +2,7 @@ title: view source categories: | debug -version: 0.100.0 +version: 0.101.0 debug: | View a block, module, or a definition. usage: | diff --git a/commands/docs/view_span.md b/commands/docs/view_span.md index 62a82dac79..ded3c0ec5e 100644 --- a/commands/docs/view_span.md +++ b/commands/docs/view_span.md @@ -2,7 +2,7 @@ title: view span categories: | debug -version: 0.100.0 +version: 0.101.0 debug: | View the contents of a span. usage: | diff --git a/commands/docs/watch.md b/commands/docs/watch.md index 62bff49289..70e5d1962a 100644 --- a/commands/docs/watch.md +++ b/commands/docs/watch.md @@ -2,7 +2,7 @@ title: watch categories: | filesystem -version: 0.100.0 +version: 0.101.0 filesystem: | Watch for file changes and execute Nu code when they happen. usage: | diff --git a/commands/docs/where.md b/commands/docs/where.md index 36d8f05cd4..39355daf8d 100644 --- a/commands/docs/where.md +++ b/commands/docs/where.md @@ -2,7 +2,7 @@ title: where categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Filter values based on a row condition. usage: | diff --git a/commands/docs/which.md b/commands/docs/which.md index fcf012187d..adfd095dc1 100644 --- a/commands/docs/which.md +++ b/commands/docs/which.md @@ -2,7 +2,7 @@ title: which categories: | system -version: 0.100.0 +version: 0.101.0 system: | Finds a program file, alias or custom command. usage: | diff --git a/commands/docs/while.md b/commands/docs/while.md index 2628996dc8..2e501d93a7 100644 --- a/commands/docs/while.md +++ b/commands/docs/while.md @@ -2,7 +2,7 @@ title: while categories: | core -version: 0.100.0 +version: 0.101.0 core: | Conditionally run a block in a loop. usage: | diff --git a/commands/docs/whoami.md b/commands/docs/whoami.md index 31d3a6c89a..eed33f5538 100644 --- a/commands/docs/whoami.md +++ b/commands/docs/whoami.md @@ -2,7 +2,7 @@ title: whoami categories: | platform -version: 0.100.0 +version: 0.101.0 platform: | Get the current username using uutils/coreutils whoami. usage: | diff --git a/commands/docs/window.md b/commands/docs/window.md index da005e47b0..af4e88becc 100644 --- a/commands/docs/window.md +++ b/commands/docs/window.md @@ -2,7 +2,7 @@ title: window categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Creates a sliding window of `window_size` that slide by n rows/elements across input. usage: | diff --git a/commands/docs/with-env.md b/commands/docs/with-env.md index 67bbc55d86..963a433015 100644 --- a/commands/docs/with-env.md +++ b/commands/docs/with-env.md @@ -2,7 +2,7 @@ title: with-env categories: | env -version: 0.100.0 +version: 0.101.0 env: | Runs a block with an environment variable set. usage: | diff --git a/commands/docs/wrap.md b/commands/docs/wrap.md index b0a762cbd2..66674d0a7b 100644 --- a/commands/docs/wrap.md +++ b/commands/docs/wrap.md @@ -2,7 +2,7 @@ title: wrap categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Wrap the value into a column. usage: | diff --git a/commands/docs/zip.md b/commands/docs/zip.md index 580cb488ed..51abd93d2e 100644 --- a/commands/docs/zip.md +++ b/commands/docs/zip.md @@ -2,7 +2,7 @@ title: zip categories: | filters -version: 0.100.0 +version: 0.101.0 filters: | Combine a stream with the input. usage: |