Commit Graph

137 Commits

Author SHA1 Message Date
Waldir Pimenta
5ca9e12b7f
Fix whitespace and typos (#1481)
* Remove EOL whitespace in files other than docs

* Break paragraphs into lines

See http://rhodesmill.org/brandon/2012/one-sentence-per-line/ for the rationale

* Fix various typos

* Remove EOL whitespace in docs/commands/*.md
2020-03-14 06:23:41 +13:00
Kyle Criddle
5b0b2f1ddd
Fixes #1204 : sys | get host.users displays the same user (#1480)
account twice while only one exists (macOS)

- renamed host.users to host.sessions
2020-03-12 14:01:55 +13:00
Andrés N. Robalino
b40d16310c
More relaxed file modes for now. (#1476) 2020-03-11 13:19:15 +13:00
Andrés N. Robalino
d3718d00db
Merge shuffle nu plugin as core command. (#1475) 2020-03-10 17:00:08 -05:00
Jonathan Turner
a6b6afbca9
Update Cargo.toml 2020-03-11 08:08:13 +13:00
Jonathan Turner
62666bebc9
Bump to 0.11.0 (#1474) 2020-03-11 06:34:19 +13:00
rabisg0
d1fcce0cd3
Fixes #1427: Prints help message with -h switch (#1454)
For some commands like `which` -h flag would trigger an error asking for
missing required parameters instead of printing the help message as it
does with --help. This commit adds a check in the command parser to
avoid that.
2020-03-11 05:59:50 +13:00
Andrés N. Robalino
a2443fbe02
Remove unused parsing logic. (#1473)
* Remove unused parsing logic.

* Run tokens iteration tests baseline.

* Pass lint.

* lifetimes can be elided without being explicit.
2020-03-10 04:31:42 -05:00
Andrés N. Robalino
db16b56fe1
Columnpath support when passing fields for formatting. (#1472) 2020-03-10 01:55:03 -05:00
Linards Kalvāns
54bf671a50
Fix deleting / showing ls named pipes and other fs objects no… (#1461)
* Fix deleting named pipes
* Use std::os::unix::fs::FileTypeExt to show correct type for unix-specific fs objects; Fix formatting

Co-authored-by: Linards Kalvāns <linards.kalvans@twino.eu>
2020-03-09 09:02:53 -04:00
Jason Gedge
755d0e648b
Eliminate some compiler warnings (#1468)
- Unnecessary parentheses
- Deprecated `description()` method
2020-03-09 08:19:07 +13:00
Jonathan Turner
e440d8c939
Bump some deps (#1467) 2020-03-09 08:18:44 +13:00
Jason Gedge
01dd358a18
Don't emit a newline in autoview. (#1466)
The extra newline character makes it hard to use nu as part of an
external processing pipeline, since the extra character could taint the
results. For example:

```
$ nu -c 'echo test | xxd'
00000000: 7465 7374                                test
```

versus

```
nu -c 'echo test' | xxd
00000000: 7465 7374 0a                             test.
```
2020-03-09 08:18:24 +13:00
Jonathan Turner
50fb97f6b7
Merge env into $nu and simplify table/get (#1463) 2020-03-08 18:33:30 +13:00
Jean Cavallo
ebf139f5e5
Auto-detect string / binary in save command (#1459)
* Auto-detect string / binary in save command

* Linter
2020-03-08 07:33:29 +13:00
Jonathan Turner
8925ca5da3
Move to bytes/string hybrid codec (#1457)
* WIP: move to bytes codec

* Progress on adding collect helpers

* Progress on adding collect helpers

* Add in line splitting back to lines

* Lines outputting line primitives

* Close to ready?

* Finish fixing lines

* clippy fixes

* fmt fixes

* removed unused code

* Cleanup a few bits

* Cleanup a few bits

* Cleanup a few more bits

* Fix failing test with corrected test case
2020-03-07 05:06:39 +13:00
Kevin DCR
287652573b
Fix and refactor cd for Filesystem Shell. (#1452)
* Fix and refactor cd for Filesystem Shell.
Reorder check conditions, don't check existence twice.
If building for unix check exec bit on folder.

* Import PermissionsExt only on unix target.

* It seems that this is the correct way?
2020-03-06 20:13:47 +13:00
Andrés N. Robalino
db24ad8f36
Add --num parameter to limit the number of output lines (#1455)
Add `--num` parameter to limit the numer of returned elements
2020-03-05 05:26:46 -05:00
Andrés N. Robalino
59cb0ba381
Color appropiately commands. (#1453) 2020-03-04 23:22:42 -05:00
Andrés N. Robalino
c4cfab5e16
Make feature options available downstream to nu-cli subcrate. (#1450) 2020-03-04 15:31:12 -05:00
Jason Gedge
b2c5af457e
Move most of the root package into a subcrate. (#1445)
This improves incremental build time when working on what was previously
the root package. For example, previously all plugins would be rebuilt
with a change to `src/commands/classified/external.rs`, but now only
`nu-cli` will have to be rebuilt (and anything that depends on it).
2020-03-04 13:58:20 -05:00
Andrés N. Robalino
c731a5b628
Columns can be renamed. (#1447) 2020-03-03 16:01:24 -05:00
Falco Hirschenberger
ed7d3fed66
Add shuffle plugin (#1443)
* Add shuffle plugin

see #1437

* Change plugin to integrate into nu structure and build system
2020-03-03 08:44:12 +13:00
Jason Gedge
7304d06c0b
Use threads to avoid blocking reads/writes in externals. (#1440)
In particular, one thing that we can't (properly) do before this commit
is consuming an infinite input stream. For example:

```
yes | grep y | head -n10
```

will give 10 "y"s in most shells, but blocks indefinitely in nu. This PR
resolves that by doing blocking I/O in threads, and reducing the `await`
calls we currently have in our pipeline code.
2020-03-02 06:19:09 +13:00
Corvus Corax
6d096206b6
Add support for compound shorthand flags (#1414)
* Break multicharacter shorthand flags into single character flags

* Remove shorthand flag test
2020-03-01 13:20:42 +13:00
Ryan Blecher
2a8cb24309
Add support for downloading unsupported mime types (#1441) 2020-03-01 13:14:36 +13:00
Ryan Blecher
a86a0abb90
Plugin documentation (#1431)
* Add very basic documentation. Need to play with rest of the api to figure out what it does

* Add some documentation to more of the Plugin API methods

* fmt
2020-02-24 15:28:46 +13:00
Andrés N. Robalino
18d988d4c8
Restrict short-hand flag detection to exact match. (#1406) 2020-02-18 01:58:30 -05:00
Jonathan Turner
0f7c723672
Bump version to 0.10.0 (#1403) 2020-02-18 16:56:09 +13:00
Andrés N. Robalino
552848b8b9
Leave raw mode correctly. (#1388)
Co-authored-by: Jonathan Turner <jonathandturner@users.noreply.github.com>
2020-02-14 17:31:21 -05:00
Jonathan Turner
473e9f9422
Tiny improvement to sys (#1385) 2020-02-13 08:33:55 -08:00
Corvus Corax
0961da406d
Add string to datetime to str plugin (#1381)
* Add string to datetime to str plugin

* Test string to date/time conversion
2020-02-13 07:47:04 -08:00
Andrés N. Robalino
84927d52b5
Refuse internal command execution given unexpected arguments. (#1383) 2020-02-13 02:34:43 -05:00
Andrés N. Robalino
73312b506f
Finer grained parsing and coloring command tail. (#1382) 2020-02-12 20:20:19 -05:00
Corvus Corax
c0be02a434
Short-hand flags (#1378)
* typo fixes

* Change signature to take in short-hand flags

* update help information

* Parse short-hand flags as their long counterparts

* lints

* Modified a couple tests to use shorthand flags
2020-02-11 18:24:31 -08:00
Andrés N. Robalino
2ab8d035e6
External it and nu variable column path fetch support. (#1379) 2020-02-11 18:25:56 -05:00
Andrés N. Robalino
24094acee9
Allow switch flags anywhere in the pipeline. (#1375) 2020-02-11 03:49:00 -05:00
Andrés N. Robalino
29ccb9f5cd
Ensure stable plugins get installed. (#1373) 2020-02-10 15:32:10 -05:00
Jason Gedge
a29d52158e
Do not panic when failing to decode lines from external stdout (#1364) 2020-02-10 07:37:48 -08:00
Ryan Blecher
a2668e3327
Add some nu_source docs for meta.rs (#1366)
* Add some docs for meta.rs

* add better explanation for Span merging

* Add some doc tests - not sure how to get them to run

* get rid of doc comments for the temporary method

* add doc test for is_unknown

* fmt
2020-02-09 18:08:14 -08:00
Jonathan Turner
5f4fae5b06 Pipeline sink refactor (#1359)
* Refactor pipeline ahead of block changes. Add '-c' commandline option

* Update pipelining an error value

* Fmt

* Clippy

* Add stdin redirect for -c flag

* Add stdin redirect for -c flag
2020-02-08 18:24:33 -08:00
Jason Gedge
3687603799
Only spawn external once when no $it argument (#1358) 2020-02-08 17:57:05 -08:00
Jonathan Turner
812a76d588
Update more futures-preview to futures (#1346) 2020-02-05 20:28:42 -08:00
Alex van de Sandt
e3be849c2a
Futures v0.3 upgrade (#1344)
* Upgrade futures, async-stream, and futures_codec

These were the last three dependencies on futures-preview. `nu` itself
is now fully dependent on `futures@0.3`, as opposed to `futures-preview`
alpha.

Because the update to `futures` from `0.3.0-alpha.19` to `0.3.0` removed
the `Stream` implementation of `VecDeque` ([changelog][changelog]), most
commands that convert a `VecDeque` to an `OutputStream` broke and had to
be fixed.

The current solution is to now convert `VecDeque`s to a `Stream` via
`futures::stream::iter`. However, it may be useful for `futures` to
create an `IntoStream` trait, implemented on the `std::collections` (or
really any `IntoIterator`). If something like this happends, it may be
worthwhile to update the trait implementations on `OutputStream` and
refactor these commands again.

While upgrading `futures_codec`, we remove a custom implementation of
`LinesCodec`, as one has been added to the library. There's also a small
refactor to make the stream output more idiomatic.

[changelog]: https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md#030---2019-11-5

* Upgrade sys & ps plugin dependencies

They were previously dependent on `futures-preview`, and `nu_plugin_ps`
was dependent on an old version of `futures-timer`.

* Remove dependency on futures-timer from nu

* Update Cargo.lock

* Fix formatting

* Revert fmt regressions

CI is still on 1.40.0, but the latest rustfmt v1.41.0 has changes to the
`val @ pattern` syntax, causing the linting job to fail.

* Fix clippy warnings
2020-02-05 19:46:48 -08:00
Jonathan Turner
ba1b67c072
Attempt rustup update on each PR (#1345)
* Attempt update on each PR

* Update fmt
2020-02-05 19:28:49 -08:00
Andrés N. Robalino
7a0bc6bc46
Opt-out unused heim features from sys/ps plugins. (#1335) 2020-02-04 01:51:14 -05:00
Shaurya Shubham
49a1385543
Make tests work from directory names with spaces (#1325) 2020-01-31 22:12:56 -08:00
Andrés N. Robalino
3610baa227
Default plugins are independent and called from Nu. (#1322) 2020-01-31 17:45:33 -05:00
Jonathan Turner
407f36af29
Remove unused dep (#1298) 2020-01-29 16:44:03 +13:00
Jonathan Turner
763fcbc137
Bump to 0.9.0 (#1297) 2020-01-29 15:17:02 +13:00