-
Notifications
You must be signed in to change notification settings - Fork 449
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
36 changed files
with
228 additions
and
226 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 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 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 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> |
This file contains 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 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 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 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 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 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 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 |
This file contains 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 @@ | ||
> ls | ||
╭────┬───────────────────────┬──────┬───────────┬─────────────╮ | ||
│ # │ name │ type │ size │ modified │ | ||
├────┼───────────────────────┼──────┼───────────┼─────────────┤ | ||
│ 0 │ 404.html │ file │ 429 B │ 3 days ago │ | ||
│ 1 │ CONTRIBUTING.md │ file │ 955 B │ 8 mins ago │ | ||
│ 2 │ Gemfile │ file │ 1.1 KiB │ 3 days ago │ | ||
│ 3 │ Gemfile.lock │ file │ 6.9 KiB │ 3 days ago │ | ||
│ 4 │ LICENSE │ file │ 1.1 KiB │ 3 days ago │ | ||
│ 5 │ README.md │ file │ 213 B │ 3 days ago │ | ||
... | ||
ls | ||
# => ╭────┬───────────────────────┬──────┬───────────┬─────────────╮ | ||
# => │ # │ name │ type │ size │ modified │ | ||
# => ├────┼───────────────────────┼──────┼───────────┼─────────────┤ | ||
# => │ 0 │ 404.html │ file │ 429 B │ 3 days ago │ | ||
# => │ 1 │ CONTRIBUTING.md │ file │ 955 B │ 8 mins ago │ | ||
# => │ 2 │ Gemfile │ file │ 1.1 KiB │ 3 days ago │ | ||
# => │ 3 │ Gemfile.lock │ file │ 6.9 KiB │ 3 days ago │ | ||
# => │ 4 │ LICENSE │ file │ 1.1 KiB │ 3 days ago │ | ||
# => │ 5 │ README.md │ file │ 213 B │ 3 days ago │ | ||
# => ... |
Oops, something went wrong.