Path to this page:
Subject: CVS commit: pkgsrc/shells/nushell
From: pin
Date: 2023-04-05 10:05:14
Message id: 20230405080514.8C9D8FA81@cvs.NetBSD.org
Log Message:
shell/nushell: update to 0.78.0
Themes of this release / New features
- Pattern matching (jt)
With 0.78, Nushell now comes with the match expression, which allows you to
do pattern matching on a value. It supports a variety of different kinds of
patterns, which can be mixed and matched to create more complicated patterns.
- Alias changes (kubouch)
- Aliases now can shadow
We've updated the new alias command we introduced in 0.77 to work more
closely to the previous one.
- Alias can be named the same as the aliased command
- Old alias still keeps working
Since there are still some remaining issues to fix with the new alias
implementation, we still keep old-alias around for this release.
- Speed improvements (jt)
We've sped up the performance of tight loops like for and while considerably
in this release.
- Optional cell path members (rgwood)
In Nu 0.78, you can use ? in cell paths to suppress errors from missing data.
? is a more convenient+powerful version of the -i/--ignore-errors flag on
get and select.
- better error handling in error make (amtoine in #8511 and #8570)
The error make command now gives better hints about why the format is not a
valid error make format:
- with an empty format, error make {} will say that there is a "missing
required member $.msg"
- with an empty $.label, error make {msg: "message", label: {}} \
will say
there is a "missing required member $.label.text"
- finally, when $.label.start / $.label.end is not defined while the other
is, error make will give a hint as to add the missing one to the format!
The second change disallow the use of a $.label.start greater than
$.label.end as a span.
- Support for pretty output format in to nuon (amtoine)
The to nuon command can now output pretty NUON data with whitespaces for
better readability.
The default behaviour still is to output everything on a single line,
encouraging users to leverage the compactness of the NUON data format.
- New math exp command (lesves)
To complement the math ln command, we now include a math exp command for
exponentiation with the base e.
Breaking changes
- let requires surrounding parentheses for saving command output
let x = ls will not run the ls command anymore. If you need to save the
output of a command, you need to wrap it in parentheses: let x = (ls).
- || now required in closures
To help differentiate between blocks (which can mutate variables) and
closures (which can be used in a pipeline), we've changed the syntax of
closures to require ||. This means the simplest closure now looks like {|| }
- We no longer automatically print values as part of a script
We've changed the automatic-printing rules for scripts and the REPL to now
only automatically print the last value. This means two major breaking
changes:
- We no longer automatically print loop values
- We no longer print the results of every line automatically, requiring
you to do it manually
- Bare words can't start with a number
Words that start with a number or are in some way number-like must now must
be wrapped in backticks to be treated at a bare word or wrapped in quotes to
be a string
- Fields can only be defined once
You can no longer redefine a field in a record during initialization
- Thread configuration moves to par-each
Nushell no longer accepts the -t/--threads flag to the binary as it's now
part of par-each
- Ranges become the standard range specifier
str substring now only accepts ranges as does bytes at
- Alias recursion has been disabled
- Empty lists handled more consistently
[] | select foo now returns an empty list instead of null and sort, uniq,
sort-by, and uniq-by now return empty lists when given an empty list
(previously they would throw an error)
These changes make it easier to work with lists of unknown size.
- Comparison operators now allow null
Previously expressions like 1 < null would error; now they return null
Files: