rsh 0.22
rsh, or Rsh for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines.
Today, we're releasing 0.22 of Rsh. In this version, we introduce a new flattening command, more math commands, we remove it-expansion, and add a lot of assorted improvements.
Where to get it
Rsh 0.22 is available as
pre-built binaries
or from
crates.io. If you have Rust installed you can install it using
cargo install rsh.
If you want all the goodies, you can install
cargo install rsh --features=extra.
As part of this release, we also publish a set of plugins you
can install and use with Rsh. To install, use
cargo install rsh_plugin_<plugin name>.
What's New
New functionality
The flatten command (andrasio)
New flatten command
There's now a flatten command that can take tables nested inside of the main table and flatten their contents into the main table.
More math commands (morbatex, gillespiecd, fdncred)
You can now use rounding in math operations:
> echo [1.5 2.3 -3.1] | math ceil
───┬────
0 │ 2
1 │ 3
2 │ -3
───┴────
> echo [1.5 2.3 -3.1] | math floor
───┬────
0 │ 1
1 │ 2
2 │ -4
───┴────
> echo [1.5 2.3 -3.1] | math round
───┬────
0 │ 2
1 │ 2
2 │ -3
───┴────
Breaking changes
Remove it-expansion (jonathandturner)
Previously, we treated the $it variable as a
special variable that caused a command to iterate over each
element in the row, for example
ls | echo $it.name would expand to
ls | each { echo $it.name }.
While this was handy in small examples, in the general case it became confusing to remember when and how it-expansion would happen.
In this release, we're trying an experiment of removing it-expansion.
Previously:
ls | echo $it.name
Now:
ls | each { echo $it.name }
Or, you can switch to other forms, like:
ls | get name
We're working towards a simpler mental model, where blocks
can have parameters, and $it is the name of the
parameter if it's not specified.
Please try it out and let us know what you think.
Improvements
-
New - a
seqcommand for working with sequences (fdncred) - bson and sqlite support added to the WiX (fdncred)
to mdnow has a pretty flag (JosephTLyons)-
lscan now support other number formatting (lucassmmg) -
Filesize formats can now be changed via
config(fdncred) - Tables can now have heavy or no borders (fdncred)
math evalnow supports tau (rjboas)-
charnow has simpler weather emoji (gillespiecd, fdncred) -
str to-intnow takes an optional radix for conversion (gillespiecd) -
charcan now print any unicode character (fdncred) -
aliasnow has optional type inference based on the recently accepted RFC (LhKipp) -
lswill also list inode in-lmode on Unix (gillespiecd)
Internal improvements (andrasio, jonathandturner, LhKipp, EverlastingBugstopper, JosephTLyons, fdncred, jjshanks)
It's now easier to create column-paths inside of the Rsh
source, alias got some bugfixes, the parser got
some bugfixes, fixed typo in the build message, filesize labels
for bytes wasn't showing up (now fixed), internally there
are now more helpers for creating the core Value type, bumped
the required Rust version, bugfix for ; endings,
and remove unneeded comments.
Looking forward
We're continuing to work to simplify the internal representation, improve the parser, and work to add support for features like block parameters, variables, and, in the future, custom commands.
If you'd like to help out, come by the discord and say hello!