mirror of
https://github.com/nushell/nushell.git
synced 2024-11-28 03:13:44 +01:00
Fix whitespace and typos (#1481)
* Remove EOL whitespace in files other than docs * Break paragraphs into lines See http://rhodesmill.org/brandon/2012/one-sentence-per-line/ for the rationale * Fix various typos * Remove EOL whitespace in docs/commands/*.md
This commit is contained in:
parent
5b0b2f1ddd
commit
5ca9e12b7f
@ -59,4 +59,3 @@ steps:
|
||||
- bash: cargo fmt --all -- --check
|
||||
condition: eq(variables['style'], 'fmt')
|
||||
displayName: Lint
|
||||
|
||||
|
52
README.md
52
README.md
@ -13,15 +13,22 @@ A new type of shell.
|
||||
|
||||
# Status
|
||||
|
||||
This project has reached a minimum-viable product level of quality. While contributors dogfood it as their daily driver, it may be unstable for some commands. Future releases will work to fill out missing features and improve stability. Its design is also subject to change as it matures.
|
||||
This project has reached a minimum-viable product level of quality.
|
||||
While contributors dogfood it as their daily driver, it may be unstable for some commands.
|
||||
Future releases will work to fill out missing features and improve stability.
|
||||
Its design is also subject to change as it matures.
|
||||
|
||||
Nu comes with a set of built-in commands (listed below). If a command is unknown, the command will shell-out and execute it (using cmd on Windows or bash on Linux and macOS), correctly passing through stdin, stdout, and stderr, so things like your daily git workflows and even `vim` will work just fine.
|
||||
Nu comes with a set of built-in commands (listed below).
|
||||
If a command is unknown, the command will shell-out and execute it (using cmd on Windows or bash on Linux and macOS), correctly passing through stdin, stdout, and stderr, so things like your daily git workflows and even `vim` will work just fine.
|
||||
|
||||
# Learning more
|
||||
|
||||
There are a few good resources to learn about Nu. There is a [book](https://www.nushell.sh/book/) about Nu that is currently in progress. The book focuses on using Nu and its core concepts.
|
||||
There are a few good resources to learn about Nu.
|
||||
There is a [book](https://www.nushell.sh/book/) about Nu that is currently in progress.
|
||||
The book focuses on using Nu and its core concepts.
|
||||
|
||||
If you're a developer who would like to contribute to Nu, we're also working on a [book for developers](https://www.nushell.sh/contributor-book/) to help you get started. There are also [good first issues](https://github.com/nushell/nushell/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) to help you dive in.
|
||||
If you're a developer who would like to contribute to Nu, we're also working on a [book for developers](https://www.nushell.sh/contributor-book/) to help you get started.
|
||||
There are also [good first issues](https://github.com/nushell/nushell/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) to help you dive in.
|
||||
|
||||
We also have an active [Discord](https://discord.gg/NtAbbGn) and [Twitter](https://twitter.com/nu_shell) if you'd like to come and chat with us.
|
||||
|
||||
@ -107,11 +114,18 @@ The second container is a bit smaller if the size is important to you.
|
||||
|
||||
# Philosophy
|
||||
|
||||
Nu draws inspiration from projects like PowerShell, functional programming languages, and modern CLI tools. Rather than thinking of files and services as raw streams of text, Nu looks at each input as something with structure. For example, when you list the contents of a directory, what you get back is a table of rows, where each row represents an item in that directory. These values can be piped through a series of steps, in a series of commands called a 'pipeline'.
|
||||
Nu draws inspiration from projects like PowerShell, functional programming languages, and modern CLI tools.
|
||||
Rather than thinking of files and services as raw streams of text, Nu looks at each input as something with structure.
|
||||
For example, when you list the contents of a directory, what you get back is a table of rows, where each row represents an item in that directory.
|
||||
These values can be piped through a series of steps, in a series of commands called a 'pipeline'.
|
||||
|
||||
## Pipelines
|
||||
|
||||
In Unix, it's common to pipe between commands to split up a sophisticated command over multiple steps. Nu takes this a step further and builds heavily on the idea of _pipelines_. Just as the Unix philosophy, Nu allows commands to output from stdout and read from stdin. Additionally, commands can output structured data (you can think of this as a third kind of stream). Commands that work in the pipeline fit into one of three categories:
|
||||
In Unix, it's common to pipe between commands to split up a sophisticated command over multiple steps.
|
||||
Nu takes this a step further and builds heavily on the idea of _pipelines_.
|
||||
Just as the Unix philosophy, Nu allows commands to output from stdout and read from stdin.
|
||||
Additionally, commands can output structured data (you can think of this as a third kind of stream).
|
||||
Commands that work in the pipeline fit into one of three categories:
|
||||
|
||||
* Commands that produce a stream (eg, `ls`)
|
||||
* Commands that filter a stream (eg, `where type == "Directory"`)
|
||||
@ -135,13 +149,15 @@ Commands are separated by the pipe symbol (`|`) to denote a pipeline flowing lef
|
||||
────┴───────────┴───────────┴──────────┴────────┴──────────────┴────────────────
|
||||
```
|
||||
|
||||
Because most of the time you'll want to see the output of a pipeline, `autoview` is assumed. We could have also written the above:
|
||||
Because most of the time you'll want to see the output of a pipeline, `autoview` is assumed.
|
||||
We could have also written the above:
|
||||
|
||||
```
|
||||
/home/jonathan/Source/nushell(master)> ls | where type == Directory
|
||||
```
|
||||
|
||||
Being able to use the same commands and compose them differently is an important philosophy in Nu. For example, we could use the built-in `ps` command as well to get a list of the running processes, using the same `where` as above.
|
||||
Being able to use the same commands and compose them differently is an important philosophy in Nu.
|
||||
For example, we could use the built-in `ps` command as well to get a list of the running processes, using the same `where` as above.
|
||||
|
||||
```text
|
||||
/home/jonathan/Source/nushell(master)> ps | where cpu > 0
|
||||
@ -157,7 +173,8 @@ Being able to use the same commands and compose them differently is an important
|
||||
|
||||
## Opening files
|
||||
|
||||
Nu can load file and URL contents as raw text or as structured data (if it recognizes the format). For example, you can load a .toml file as structured data and explore it:
|
||||
Nu can load file and URL contents as raw text or as structured data (if it recognizes the format).
|
||||
For example, you can load a .toml file as structured data and explore it:
|
||||
|
||||
```
|
||||
/home/jonathan/Source/nushell(master)> open Cargo.toml
|
||||
@ -210,19 +227,26 @@ To set one of these variables, you can use `config --set`. For example:
|
||||
|
||||
## Shells
|
||||
|
||||
Nu will work inside of a single directory and allow you to navigate around your filesystem by default. Nu also offers a way of adding additional working directories that you can jump between, allowing you to work in multiple directories at the same time.
|
||||
Nu will work inside of a single directory and allow you to navigate around your filesystem by default.
|
||||
Nu also offers a way of adding additional working directories that you can jump between, allowing you to work in multiple directories at the same time.
|
||||
|
||||
To do so, use the `enter` command, which will allow you create a new "shell" and enter it at the specified path. You can toggle between this new shell and the original shell with the `p` (for previous) and `n` (for next), allowing you to navigate around a ring buffer of shells. Once you're done with a shell, you can `exit` it and remove it from the ring buffer.
|
||||
To do so, use the `enter` command, which will allow you create a new "shell" and enter it at the specified path.
|
||||
You can toggle between this new shell and the original shell with the `p` (for previous) and `n` (for next), allowing you to navigate around a ring buffer of shells.
|
||||
Once you're done with a shell, you can `exit` it and remove it from the ring buffer.
|
||||
|
||||
Finally, to get a list of all the current shells, you can use the `shells` command.
|
||||
|
||||
## Plugins
|
||||
|
||||
Nu supports plugins that offer additional functionality to the shell and follow the same structured data model that built-in commands use. This allows you to extend nu for your needs.
|
||||
Nu supports plugins that offer additional functionality to the shell and follow the same structured data model that built-in commands use.
|
||||
This allows you to extend nu for your needs.
|
||||
|
||||
There are a few examples in the `plugins` directory.
|
||||
|
||||
Plugins are binaries that are available in your path and follow a `nu_plugin_*` naming convention. These binaries interact with nu via a simple JSON-RPC protocol where the command identifies itself and passes along its configuration, which then makes it available for use. If the plugin is a filter, data streams to it one element at a time, and it can stream data back in return via stdin/stdout. If the plugin is a sink, it is given the full vector of final data and is given free reign over stdin/stdout to use as it pleases.
|
||||
Plugins are binaries that are available in your path and follow a `nu_plugin_*` naming convention.
|
||||
These binaries interact with nu via a simple JSON-RPC protocol where the command identifies itself and passes along its configuration, which then makes it available for use.
|
||||
If the plugin is a filter, data streams to it one element at a time, and it can stream data back in return via stdin/stdout.
|
||||
If the plugin is a sink, it is given the full vector of final data and is given free reign over stdin/stdout to use as it pleases.
|
||||
|
||||
# Goals
|
||||
|
||||
@ -244,5 +268,5 @@ You can find a list of Nu commands, complete with documentation, in [quick comma
|
||||
|
||||
# License
|
||||
|
||||
The project is made available under the MIT license. See "LICENSE" for more information.
|
||||
The project is made available under the MIT license. See the `LICENSE` file for more information.
|
||||
|
||||
|
@ -87,8 +87,8 @@ Here are some tips to help you get started.
|
||||
* help commands - list all available commands
|
||||
* help <command name> - display help about a particular command
|
||||
|
||||
Nushell works on the idea of a "pipeline". Pipelines are commands connected with the '|' character. Each stage
|
||||
in the pipeline works together to load, parse, and display information to you.
|
||||
Nushell works on the idea of a "pipeline". Pipelines are commands connected with the '|' character.
|
||||
Each stage in the pipeline works together to load, parse, and display information to you.
|
||||
|
||||
[Examples]
|
||||
|
||||
|
@ -80,7 +80,7 @@ fn pick(
|
||||
"No data to fetch.",
|
||||
format!("Couldn't pick column \"{}\"", column),
|
||||
path_member_tried.span,
|
||||
format!("How about exploring it with \"get\"? Check the input is appropiate originating from here"),
|
||||
format!("How about exploring it with \"get\"? Check the input is appropriate originating from here"),
|
||||
obj_source.tag.span)
|
||||
}
|
||||
|
||||
|
2
crates/nu-cli/src/env/environment_syncer.rs
vendored
2
crates/nu-cli/src/env/environment_syncer.rs
vendored
@ -208,7 +208,7 @@ mod tests {
|
||||
assert_eq!(actual, expected);
|
||||
});
|
||||
|
||||
// Now confirm in-memory environment variables synced appropiately
|
||||
// Now confirm in-memory environment variables synced appropriately
|
||||
// including the newer one accounted for.
|
||||
let environment = actual.env.lock();
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
The `nu-source` crate contains types and traits used for keeping track of _metadata_ about values being processed.
|
||||
Nu uses `Tag`s to keep track of where a value came from, an `AnchorLocation`,
|
||||
as well as positional information about the value, a `Span`.
|
||||
An `AchorLocation` can be a `Url`, `File`, or `Source` text that a value was parsed from.
|
||||
An `AnchorLocation` can be a `Url`, `File`, or `Source` text that a value was parsed from.
|
||||
The source `Text` is special in that it is a type similar to a `String` that comes with the ability to be cheaply cloned.
|
||||
A `Span` keeps track of a value's `start` and `end` positions.
|
||||
These types make up the metadata for a value and are wrapped up together in a `Tagged` struct,
|
||||
@ -20,11 +20,15 @@ In the following example Nu is able to report to the user where the typo of a co
|
||||
| ^^^ did you mean 'type'?
|
||||
```
|
||||
|
||||
In addition to metadata tracking, `nu-source` also contains types and traits related to debugging, tracing, and formatting the metadata and values it processes.
|
||||
In addition to metadata tracking, `nu-source` also contains types and traits
|
||||
related to debugging, tracing, and formatting the metadata and values it processes.
|
||||
|
||||
## Other Resources
|
||||
- [Nushell Github Project](https://github.com/nushell): Contains all projects in the Nushell ecosystem such as the source code to Nushell as well as website and books.
|
||||
- [Nushell Git Repository](https://github.com/nushell/nushell): A direct link to the source git repository for Nushell
|
||||
- [Nushell Contributor Book](https://github.com/nushell/contributor-book): An overview of topics about Nushell to help you get started contributing to the project.
|
||||
- [Nushell Github Project](https://github.com/nushell):
|
||||
Contains all projects in the Nushell ecosystem such as the source code to Nushell as well as website and books.
|
||||
- [Nushell Git Repository](https://github.com/nushell/nushell):
|
||||
A direct link to the source git repository for Nushell
|
||||
- [Nushell Contributor Book](https://github.com/nushell/contributor-book):
|
||||
An overview of topics about Nushell to help you get started contributing to the project.
|
||||
- [Discord Channel](https://discordapp.com/invite/NtAbbGn)
|
||||
- [Twitter](https://twitter.com/nu_shell)
|
@ -1,6 +1,6 @@
|
||||
# from-csv
|
||||
|
||||
Converts csv data into table. Use this when nushell cannot dertermine the input file extension.
|
||||
Converts csv data into table. Use this when nushell cannot determine the input file extension.
|
||||
|
||||
## Example
|
||||
|
||||
@ -69,7 +69,7 @@ chameleon; Linda; 1
|
||||
━━━┷━━━━━━━━━━━┷━━━━━━━━━┷━━━━━━
|
||||
```
|
||||
|
||||
To use this command to open a csv with separators other than a comma, use the `--raw` switch of `open` to open the csv, othewise the csv will enter `from-csv` as a table split on commas rather than raw text.
|
||||
To use this command to open a csv with separators other than a comma, use the `--raw` switch of `open` to open the csv, otherwise the csv will enter `from-csv` as a table split on commas rather than raw text.
|
||||
|
||||
```shell
|
||||
> mv pets.txt pets.csv
|
||||
|
@ -10,7 +10,7 @@ Syntax: `get ...args`
|
||||
|
||||
## Examples
|
||||
|
||||
If we run `sys` we recieve a table which contains tables itself:
|
||||
If we run `sys` we receive a table which contains tables itself:
|
||||
|
||||
```shell
|
||||
> sys
|
||||
@ -22,7 +22,7 @@ If we run `sys` we recieve a table which contains tables itself:
|
||||
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━
|
||||
```
|
||||
|
||||
To access one of the embeded tables we can use the `get` command
|
||||
To access one of the embedded tables we can use the `get` command
|
||||
|
||||
```shell
|
||||
> sys | get cpu
|
||||
|
@ -37,7 +37,7 @@ We can use the `group-by` command on 'UN statistical region' to create a table p
|
||||
━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━
|
||||
```
|
||||
|
||||
Now we can already get some informations like "which continental regions are there" and "how many countries are in each region".
|
||||
Now we can already get some information like "which continental regions are there" and "how many countries are in each region".
|
||||
If we want to see only the countries in the continental region of Oceania we can type:
|
||||
|
||||
```shell
|
||||
|
@ -1,7 +1,7 @@
|
||||
# help
|
||||
|
||||
Use `help` for more information on a command.
|
||||
Use `help commands` to list all availble commands.
|
||||
Use `help commands` to list all available commands.
|
||||
Use `help <command name>` to display help about a particular command.
|
||||
|
||||
## Examples
|
||||
|
@ -6,7 +6,7 @@ Syntax: `split-column <separator> ...args{flags}`
|
||||
|
||||
### Parameters
|
||||
|
||||
* `<seperator>`: string that denotes what separates columns
|
||||
* `<separator>`: string that denotes what separates columns
|
||||
* `args`: column names to give the new columns. If not specified they will be set to `Column1` `Column2` ...
|
||||
|
||||
### Flags
|
||||
|
Loading…
Reference in New Issue
Block a user