Home Explore Blog CI



nushell

2nd chunk of `blog/2020-01-07-nushell-0_8_0.md`
a8a5d1e069b25a00c53c50cbba96acad64c0d635861d6c120000000100000b56
It was time for Nu to move away from using this shortcut. Fixing the unwraps is a lot of work, but the end result is a codebase that reports errors more reliably and doesn't panic as often if something unexpected happens -- which just is what you want when you're making a shell!

We're happy to say there are now no more unwraps in the Nu codebase. We have more improvements in mind, but this already is a big upgrade from where we were a few weeks ago.

# Clippy cleanliness (thibran, vorot93, sophiajt)

Along the same theme of making code as clean as we can, we recently adopted using the `clippy` tool. Clippy is a tool to help point out common mistakes or inefficiencies in your Rust code. The end result of working through its warnings is often a cleaner looking codebase that's also a bit more efficient as a result.

The Nu codebase is now clippy-clean, and we're enforcing this on every new checkin to the codebase.

# Improved

## `which` gets better (avandesa)

```shell
> which which
───────┬──────────────────────────┬─────────
 arg   │ path                     │ builtin
───────┼──────────────────────────┼─────────
 which │ nushell built-in command │ Yes
───────┴──────────────────────────┴─────────
```

We're in the process of improving some of our existing built-in commands to make them more Nu-like. In this release, the `which` command has a bit more of a Nu-feel. It will tell you the path and if the command is an internal builtin command or an external command.

## `ps` gets better (sophiajt)

```
─────┬───────┬──────────────────────────────────────┬──────────┬─────────┬──────────┬──────────
 #   │ pid   │ name                                 │ status   │ cpu     │ mem      │ virtual
─────┼───────┼──────────────────────────────────────┼──────────┼─────────┼──────────┼──────────
 250 │  4729 │ ibus-engine-simple                   │ Sleeping │  0.0000 │   3.3 MB │ 176.7 MB
 251 │  5964 │ gedit                                │ Sleeping │  0.0000 │  29.2 MB │ 496.5 MB
 252 │  5860 │ seahorse                             │ Sleeping │  0.0000 │  24.0 MB │ 488.7 MB
 253 │  6594 │ gnome-terminal-server                │ Sleeping │  0.0000 │  47.8 MB │ 675.0 MB

Title: Nushell Improvements: Removing Unwraps, Clippy Cleanliness, and Enhanced Commands
Summary
Nushell has removed `.unwrap()` calls for better error reporting and stability. The codebase is now Clippy-clean, enforcing cleaner and more efficient code. The `which` command now provides a more Nu-like output, showing the path and whether a command is a built-in or external. The `ps` command has also been improved.