内容简介:Nushell, or Nu 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 commandl
Nushell, or Nu 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.
We’re happy to announce the 0.9.0 release of Nu. This release offers better help and error feedback, better support for the native shell, new commands, lots of command improvements, and bugfixes.
Where to get it
Nu 0.9.0 is available as pre-built binaries or from crates.io . If you have Rust installed you can install it using cargo install nu
.
If you want more goodies, you can install cargo install nu --features=stable
.
As part of this release, we also publish a set of plugins you can install and use with Nu. To install, use cargo install nu_plugin_<plugin name>
.
What’s new
--help
available on all commands (Amanita-muscaria)
One of the first things a user might do in a new shell is to type a familiar command and pass it --help
. A perfectly reasonable thing to do, and with 0.9.0 it does exactly you’d expect. It will now print out the help information for the given command for all internal commands (much in the same way as using help <command name>
)
Better error feedback (wycats, andrasio)
Our improvements to the parser as part of 0.9.0 also come with some fun perks. One of these is that unknown flags, and similar errors, will now get highlighted red to let you know that this isn’t a valid input to the command.
Shelling out (jonathandturner)
An early feature of Nu that people that has been a popular request to bring back is “shelling out”. When Nu doesn’t recognize a command, it will try to find it as an external command. In the last few versions, this was limited as Nu was not able to execute shell scripts, .cmd scripts… basically anything that wasn’t an executable. The problem is that lots of apps use scripts as a way to configure what to execute (commands like code
, npm
, and others are common scripts behind the scenes).
With 0.9.0, we’re returning to our earlier behavior and executing both binaries and shell scripts by calling to the platform-native shell when we call an external command. While this should largely be invisible as a user, more things should “just work” how they would in bash or Windows Terminal.
New commands
du (Amanita-muscaria)
Nu now has its own du
command to show the disk usage of a part of the file system. This is a handy way of quickly looking for where all your free space went.
❯ du ───┬───────────────┬─────────┬──────────────── # │ name │ size │ contents ───┼───────────────┼─────────┼──────────────── 0 │ .git │ 4.7 MB │ [table 6 rows] 1 │ .jekyll-cache │ 49.0 KB │ [table 1 rows] 2 │ _includes │ 881 B │ 3 │ _layouts │ 4.3 KB │ 4 │ _posts │ 82.4 KB │ 5 │ _sass │ 21.5 KB │ 6 │ _site │ 5.3 MB │ [table 4 rows] 7 │ assets │ 2.4 MB │ [table 1 rows] 8 │ images │ 2.4 MB │ ───┴───────────────┴─────────┴────────────────
clear (JesterOrNot)
Short, sweet, and to the point, you can now clear
your screen with the new clear
command. Like our other commands, this works across all the platforms Nu runs on.
New welcome message (jonathandturner)
Welcome to Nushell 0.9.0 (type 'help' for more info) nushell on :orange_book: bump_to_0_9_0 is :package: v0.9.0 via v1.40.0 ❯
The first time you open Nu now you’ll be greeted by a brief message to tell you the version of Nu and a reminder to use the help
command to learn more about Nu and how it works.
Improved table streaming (jonathandturner)
If you’ve used earlier versions of Nu, you may have wondered why every 50 rows we start a new table. This is where the implementation showed through a bit more than it should. As tables are printed, they are created and then displayed as enough rows are available. This means that output will spool to the screen and not wait for the table to finish processing before you see something. In general, it’s good to see the tables earlier, but seeing a different shape of table every 50 rows can be annoying.
We’ve updated table output to be a lot cleaner, using this logic:
- If rows are being output quickly, build a larger table before outputting it
- If rows are being output slowly, buffer a smaller number of rows and display them (just as before)
- If rows change shape, switch to showing a different table. This helps you visually see when your data source is giving you a new kind of data
Command improvements
ls
and rm
now error when a path isn’t found (Amanita-muscaria)
Adding a bit of polish this release, ls
and rm
will now error if you pass them a path they can’t find.
ls
can optionally show just the filename (coolshaurya)
If you’ve used ls
on your subdirectories, you might have noticed that the subdirectory becomes part of the filename. This can be great for building up a pipeline (and a script in the future), but sometimes all you care about is the filename. You can now pass ls
the --short-names
command flag to get just the filename.
ls
can also optionally show symlink targets (JosephTLyons)
Further improving ls
, you can now see the symlink targets with the --full
flag.
ls
smaller by default, now with more info with --full
(jonathandturner)
To make Nu easier to use on smaller terminals, the ls
command will now try to take up less space by default. The columns from earlier version of Nu (and a few more!) are still available, now behind the --full
flag.
from-xml
now includes attributes (Borimino)
One of the first commands we built to import file data into Nu was from-xml
. It was good enough to get started, and with 0.9.0 it improves to being a more precise representation of what’s in the XML file. The command will now include attribute values as part of the table.
sort-by
works with more value types (koenaad)
Our sorting command sort-by
can now work over more value types, which simplifies some common sorting tasks.
debug
now pretty-prints its output (sandorex)
When working on Nu itself, there’s a handy debug
command which gives you all the information about the value coming through the pipeline. This is now prett-printed by default to make it easier to read.
autocompletion can now be configured (Jacobious52)
Autocompletion at the Nu prompt can now be changed between circular (the default) and list.
> config --set [completion_mode list]
More improvements to which
(avandesa)
The structured which
continues to improve 0.9.0 and will now give an error in cases that it could not be performed correctly.
Improvements to calling external commands (thegedge, andrasio, koenaad)
A batch of improvements should allow external commands to feel a bit faster and work more consistently with the pipeline.
Documentation
More command docs (coolshaurya)
We’re continuing to document the commands that are available and continue filling out command documentation where it’s missing.
More READMEs and code documentation (notryanb, jonathandturner)
Contributors to Nu will also appreciate that we’re working our way through the code and source repositories and documenting how each part works. This should help developers get used to Nu from the inside and find a much easier path to jump in.
Looking ahead
With 0.9.0, we’ve added a lot of “quality of life” improvements that we hope you enjoy. We’d love to hear from you how 0.9.0 works for you.
Next release will be 0.10.0, as we continue to improve Nu. We’re excited about what’s coming, and can’t wait to play with it ourselves!
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网
猜你喜欢:本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Mashups Web 2.0开发技术—— 基于Amazon.com
萨拉汉 / 吴宏泉 / 清华大学 / 2008-1 / 48.00元
《MashupsWeb2.0开发技术(基于Amazon.Com) 》介绍了mashup的底层技术,并且第一次展示了如何创建mashup的应用程序。Amazon.com与Web服务强势结合,拓展了Internet的应用范围,使得开发人员可以把Amazon的数据和其他的可利用资源自由地结合起来创建功能丰富的全新应用程序,这种应用程序叫做mashup。 《MashupsWeb2.0开发技术(基于A......一起来看看 《Mashups Web 2.0开发技术—— 基于Amazon.com》 这本书的介绍吧!