A new type of shell
Go to file
dependabot[bot] 4907575d3d
Bump chrono-tz from 0.8.6 to 0.10.0 (#14205)
Bumps [chrono-tz](https://github.com/chronotope/chrono-tz) from 0.8.6 to
0.10.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/chronotope/chrono-tz/releases">chrono-tz's
releases</a>.</em></p>
<blockquote>
<h2>chrono-tz v0.10.0: 2024b</h2>
<p><strong>TZDB</strong> version 2024b (2024-09-05).</p>
<h2>Changes</h2>
<ul>
<li>Make <code>OffsetName::abbreviation</code> return an
<code>Option</code>.
This reflects that numeric values such as <code>+11</code> are no longer
encoded in the upstream TZDB as abbreviations (<a
href="https://redirect.github.com/chronotope/chrono-tz/issues/185">#185</a>).</li>
</ul>
<h2>TZDB 2024b</h2>
<blockquote>
<p>The 2024b release of the tz code and data is available.</p>
<p>This release is prompted by the accumulated weight of many non-urgent
changes to both code and data. It changes one timestamp abbreviation,
for the long-obsolete System V setting TZ='MET'; see below. Otherwise,
the timestamps affected by this release all predate April 2008, so you
can skip this release if your application uses only tzdata and does not
use older timestamps.</p>
<p>This release contains the following changes:</p>
<h3>Briefly:</h3>
<p>Improve historical data for Mexico, Mongolia, and Portugal.
System V names are now obsolescent.
The main data form now uses %z.
The code now conforms to RFC 8536 for early timestamps.
Support POSIX.1-2024, which removes asctime_r and ctime_r.
Assume POSIX.2-1992 or later for shell scripts.
SUPPORT_C89 now defaults to 1.</p>
<h3>Changes to past timestamps</h3>
<p>Asia/Choibalsan is now an alias for Asia/Ulaanbaatar rather than
being a separate Zone with differing behavior before April 2008. This
seems better given our wildly conflicting information about Mongolia's
time zone history. (Thanks to Heitor David Pinto.)</p>
<p>Historical transitions for Mexico have been updated based on official
Mexican decrees. The affected timestamps occur during the years
1921-1927, 1931, 1945, 1949-1970, and 1981-1997. The affected zones are
America/Bahia_Banderas, America/Cancun, America/Chihuahua,
America/Ciudad_Juarez, America/Hermosillo, America/Mazatlan,
America/Merida, America/Mexico_City, America/Monterrey, America/Ojinaga,
and America/Tijuana. (Thanks to Heitor David Pinto.)</p>
<p>Historical transitions for Portugal, represented by Europe/Lisbon,
Atlantic/Azores, and Atlantic/Madeira, have been updated based on a
close reading of old Portuguese legislation, replacing previous data
mainly originating from Whitman and Shanks &amp; Pottenger. These
changes affect a few transitions in 1917-1921, 1924, and 1940 throughout
these regions by a few hours or days, and various timestamps between
1977 and 1993 depending on the region. In particular, the Azores and
Madeira did not observe DST from 1977 to 1981. Additionally, the
adoption of standard zonal time in former Portuguese colonies have been
adjusted: Africa/Maputo in 1909, and Asia/Dili by 22 minutes at the
start of 1912. (Thanks to Tim Parenti.)</p>
<h3>Changes to past tm_isdst flags</h3>
<p>The period from 1966-04-03 through 1966-10-02 in Portugal is now
modeled as DST, to more closely reflect how contemporaneous changes in
law entered into force.</p>
<h3>Changes to data</h3>
<p>Names present only for compatibility with UNIX System V (last
released in the 1990s) have been moved to 'backward'. These names, which
for post-1970 timestamps mostly just duplicate data of geographical
names, were confusing downstream uses. Names moved to 'backward' are now
links to geographical names. This affects behavior for TZ='EET' for some
pre-1981 timestamps, for TZ='CET' for some pre-1947 timestamps, and for
TZ='WET' for some pre-1996 timestamps. Also, TZ='MET' now behaves like
TZ='CET' and so uses the abbreviation &quot;CET&quot; rather than
&quot;MET&quot;. Those needing the previous TZDB behavior, which does
not match any real-world clocks, can find the old entries in 'backzone'.
(Problem reported by Justin Grant.)</p>
<p>The main source files' time zone abbreviations now use %z, supported
by zic since release 2015f and used in vanguard form since release
2022b. For example, America/Sao_Paulo now contains the zone continuation
line &quot;-3:00 Brazil %z&quot;, which is less error prone than the old
&quot;-3:00 Brazil -03/-02&quot;. This does not change the represented
data: the generated TZif files are unchanged. Rearguard form still
avoids %z, to support obsolescent parsers.</p>
<p>Asia/Almaty has been removed from zonenow.tab as it now agrees with
Asia/Tashkent for future timestamps, due to Kazakhstan's 2024-02-29 time
zone change. Similarly, America/Scoresbysund has been removed, as it now
agrees with America/Nuuk due to its 2024-03-31 time zone change.</p>
</blockquote>
<h2>chrono-tz v0.9.0: 2024a</h2>
<p><strong>TZDB</strong> version <a
href="https://mm.icann.org/pipermail/tz-announce/2024-February/000081.html">2024a</a>
(2024-02-01).</p>
<h2>Changes</h2>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="8450e59393"><code>8450e59</code></a>
Bump chrono-tz-build to 0.4.0</li>
<li><a
href="6154fd2513"><code>6154fd2</code></a>
Bump version number to 0.10.0</li>
<li><a
href="2d0c489781"><code>2d0c489</code></a>
Update tz submodule to 2024b</li>
<li><a
href="0acd431a54"><code>0acd431</code></a>
Make timezone name optional</li>
<li><a
href="2e955104a8"><code>2e95510</code></a>
Test numeric time zone names</li>
<li><a
href="2a675e2f84"><code>2a675e2</code></a>
chrono-tz-build: resolve fixme</li>
<li><a
href="ca52db80b5"><code>ca52db8</code></a>
chrono-tz-build: make phf gated by case-insensitive feature</li>
<li><a
href="e2f4215139"><code>e2f4215</code></a>
Prepare parse-zoneinfo v0.3.1</li>
<li><a
href="e6f87e20cc"><code>e6f87e2</code></a>
Symlink LICENSE in parse-zoneinfo</li>
<li><a
href="6e58ce21ca"><code>6e58ce2</code></a>
Remove <code>AsciiExt</code> import</li>
<li>Additional commits viewable in <a
href="https://github.com/chronotope/chrono-tz/compare/v0.8.6...v0.10.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=chrono-tz&package-manager=cargo&previous-version=0.8.6&new-version=0.10.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-30 10:14:04 -07:00
.cargo optimize aarch64 when able (#10433) 2023-09-21 03:57:07 +12:00
.githooks Add git hooks for formatting and running clippy (#8820) 2023-04-13 07:34:23 -05:00
.github Bump crate-ci/typos from 1.26.0 to 1.26.8 (#14203) 2024-10-30 10:50:41 +08:00
assets REFACTOR: clean the root of the repo (#9231) 2023-05-20 07:57:51 -05:00
benches Make IR the default evaluator (#13718) 2024-09-15 14:54:38 -07:00
crates Allow using function keys F21-F35 for keybindings (#14201) 2024-10-30 12:22:47 +01:00
devdocs Remove dataframes crate and feature (#12889) 2024-05-20 17:22:08 +00:00
docker Add RELEASE_QUERY_API build arg for Dockerfiles (#14209) 2024-10-30 06:45:15 -05:00
scripts chore: Add nu_plugin_polars to build and install scripts (#13550) 2024-08-06 15:23:56 -05:00
src Fix quoting in to nuon and refactor quoting functions (#14180) 2024-10-29 07:43:26 -05:00
tests Fix LSP non-ascii characters offset issues. (#14002) 2024-10-29 06:35:37 -05:00
wix change wix install method from perMachine to perUser (#12720) 2024-05-01 17:31:16 -05:00
.gitattributes Add Nushell Language detect for linguist (#9491) 2023-06-21 15:30:10 +08:00
.gitignore Add custom datetime format through strftime strings (#9500) 2023-06-23 15:05:04 -05:00
Cargo.lock Bump chrono-tz from 0.8.6 to 0.10.0 (#14205) 2024-10-30 10:14:04 -07:00
Cargo.toml Bump chrono-tz from 0.8.6 to 0.10.0 (#14205) 2024-10-30 10:14:04 -07:00
CITATION.cff Create CITATION.cff (#12983) 2024-06-06 08:53:34 +08:00
CODE_OF_CONDUCT.md First pass at updating all documentation formatting and cleaning up output of examples (#2031) 2020-06-24 06:21:47 +12:00
CONTRIBUTING.md Remove dataframes crate and feature (#12889) 2024-05-20 17:22:08 +00:00
Cross.toml Fix cross-compiling with cross-rs (#9972) 2023-08-09 22:08:35 -07:00
LICENSE Update LICENSE 2023-04-03 08:23:19 +12:00
README.md Make contributor image wider (#14138) 2024-10-21 21:59:52 +02:00
rust-toolchain.toml Update to rust 1.80.1 (#14106) 2024-10-20 23:14:11 +02:00
SECURITY.md Links to security contacts (#13488) 2024-07-30 17:05:56 +02:00
toolkit.nu ensure toolkit is using external cargo command (#13943) 2024-09-27 08:52:48 -05:00
typos.toml Bump typo with new ignore (#13563) 2024-08-08 06:50:28 +08:00

Nushell

Crates.io Build Status Nightly Build Discord The Changelog #363 @nu_shell GitHub commit activity GitHub contributors

A new type of shell.

Example of nushell

Table of Contents

Status

This project has reached a minimum-viable-product level of quality. Many people use it as their daily driver, but it may be unstable for some commands. Nu's design is subject to change as it matures.

Learning About Nu

The Nushell book is the primary source of Nushell documentation. You can find a full list of Nu commands in the book, and we have many examples of using Nu in our cookbook.

We're also active on Discord and Twitter; come and chat with us!

Installation

To quickly install Nu:

# Linux and macOS
brew install nushell
# Windows
winget install nushell

To use Nu in GitHub Action, check setup-nu for more detail.

Detailed installation instructions can be found in the installation chapter of the book. Nu is available via many package managers:

Packaging status

For details about which platforms the Nushell team actively supports, see our platform support policy.

Configuration

The default configurations can be found at sample_config which are the configuration files one gets when they startup Nushell for the first time.

It sets all of the default configuration to run Nushell. From here one can then customize this file for their specific needs.

To see where config.nu is located on your system simply type this command.

$nu.config-path

Please see our book for all of the Nushell documentation.

Philosophy

Nu draws inspiration from projects like PowerShell, functional programming languages, and modern CLI tools. Rather than thinking of files and data 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. As in the Unix philosophy, Nu allows commands to output to 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 (e.g., ls)
  • Commands that filter a stream (e.g., where type == "dir")
  • Commands that consume the output of the pipeline (e.g., table)

Commands are separated by the pipe symbol (|) to denote a pipeline flowing left to right.

> ls | where type == "dir" | table
╭────┬──────────┬──────┬─────────┬───────────────╮
│ #  │   name   │ type │  size   │   modified    │
├────┼──────────┼──────┼─────────┼───────────────┤
│  0 │ .cargo   │ dir  │     0 B │ 9 minutes ago │
│  1 │ assets   │ dir  │     0 B │ 2 weeks ago   │
│  2 │ crates   │ dir  │ 4.0 KiB │ 2 weeks ago   │
│  3 │ docker   │ dir  │     0 B │ 2 weeks ago   │
│  4 │ docs     │ dir  │     0 B │ 2 weeks ago   │
│  5 │ images   │ dir  │     0 B │ 2 weeks ago   │
│  6 │ pkg_mgrs │ dir  │     0 B │ 2 weeks ago   │
│  7 │ samples  │ dir  │     0 B │ 2 weeks ago   │
│  8 │ src      │ dir  │ 4.0 KiB │ 2 weeks ago   │
│  9 │ target   │ dir  │     0 B │ a day ago     │
│ 10 │ tests    │ dir  │ 4.0 KiB │ 2 weeks ago   │
│ 11 │ wix      │ dir  │     0 B │ 2 weeks ago   │
╰────┴──────────┴──────┴─────────┴───────────────╯

Because most of the time you'll want to see the output of a pipeline, table is assumed. We could have also written the above:

> ls | where type == "dir"

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 to get a list of the running processes, using the same where as above.

> ps | where cpu > 0
╭───┬───────┬───────────┬───────┬───────────┬───────────╮
│ # │  pid  │   name    │  cpu  │    mem    │  virtual  │
├───┼───────┼───────────┼───────┼───────────┼───────────┤
│ 02240 │ Slack.exe │ 16.40 │ 178.3 MiB │ 232.6 MiB │
│ 116948 │ Slack.exe │ 16.32 │ 205.0 MiB │ 197.9 MiB │
│ 217700 │ nu.exe    │  3.77 │  26.1 MiB │   8.8 MiB │
╰───┴───────┴───────────┴───────┴───────────┴───────────╯

Opening files

Nu can load file and URL contents as raw text or structured data (if it recognizes the format). For example, you can load a .toml file as structured data and explore it:

> open Cargo.toml
╭──────────────────┬────────────────────╮
│ bin              │ [table 1 row]      │
│ dependencies     │ {record 25 fields} │
│ dev-dependencies │ {record 8 fields}  │
│ features         │ {record 10 fields} │
│ package          │ {record 13 fields} │
│ patch            │ {record 1 field}   │
│ profile          │ {record 3 fields}  │
│ target           │ {record 3 fields}  │
│ workspace        │ {record 1 field}   │
╰──────────────────┴────────────────────╯

We can pipe this into a command that gets the contents of one of the columns:

> open Cargo.toml | get package
╭───────────────┬────────────────────────────────────╮
│ authors       │ [list 1 item]                      │
│ default-run   │ nu                                 │
│ description   │ A new type of shell                │
│ documentation │ https://www.nushell.sh/book/       │
│ edition       │ 2018                               │
│ exclude       │ [list 1 item]                      │
│ homepage      │ https://www.nushell.sh             │
│ license       │ MIT                                │
│ metadata      │ {record 1 field}                   │
│ name          │ nu                                 │
│ repository    │ https://github.com/nushell/nushell │
│ rust-version  │ 1.60                               │
│ version       │ 0.72.0                             │
╰───────────────┴────────────────────────────────────╯

And if needed we can drill down further:

> open Cargo.toml | get package.version
0.72.0

Plugins

Nu supports plugins that offer additional functionality to the shell and follow the same structured data model that built-in commands use. There are a few examples in the crates/nu_plugins_* directories.

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, making 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.

The awesome-nu repo lists a variety of nu-plugins while the showcase repo shows off informative blog posts that have been written about Nushell along with videos that highlight technical topics that have been presented.

Goals

Nu adheres closely to a set of goals that make up its design philosophy. As features are added, they are checked against these goals.

  • First and foremost, Nu is cross-platform. Commands and techniques should work across platforms and Nu has first-class support for Windows, macOS, and Linux.

  • Nu ensures compatibility with existing platform-specific executables.

  • Nu's workflow and tools should have the usability expected of modern software in 2022 (and beyond).

  • Nu views data as either structured or unstructured. It is a structured shell like PowerShell.

  • Finally, Nu views data functionally. Rather than using mutation, pipelines act as a means to load, change, and save data without mutable state.

Officially Supported By

Please submit an issue or PR to be added to this list.

Contributing

See Contributing for details. Thanks to all the people who already contributed!

License

The project is made available under the MIT license. See the LICENSE file for more information.