Commit graph

2324 commits

Author SHA1 Message Date
Fernando Herrera
1fd7b9ac38
roll commands (#4437)
* roll commands

* removed repeated funtion
2022-02-12 06:11:54 -05:00
Darren Schroeder
b4b7524206
changed example description (#4434) 2022-02-12 06:10:41 -05:00
Jakub Žádník
328f7e92a0
Hide alias (#4432)
* Add alias interning

Now, AliasId is used to reference aliases stored in EngineState, similar
to decls, blocks, etc.

* Fix wrong message

* Fix using decl instead of alias

* Extend also alias id visibility

* Merge also aliases from delta

* Add alias hiding code

Does not work yet but passes tests at least.

* Fix wrong alias lookup and visibility appending

* Add hide alias tests

* Fmt & Clippy

* Fix random clippy warnings in "which" command
2022-02-12 11:50:37 +02:00
Fernando Herrera
fcc13224c1
headers command (#4414)
* headers command

* correct behaviour headers
2022-02-11 21:06:49 -05:00
Robert O'Shea
926177235c
Added quiet flag rm command #4423 (#4430)
* rm now uses -f flag to not print anything

* changed quiet flag to q not f

* Changed value passed to Value::Nothing in rm command
2022-02-12 01:22:40 +02:00
Genna Wingert
85d1a681c7
Remove stringification for binary values in save command (#4428)
* Remove stringification for binary values in `save`

* Fix typo and clippy warning
2022-02-11 14:26:36 -05:00
JT
a16e485cce
Add support for defining known externals with their own custom completions (#4425)
* WIP for known externals

* Now completions can work from scripts

* Add support for definiing externs

* finish cleaning up old proof-of-concept
2022-02-11 13:38:10 -05:00
JT
a767fa369c
Improve quote path completions with drill-down (#4422) 2022-02-11 09:42:15 -05:00
JT
886ed5ab2d
Fix captures (#4421)
* Fix rowcondition and import captures

* Only check extra blocks if not yet seen
2022-02-11 07:37:10 -05:00
JT
e16d6ae00c
Improve external command completions with spaces (#4420) 2022-02-11 07:05:48 -05:00
Darren Schroeder
ba4d8ae8c3
tweak wording (#4415) 2022-02-10 17:27:51 -06:00
JT
e6db37bc82
Fix multi-command variable captures (#4413) 2022-02-10 18:15:15 -05:00
JT
2e3b2a48ee
Fix string interpolation paren cases (#4410) 2022-02-10 11:09:08 -05:00
Fernando Herrera
5cf91cb30d
deprecated commands (#4405)
* deprecated commands

* deprecated insert command
2022-02-10 12:55:19 +00:00
Darren Schroeder
28947ff9a9
fix broken -w param for grid (#4397) 2022-02-10 07:29:53 -05:00
JT
c2118e7505
Fix help flag (#4398)
* Match 'help command' to 'command --help'

* Fix tests
2022-02-09 21:24:29 -05:00
Stefan Holderbach
e1f98c1bfd
Fix trash-support feature flag (#4394)
Pass it through to be inclued with `--all-features`

Make clippy without `--all-features` happy
2022-02-09 18:20:46 -05:00
Genna Wingert
12d4c2986c
Fix docs for kill command in engine-q (#4393) 2022-02-09 18:20:20 -05:00
Darren Schroeder
f275644e13
add --perf cli param (#4391)
* add `--perf` cli param

* clippy

* fixed 2 `cp` tests on windows
2022-02-09 16:08:16 -06:00
JT
fc88a8538b
Make let-env work like let (#4389)
* Make let-env work like let

* Fix tests
2022-02-09 13:41:41 -05:00
JT
5a1d81221f
Move 'nth' into 'select' (#4385) 2022-02-09 09:59:40 -05:00
JT
43850bf20e
Re-port filesystem commands (#4387)
* Re-port the filesystem commands

* Remove commented out section
2022-02-09 09:56:27 -05:00
Ray Henry
94ab981235
Fix "Index out of bounds" when input to the group-by filter is empty. #4369 (#4382)
* Fix "index out of bounds" when input to group-by is empty #4369

* Fix formatting #4369

* Adds test for empty input

Co-authored-by: Ray Henry <ray.henry@thermofisher.com>
2022-02-09 08:47:47 -06:00
JT
f9e1c4ef50
Use 'table' on scripts and -c commands (#4377)
* Use 'table' on scripts and -c commands

* Fix tests

* Oops, missed a spot
2022-02-09 05:58:54 -05:00
Stefan Holderbach
659da3c4a4
Make ANSI stripping lazy in more places (#4380)
Same rationale as in #4378

Also accelerate `grid`

before:

```
Command being timed: "./eager_nu -c for i in 0..100000 { echo whatever } | grid"
        User time (seconds): 0.21
        System time (seconds): 0.05
        Percent of CPU this job got: 36%
        Elapsed (wall clock) time (h:mm:ss or m:ss): 0:00.71
        Average shared text size (kbytes): 0
        Average unshared data size (kbytes): 0
        Average stack size (kbytes): 0
        Average total size (kbytes): 0
        Maximum resident set size (kbytes): 48112
        Average resident set size (kbytes): 0
        Major (requiring I/O) page faults: 0
        Minor (reclaiming a frame) page faults: 10580
        Voluntary context switches: 266
        Involuntary context switches: 2595
        Swaps: 0
        File system inputs: 0
        File system outputs: 0
        Socket messages sent: 0
        Socket messages received: 0
        Signals delivered: 0
        Page size (bytes): 4096
        Exit status: 0
```

after:

```
Command being timed: "./lazy_nu -c for i in 0..100000 { echo whatever } | grid"
        User time (seconds): 0.14
        System time (seconds): 0.05
        Percent of CPU this job got: 33%
        Elapsed (wall clock) time (h:mm:ss or m:ss): 0:00.60
        Average shared text size (kbytes): 0
        Average unshared data size (kbytes): 0
        Average stack size (kbytes): 0
        Average total size (kbytes): 0
        Maximum resident set size (kbytes): 48272
        Average resident set size (kbytes): 0
        Major (requiring I/O) page faults: 1
        Minor (reclaiming a frame) page faults: 10582
        Voluntary context switches: 286
        Involuntary context switches: 831
        Swaps: 0
        File system inputs: 56
        File system outputs: 0
        Socket messages sent: 0
        Socket messages received: 0
        Signals delivered: 0
        Page size (bytes): 4096
        Exit status: 0
```
2022-02-08 18:25:31 -06:00
Stefan Holderbach
9c7feb2b19
Reduce table allocs: only strip ANSI if necessary (#4378)
For the width calculations for table layout the `strip_ansi` function
has to be called frequently. By checking for the ASCII control chars
(0x00 to 0x1f) except `\n` that are stripped by `strip_ansi_escapes` the number of
necessary allocations can be reduced significantly for the simple case
of text not containing ANSI escapes.

**Benchmark:**

```
nu -c "for i in 0..1000 { ls } | flatten | table"
```

**Allocation reduction**

Running on the nushell repo root as the directory, this change reduces the
allocation volume by approximately 400 MB

(Measured run via KDE heaptrack)
**Speed improvement to output**

Measured via `/usr/bin/time -v`

*before*

```
Command being timed: "./eager_nu -c for i in 0..1000 {ls} | flatten | table"
	User time (seconds): 0.87
	System time (seconds): 0.14
	Percent of CPU this job got: 87%
	Elapsed (wall clock) time (h:mm:ss or m:ss): 0:01.16
	Average shared text size (kbytes): 0
	Average unshared data size (kbytes): 0
	Average stack size (kbytes): 0
	Average total size (kbytes): 0
	Maximum resident set size (kbytes): 18888
	Average resident set size (kbytes): 0
	Major (requiring I/O) page faults: 0
	Minor (reclaiming a frame) page faults: 4809
	Voluntary context switches: 38
	Involuntary context switches: 14
	Swaps: 0
	File system inputs: 0
	File system outputs: 0
	Socket messages sent: 0
	Socket messages received: 0
	Signals delivered: 0
	Page size (bytes): 4096
	Exit status: 0
```

*after*

```
Command being timed: "./lazy_nu -c for i in 0..1000 {ls} | flatten | table"
	User time (seconds): 0.63
	System time (seconds): 0.14
	Percent of CPU this job got: 80%
	Elapsed (wall clock) time (h:mm:ss or m:ss): 0:00.97
	Average shared text size (kbytes): 0
	Average unshared data size (kbytes): 0
	Average stack size (kbytes): 0
	Average total size (kbytes): 0
	Maximum resident set size (kbytes): 18660
	Average resident set size (kbytes): 0
	Major (requiring I/O) page faults: 0
	Minor (reclaiming a frame) page faults: 5149
	Voluntary context switches: 24
	Involuntary context switches: 5
	Swaps: 0
	File system inputs: 0
	File system outputs: 0
	Socket messages sent: 0
	Socket messages received: 0
	Signals delivered: 0
	Page size (bytes): 4096
	Exit status: 0
```
2022-02-08 17:43:32 -06:00
panicbit
cf20eed7bc
Support records in reject command (#4373)
* support records in reject command

* add reject command tests
2022-02-08 15:57:46 -05:00
Darren Schroeder
baceb54660
update ls_colors defaults (#4371) 2022-02-08 11:13:04 -06:00
JT
19caef260d
Fix 'enter' to expand path before checking for it (#4370) 2022-02-08 11:21:17 -05:00
JT
d70d91e559 Remove old nushell/merge engine-q 2022-02-07 14:54:06 -05:00
Fernando Herrera
fdce6c49ab engine-q merge 2022-02-07 19:11:34 +00:00
Onur Şahin
265ee1281d
Drop with iter range (#4242)
* Allow range in 'drop nth'

* Unit tests for drop nth range

* Add range case to the description

* Fix description 2

* format fixes

* Fix example and some refactoring

* clippy fixes
2022-02-07 08:02:35 -05:00
JT
a78c82d811
Make PipelineData helpers collect rawstreams (#969) 2022-02-07 07:44:18 -05:00
JT
84d3620d9b
Oops, match semantics of each group/window (#967) 2022-02-06 21:26:01 -05:00
JT
8a373dd554
Add each window (#966) 2022-02-06 20:23:18 -05:00
JT
c3e0e8eb5c
Add par-each group (#965) 2022-02-06 19:28:09 -05:00
JT
de4449c3ee
Fix completion duplicates (#964) 2022-02-06 16:33:33 -05:00
JT
a911b21256
Switch more commands to redirecting blocks (#956) 2022-02-05 21:03:06 -05:00
Darren Schroeder
2dd32c2b88
Rename some files (#952)
* renamed some files

* clippy

* update tests
2022-02-05 12:35:02 -05:00
JT
3eba90232a
Port each group (#953) 2022-02-05 12:34:35 -05:00
JT
c4858fb202
Remove broken error make examples (#951) 2022-02-05 12:01:08 -05:00
JT
8a93548de2
Error make (#948)
* Add `error make` and improve `metadata`

* Allow metadata to work on just a pipeline
2022-02-05 09:39:51 -05:00
Michael Angerman
e45e8109aa
fix test math/avg.rs can_average_bytes (#946) 2022-02-05 07:01:10 -05:00
Darren Schroeder
709927cee4
Sort keystuff (#945)
* sort things

* reorg
2022-02-04 17:20:54 -06:00
Fernando Herrera
abaeffab91
default keybindings command (#943) 2022-02-04 17:20:40 -06:00
Michael Angerman
73dcec8ea1
fix some of the sort_by tests several more left to do (#942) 2022-02-04 13:51:49 -08:00
Darren Schroeder
b26acf97bd
a few more tests (#941) 2022-02-04 15:42:18 -06:00
JT
f29dbeddd7
Allow let-env to be dynamic (#940) 2022-02-04 16:19:13 -05:00
Darren Schroeder
8204cc4f28
fix ls and ls tests (#931)
* fix `ls` and ls tests

* tweak to ls so it doesn't scream on empty dirs

* clippy

* reworked `ls` to put in what was left out
2022-02-04 14:32:13 -06:00
Michael Angerman
c2f6dfa75c
add nth tests to mod.rs (#934) 2022-02-04 12:08:25 -08:00