Commit Graph

2042 Commits

Author SHA1 Message Date
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
f88674f353
Nu internals are logged under nu filter. (#1451) 2020-03-05 05:18:53 -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
f97f9d4af3
Update deps locklfile (#1446)
Update deps lockfile
2020-03-03 15:34:22 -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
Jonathan Turner
ca615d9389
Bump to 0.10.1 (#1442) 2020-03-01 20:59:13 +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
Shaurya Shubham
8d38743e27
Add docs for debug (#1438)
* Add docs for `debug`

* Put debug docs in right folder
Also fixed minor spacing problem
2020-03-01 04:09:28 +13:00
Benjamin Röjder Delnavaz
eabfa2de54
Let ls ignore permission errors (#1435)
* Create a function to create an empty directory entry

* Print an empty directory entry if permission is denied

* Fix rustfmt whitespace issues.

* Made metadata optional for `dir_entry_dict`.

Removed `empty_dir_entry_dict` as its not needed anymore.
2020-02-29 14:33:52 +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
Jonathan Turner
adcda450d5
Update LICENSE 2020-02-21 10:49:46 +13:00
Sean Hellum
147b9d4436
Add Better-TOML (#1417) 2020-02-19 16:59:42 -05:00
equal-l2
c43a58d9d6
Fix incorrect display for zero-size files (#1422) 2020-02-19 09:57:58 -05:00
Corvus Corax
e38442782e
Command documentation for du (#1416) 2020-02-19 09:55:22 +13:00
Sean Hellum
b98f893217
add a touch command (#1399) 2020-02-19 09:54:32 +13:00
Shaurya Shubham
bd6556eee1
Use proper file extension for uniq command docs (#1411) 2020-02-18 09:37:46 -05: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
Jonathan Turner
afce2fd0f9
Revert "Display rows in the same table regardless of their column order given they are equal. (#1392)" (#1401)
This reverts commit 4fd9974204.
2020-02-17 17:34:37 -08:00
Andrés N. Robalino
4fd9974204
Display rows in the same table regardless of their column order given they are equal. (#1392) 2020-02-16 20:35:01 -05:00
Shaurya Shubham
71615f77a7
Fix minor typo in calc command error (#1395) 2020-02-16 16:02:41 -05:00
Jonathan Turner
9bc5022c9c
Force a \n at the end of a stdout stream (#1391)
* Force a \n at the end of a stdout stream

* clippy
2020-02-14 18:15:32 -08: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
8ae8ebd107
Add support for multiline script files (#1386)
* Add support for multiline script files

* clippy
2020-02-13 21:24:18 -08:00
Jonathan Turner
473e9f9422
Tiny improvement to sys (#1385) 2020-02-13 08:33:55 -08:00
Corvus Corax
96985aa692
Fix invalid shorthand flag (#1384) 2020-02-13 07:47:34 -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
Shaurya Shubham
c1bec3b443
Return error on a divide by zero (#1376)
Return error on a divide by zero
2020-02-12 08:38:04 -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
Jonathan Turner
0b2be52bb5
Only add quotes if not in Windows (which adds its own?) (#1374)
* Only add quotes if not in Windows (which adds its own?)

* Only add quotes if not in Windows (which adds its own?)
2020-02-10 23:07:44 -08:00
Corvus Corax
6a371802b4
Add block size to du (#1341)
* Add block size to du

* Change blocks to physical size

* Use path instead of strings for file/directory names

* Why don't I just use paths instead of strings anyway?

* shorten physical size and apparent size to physical and apparent resp.
2020-02-10 12:32:18 -08:00
Andrés N. Robalino
29ccb9f5cd
Ensure stable plugins get installed. (#1373) 2020-02-10 15:32:10 -05:00
Jonathan Turner
20ab125861
bump version (#1370) 2020-02-10 09:18:00 -08:00
Jonathan Turner
fb532f3f4e
Prototype shebang support (#1368)
* Add shebang support to nu.

* Move test file

* Add test for scripts

Co-authored-by: Jason Gedge <jason.gedge@shopify.com>
2020-02-10 08:49:45 -08:00
Jason Gedge
a29d52158e
Do not panic when failing to decode lines from external stdout (#1364) 2020-02-10 07:37:48 -08:00
Jonathan Turner
dc50e61f26 Switch stdin redirect to manual. Add test (#1367) 2020-02-09 22:55:07 -08:00