Skip to content

Commit

Permalink
Update prettier config and run code format (#479)
Browse files Browse the repository at this point in the history
  • Loading branch information
hustcer committed Jun 3, 2022
1 parent 73cb0e1 commit f2c8586
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 58 deletions.
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ dataframes.md
nushell_map.md
*_bash*.md
book/commands/*.md
.vuepress/.temp
.vuepress/.cache
.vuepress/dist/
114 changes: 57 additions & 57 deletions blog/2022-04-12-nushell_0_61.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,69 +44,69 @@ Just as we added 'config.nu' with 0.60, we're now adding a new additional startu

# Features

* `input` can now [suppress output](https://github.com/nushell/nushell/pull/5017) (dev-msp)
* [Termux/Android target support for new engine](https://github.com/nushell/nushell/pull/4956) (dscottboggs)
* `open` can now use [`from ...` named custom commands](https://github.com/nushell/nushell/pull/5049) (neosam)
* New [`sort` command for easier sorting](https://github.com/nushell/nushell/pull/5054) (jt)
* `date to-record` for [working with structured dates](https://github.com/nushell/nushell/pull/5058) (jt)
* New [starts-with operator](https://github.com/nushell/nushell/pull/5061) (fdncred)
* Can now create [generic menus for repl interactions](https://github.com/nushell/nushell/pull/5085) (elferherrera)
* New [`glob` command for fancier globbing](https://github.com/nushell/nushell/pull/5087) (fdncred)
* [Unary `not` support](https://github.com/nushell/nushell/pull/5111) (jt)
* Startup and pre-prompt setup should now be [significantly faster](https://github.com/nushell/nushell/pull/5115) (jt)
* [`0b[...]` support for binary literals](https://github.com/nushell/nushell/pull/5149) (merkrafter)
- `input` can now [suppress output](https://github.com/nushell/nushell/pull/5017) (dev-msp)
- [Termux/Android target support for new engine](https://github.com/nushell/nushell/pull/4956) (dscottboggs)
- `open` can now use [`from ...` named custom commands](https://github.com/nushell/nushell/pull/5049) (neosam)
- New [`sort` command for easier sorting](https://github.com/nushell/nushell/pull/5054) (jt)
- `date to-record` for [working with structured dates](https://github.com/nushell/nushell/pull/5058) (jt)
- New [starts-with operator](https://github.com/nushell/nushell/pull/5061) (fdncred)
- Can now create [generic menus for repl interactions](https://github.com/nushell/nushell/pull/5085) (elferherrera)
- New [`glob` command for fancier globbing](https://github.com/nushell/nushell/pull/5087) (fdncred)
- [Unary `not` support](https://github.com/nushell/nushell/pull/5111) (jt)
- Startup and pre-prompt setup should now be [significantly faster](https://github.com/nushell/nushell/pull/5115) (jt)
- [`0b[...]` support for binary literals](https://github.com/nushell/nushell/pull/5149) (merkrafter)

# Improvements

* Parser improvements by uasi, jt, rgwood
* Error improvements by jmoore34, jt, rgwood
* Documentation updates by hustcer, vishalsodani, fdncred, futile, kubouch, stormasm, Hofer-Julian, herlon214, rgwood, michel-slm
* General code cleanliness fixes by stormasm, bowlofeggs, rgwood, sholderbach, fdncred, herlon214, elferherrera, boyvanduuren, jt
* Multiple improvements to known external commands (filaretov, jt)
* [Use recent miette](https://github.com/nushell/nushell/pull/5167) (zkat)
* [Improved logic to path expansion](https://github.com/nushell/nushell/pull/5153) (strega-nil-ms)
* [`ls` now outputs date in local time](https://github.com/nushell/nushell/pull/5141) (fdncred)
* [`$in` should now work in more places](https://github.com/nushell/nushell/pull/5137) (jt)
* [`each` now also pipes each item as input to the block](https://github.com/nushell/nushell/pull/5136) (jt)
* Add ability to [opt-in to normal strings in `str replace`](https://github.com/nushell/nushell/pull/5133) (fdncred)
* `touch` now [includes all common flags](https://github.com/nushell/nushell/pull/5119) (rybertm)
* `=~` and `!~` now [use regex](https://github.com/nushell/nushell/pull/5117) (rgwood)
* `describe` should now be [more precise](https://github.com/nushell/nushell/pull/5116)
* completions now [give priority to non-hidden folders](https://github.com/nushell/nushell/pull/5108) (herlon214)
* [plugins are now loaded for scripts and commands](https://github.com/nushell/nushell/pull/5105) (jt)
* [`input` now trims the newline](https://github.com/nushell/nushell/pull/5097) (rgwood)
* [regex `find` now works with records](https://github.com/nushell/nushell/pull/5100) (fdncred)
* Fixes to [`format` for non-basic datatypes](https://github.com/nushell/nushell/pull/5095) (rgwood)
* Added [raw string support via backticks](https://github.com/nushell/nushell/pull/5090) (jt)
* Switched to [levenshtein distance sorting for completions](https://github.com/nushell/nushell/pull/5001) (jt)
* Improvements to [line editor state handling](https://github.com/nushell/nushell/pull/5041) (sholderbach)
* Treat [prompt indicators as commands](https://github.com/nushell/nushell/pull/5026) (elferherrera)
* Added [record, list, and table to signature types](https://github.com/nushell/nushell/pull/5040) (kubouch)
* Improvements to [default git completions](https://github.com/nushell/nushell/pull/5016) (naufraghi)
* Prompts [can now be simple strings](https://github.com/nushell/nushell/pull/5052) (jt)
* Sets [LAST_EXIT_CODE on parse errors](https://github.com/nushell/nushell/pull/5084) (rgwood)
* Passed [more metadata through filter commands](https://github.com/nushell/nushell/pull/5009) (rrcwang)
* `last` now returns a [simple value for single items](https://github.com/nushell/nushell/pull/5060) (jt)
* Fixed [loops not terminating with ctrl-c](https://github.com/nushell/nushell/pull/5003) (jt)
* Added [bounded channels for backpressure](https://github.com/nushell/nushell/pull/4986) (b333z)
* Added [streaming support to `save`](https://github.com/nushell/nushell/pull/4985) (b333z)
* [Support for passing binary data into run-external](https://github.com/nushell/nushell/pull/4984) (b333z)
* [Fix for alias imports](https://github.com/nushell/nushell/pull/4968) (filaretov, jt)
* [Fix for `ls` when file is a socket on macOS](https://github.com/nushell/nushell/pull/4983) (fdncred)
* [Better tilde expansion](https://github.com/nushell/nushell/pull/4974) (filaretov)
* Added [keywords to help messages](https://github.com/nushell/nushell/pull/4978) (kubouch)
* Removed [is_private from `$nu.scope.commands`](https://github.com/nushell/nushell/pull/4979) (kubouch)
* [Fix for `path join` on streams](https://github.com/nushell/nushell/pull/4959) (jt)
* [Fixes to environment defaults](https://github.com/nushell/nushell/pull/4960) (jt)
* [Adding escapes to `to nuon`](https://github.com/nushell/nushell/pull/4964) (jt)
* Improvements to the [`reject` command](https://github.com/nushell/nushell/pull/4951) (jt)
* Fix to the [precedence parser](https://github.com/nushell/nushell/pull/4947) (jt)
* Calling out through `cmd.exe` [no longer uses AutoRun](https://github.com/nushell/nushell/pull/4903) (LebsterFace)
- Parser improvements by uasi, jt, rgwood
- Error improvements by jmoore34, jt, rgwood
- Documentation updates by hustcer, vishalsodani, fdncred, futile, kubouch, stormasm, Hofer-Julian, herlon214, rgwood, michel-slm
- General code cleanliness fixes by stormasm, bowlofeggs, rgwood, sholderbach, fdncred, herlon214, elferherrera, boyvanduuren, jt
- Multiple improvements to known external commands (filaretov, jt)
- [Use recent miette](https://github.com/nushell/nushell/pull/5167) (zkat)
- [Improved logic to path expansion](https://github.com/nushell/nushell/pull/5153) (strega-nil-ms)
- [`ls` now outputs date in local time](https://github.com/nushell/nushell/pull/5141) (fdncred)
- [`$in` should now work in more places](https://github.com/nushell/nushell/pull/5137) (jt)
- [`each` now also pipes each item as input to the block](https://github.com/nushell/nushell/pull/5136) (jt)
- Add ability to [opt-in to normal strings in `str replace`](https://github.com/nushell/nushell/pull/5133) (fdncred)
- `touch` now [includes all common flags](https://github.com/nushell/nushell/pull/5119) (rybertm)
- `=~` and `!~` now [use regex](https://github.com/nushell/nushell/pull/5117) (rgwood)
- `describe` should now be [more precise](https://github.com/nushell/nushell/pull/5116)
- completions now [give priority to non-hidden folders](https://github.com/nushell/nushell/pull/5108) (herlon214)
- [plugins are now loaded for scripts and commands](https://github.com/nushell/nushell/pull/5105) (jt)
- [`input` now trims the newline](https://github.com/nushell/nushell/pull/5097) (rgwood)
- [regex `find` now works with records](https://github.com/nushell/nushell/pull/5100) (fdncred)
- Fixes to [`format` for non-basic datatypes](https://github.com/nushell/nushell/pull/5095) (rgwood)
- Added [raw string support via backticks](https://github.com/nushell/nushell/pull/5090) (jt)
- Switched to [levenshtein distance sorting for completions](https://github.com/nushell/nushell/pull/5001) (jt)
- Improvements to [line editor state handling](https://github.com/nushell/nushell/pull/5041) (sholderbach)
- Treat [prompt indicators as commands](https://github.com/nushell/nushell/pull/5026) (elferherrera)
- Added [record, list, and table to signature types](https://github.com/nushell/nushell/pull/5040) (kubouch)
- Improvements to [default git completions](https://github.com/nushell/nushell/pull/5016) (naufraghi)
- Prompts [can now be simple strings](https://github.com/nushell/nushell/pull/5052) (jt)
- Sets [LAST_EXIT_CODE on parse errors](https://github.com/nushell/nushell/pull/5084) (rgwood)
- Passed [more metadata through filter commands](https://github.com/nushell/nushell/pull/5009) (rrcwang)
- `last` now returns a [simple value for single items](https://github.com/nushell/nushell/pull/5060) (jt)
- Fixed [loops not terminating with ctrl-c](https://github.com/nushell/nushell/pull/5003) (jt)
- Added [bounded channels for backpressure](https://github.com/nushell/nushell/pull/4986) (b333z)
- Added [streaming support to `save`](https://github.com/nushell/nushell/pull/4985) (b333z)
- [Support for passing binary data into run-external](https://github.com/nushell/nushell/pull/4984) (b333z)
- [Fix for alias imports](https://github.com/nushell/nushell/pull/4968) (filaretov, jt)
- [Fix for `ls` when file is a socket on macOS](https://github.com/nushell/nushell/pull/4983) (fdncred)
- [Better tilde expansion](https://github.com/nushell/nushell/pull/4974) (filaretov)
- Added [keywords to help messages](https://github.com/nushell/nushell/pull/4978) (kubouch)
- Removed [is_private from `$nu.scope.commands`](https://github.com/nushell/nushell/pull/4979) (kubouch)
- [Fix for `path join` on streams](https://github.com/nushell/nushell/pull/4959) (jt)
- [Fixes to environment defaults](https://github.com/nushell/nushell/pull/4960) (jt)
- [Adding escapes to `to nuon`](https://github.com/nushell/nushell/pull/4964) (jt)
- Improvements to the [`reject` command](https://github.com/nushell/nushell/pull/4951) (jt)
- Fix to the [precedence parser](https://github.com/nushell/nushell/pull/4947) (jt)
- Calling out through `cmd.exe` [no longer uses AutoRun](https://github.com/nushell/nushell/pull/4903) (LebsterFace)

# Breaking changes

* [`str find-replace` is now `str replace`](https://github.com/nushell/nushell/pull/5120)
* [`keep` is now `take`](https://github.com/nushell/nushell/pull/5123)
- [`str find-replace` is now `str replace`](https://github.com/nushell/nushell/pull/5120)
- [`keep` is now `take`](https://github.com/nushell/nushell/pull/5123)

# Looking ahead

Expand Down
3 changes: 2 additions & 1 deletion book/custom_commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ def congratulate [age: int = 18] {

If you want to check if an optional parameter is present or not and not just rely on a default value use [optional positional parameters](#optional-positional-parameters) instead.


## Optional positional parameters

By default, positional parameters are required. If a positional parameter is not passed, we will encounter an error:
Expand Down Expand Up @@ -267,11 +266,13 @@ def greet [
```

And the definition can be either called as:

```
> greet -a 10 --twice hello
```

Or just without the switch flag:

```
> greet -a 10 hello
```
Expand Down

0 comments on commit f2c8586

Please sign in to comment.