-
Notifications
You must be signed in to change notification settings - Fork 537
Lang and snippets updates #1699
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| > cd new_directory | ||
| cd new_directory |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| > ./new_directory | ||
| ./new_directory |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,11 @@ | ||
| # Change to the parent directory | ||
| > cd .. | ||
| cd .. | ||
| # or | ||
| > .. | ||
| .. | ||
| # Go up two levels (parent's parent) | ||
| > cd ... | ||
| cd ... | ||
| # or | ||
| > ... | ||
| ... | ||
| # Go up three levels (parent of parent's parent) | ||
| > cd .... | ||
| # Etc. | ||
| cd .... | ||
| # Etc. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| > cd ../sibling | ||
| cd ../sibling |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| > cd nushell | ||
| nushell> cargo build --workspace; cargo run | ||
| cd nushell | ||
| # ./nushell | ||
| cargo build --workspace; cargo run |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| nushell> cargo build --release --workspace; cargo run --release | ||
| cargo build --release --workspace; cargo run --release |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| > git clone https://github.com/nushell/nushell.git | ||
| > cd nushell | ||
| nushell> cargo install --path . --locked | ||
| git clone https://github.com/nushell/nushell.git | ||
| cd nushell | ||
| # ./nushell | ||
| cargo install --path . --locked |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| > cargo install nu --locked | ||
| cargo install nu --locked |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| > git clone https://github.com/nushell/nushell.git | ||
| git clone https://github.com/nushell/nushell.git |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| > nu | ||
| C:\Users\user> | ||
| nu | ||
| # => C:\Users\user> | ||
0x4D5352 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| > date now | ||
| 2022-03-07 14:14:51.684619600 -08:00 | ||
| date now | ||
| # => 2022-03-07 14:14:51.684619600 -08:00 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| > date now | date to-table | ||
| ╭───┬──────┬───────┬─────┬──────┬────────┬────────┬──────────╮ | ||
| │ # │ year │ month │ day │ hour │ minute │ second │ timezone │ | ||
| ├───┼──────┼───────┼─────┼──────┼────────┼────────┼──────────┤ | ||
| │ 0 │ 2022 │ 3 │ 7 │ 14 │ 45 │ 3 │ -08:00 │ | ||
| ╰───┴──────┴───────┴─────┴──────┴────────┴────────┴──────────╯ | ||
| date now | date to-table | ||
| # => ╭───┬──────┬───────┬─────┬──────┬────────┬────────┬──────────╮ | ||
| # => │ # │ year │ month │ day │ hour │ minute │ second │ timezone │ | ||
| # => ├───┼──────┼───────┼─────┼──────┼────────┼────────┼──────────┤ | ||
| # => │ 0 │ 2022 │ 3 │ 7 │ 14 │ 45 │ 3 │ -08:00 │ | ||
| # => ╰───┴──────┴───────┴─────┴──────┴────────┴────────┴──────────╯ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,22 +1,22 @@ | ||
| > help commands | where name == each | first | ||
| ╭──────────────┬────────────────────────────────────────────────────────────────────────────────────────────────╮ | ||
| │ name │ each │ | ||
| │ category │ filters │ | ||
| │ command_type │ built-in │ | ||
| │ usage │ Run a closure on each row of the input list, creating a new list with the results. │ | ||
| │ │ ╭───┬──────────────────┬──────────────┬──────────┬───────────────────────────────────────────╮ │ | ||
| │ params │ │ # │ name │ type │ required │ description │ │ | ||
| │ │ ├───┼──────────────────┼──────────────┼──────────┼───────────────────────────────────────────┤ │ | ||
| │ │ │ 0 │ closure │ closure(any) │ true │ The closure to run. │ │ | ||
| │ │ │ 1 │ --help(-h) │ switch │ false │ Display the help message for this command │ │ | ||
| │ │ │ 2 │ --keep-empty(-k) │ switch │ false │ keep empty result cells │ │ | ||
| │ │ ╰───┴──────────────────┴──────────────┴──────────┴───────────────────────────────────────────╯ │ | ||
| │ │ ╭───┬───────────┬───────────╮ │ | ||
| │ input_output │ │ # │ input │ output │ │ | ||
| │ │ ├───┼───────────┼───────────┤ │ | ||
| │ │ │ 0 │ list<any> │ list<any> │ │ | ||
| │ │ │ 1 │ table │ list<any> │ │ | ||
| │ │ │ 2 │ any │ any │ │ | ||
| │ │ ╰───┴───────────┴───────────╯ │ | ||
| │ search_terms │ for, loop, iterate, map │ | ||
| ╰──────────────┴────────────────────────────────────────────────────────────────────────────────────────────────╯ | ||
| > commands | where name == each | first | ||
| # => ╭──────────────┬────────────────────────────────────────────────────────────────────────────────────────────────╮ | ||
| # => │ name │ each │ | ||
| # => │ category │ filters │ | ||
| # => │ command_type │ built-in │ | ||
| # => │ usage │ Run a closure on each row of the input list, creating a new list with the results. │ | ||
| # => │ │ ╭───┬──────────────────┬──────────────┬──────────┬───────────────────────────────────────────╮ │ | ||
| # => │ params │ │ # │ name │ type │ required │ description │ │ | ||
| # => │ │ ├───┼──────────────────┼──────────────┼──────────┼───────────────────────────────────────────┤ │ | ||
| # => │ │ │ 0 │ closure │ closure(any) │ true │ The closure to run. │ │ | ||
| # => │ │ │ 1 │ --help(-h) │ switch │ false │ Display the help message for this command │ │ | ||
| # => │ │ │ 2 │ --keep-empty(-k) │ switch │ false │ keep empty result cells │ │ | ||
| # => │ │ ╰───┴──────────────────┴──────────────┴──────────┴───────────────────────────────────────────╯ │ | ||
| # => │ │ ╭───┬───────────┬───────────╮ │ | ||
| # => │ input_output │ │ # │ input │ output │ │ | ||
| # => │ │ ├───┼───────────┼───────────┤ │ | ||
| # => │ │ │ 0 │ list<any> │ list<any> │ │ | ||
| # => │ │ │ 1 │ table │ list<any> │ │ | ||
| # => │ │ │ 2 │ any │ any │ │ | ||
| # => │ │ ╰───┴───────────┴───────────╯ │ | ||
| # => │ search_terms │ for, loop, iterate, map │ | ||
| # => ╰──────────────┴────────────────────────────────────────────────────────────────────────────────────────────────╯ |
12 changes: 6 additions & 6 deletions
12
snippets/introduction/help_commands_get_cell_path_example.nu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| > help commands | where name == each | get 0.params.name | ||
| ╭───┬──────────────────╮ | ||
| │ 0 │ closure │ | ||
| │ 1 │ --help(-h) │ | ||
| │ 2 │ --keep-empty(-k) │ | ||
| ╰───┴──────────────────╯ | ||
| help commands | where name == each | get 0.params.name | ||
| # => ╭───┬──────────────────╮ | ||
| # => │ 0 │ closure │ | ||
| # => │ 1 │ --help(-h) │ | ||
| # => │ 2 │ --keep-empty(-k) │ | ||
| # => ╰───┴──────────────────╯ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,8 @@ | ||
| > help commands | where name == each | first | get params | ||
| ╭───┬──────────────────┬──────────────┬──────────┬───────────────────────────────────────────╮ | ||
| │ # │ name │ type │ required │ description │ | ||
| ├───┼──────────────────┼──────────────┼──────────┼───────────────────────────────────────────┤ | ||
| │ 0 │ closure │ closure(any) │ true │ The closure to run. │ | ||
| │ 1 │ --help(-h) │ switch │ false │ Display the help message for this command │ | ||
| │ 2 │ --keep-empty(-k) │ switch │ false │ keep empty result cells │ | ||
| ╰───┴──────────────────┴──────────────┴──────────┴───────────────────────────────────────────╯ | ||
| help commands | where name == each | first | get params | ||
| # => ╭───┬──────────────────┬──────────────┬──────────┬───────────────────────────────────────────╮ | ||
| # => │ # │ name │ type │ required │ description │ | ||
| # => ├───┼──────────────────┼──────────────┼──────────┼───────────────────────────────────────────┤ | ||
| # => │ 0 │ closure │ closure(any) │ true │ The closure to run. │ | ||
| # => │ 1 │ --help(-h) │ switch │ false │ Display the help message for this command │ | ||
| # => │ 2 │ --keep-empty(-k) │ switch │ false │ keep empty result cells │ | ||
| # => ╰───┴──────────────────┴──────────────┴──────────┴───────────────────────────────────────────╯ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| > help commands | where name == each | first | get params.name | ||
| ╭───┬──────────────────╮ | ||
| │ 0 │ closure │ | ||
| │ 1 │ --help(-h) │ | ||
| │ 2 │ --keep-empty(-k) │ | ||
| ╰───┴──────────────────╯ | ||
| help commands | where name == each | first | get params.name | ||
| # => ╭───┬──────────────────╮ | ||
| # => │ 0 │ closure │ | ||
| # => │ 1 │ --help(-h) │ | ||
| # => │ 2 │ --keep-empty(-k) │ | ||
| # => ╰───┴──────────────────╯ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,33 +1,33 @@ | ||
| > help path | ||
| Explore and manipulate paths. | ||
|
|
||
| There are three ways to represent a path: | ||
|
|
||
| * As a path literal, e.g., '/home/viking/spam.txt' | ||
| * As a structured path: a table with 'parent', 'stem', and 'extension' (and | ||
| * 'prefix' on Windows) columns. This format is produced by the 'path parse' | ||
| subcommand. | ||
| * As an inner list of path parts, e.g., '[[ / home viking spam.txt ]]'. | ||
| Splitting into parts is done by the `path split` command. | ||
|
|
||
| All subcommands accept all three variants as an input. Furthermore, the 'path | ||
| join' subcommand can be used to join the structured path or path parts back into | ||
| the path literal. | ||
|
|
||
| Usage: | ||
| > path | ||
|
|
||
| Subcommands: | ||
| path basename - Get the final component of a path | ||
| path dirname - Get the parent directory of a path | ||
| path exists - Check whether a path exists | ||
| path expand - Try to expand a path to its absolute form | ||
| path join - Join a structured path or a list of path parts. | ||
| path parse - Convert a path into structured data. | ||
| path relative-to - Get a path as relative to another path. | ||
| path split - Split a path into parts by a separator. | ||
| path type - Get the type of the object a path refers to (e.g., file, dir, symlink) | ||
|
|
||
| Flags: | ||
| -h, --help | ||
| Display this help message | ||
| help path | ||
| # => Explore and manipulate paths. | ||
| # => | ||
| # => There are three ways to represent a path: | ||
| # => | ||
| # => * As a path literal, e.g., '/home/viking/spam.txt' | ||
| # => * As a structured path: a table with 'parent', 'stem', and 'extension' (and | ||
| # => * 'prefix' on Windows) columns. This format is produced by the 'path parse' | ||
| # => subcommand. | ||
| # => * As an inner list of path parts, e.g., '[[ / home viking spam.txt ]]'. | ||
| # => Splitting into parts is done by the `path split` command. | ||
| # => | ||
| # => All subcommands accept all three variants as an input. Furthermore, the 'path | ||
| # => join' subcommand can be used to join the structured path or path parts back into | ||
| # => the path literal. | ||
| # => | ||
| # => Usage: | ||
| # => > path | ||
| # => | ||
| # => Subcommands: | ||
| # => path basename - Get the final component of a path | ||
| # => path dirname - Get the parent directory of a path | ||
| # => path exists - Check whether a path exists | ||
| # => path expand - Try to expand a path to its absolute form | ||
| # => path join - Join a structured path or a list of path parts. | ||
| # => path parse - Convert a path into structured data. | ||
| # => path relative-to - Get a path as relative to another path. | ||
| # => path split - Split a path into parts by a separator. | ||
| # => path type - Get the type of the object a path refers to (e.g., file, dir, symlink) | ||
| # => | ||
| # => Flags: | ||
| # => -h, --help | ||
| # => Display this help message |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.