Commit Graph

1325 Commits

Author SHA1 Message Date
Evan Platzer
6365ba0286
Add search terms for all?, any?, length, and keybindings (#5665)
* Add search terms for `all?`

JavaScript has `Array.every` similar to `all?`

* Add search terms for `any?`

JavaScript has `Array.some` similar to `any?`

* Add search terms for `length`

Count, `len()`, and `size`/`sizeof` in widely-known programming languages are equivalent to `length`

* Add search terms for `keybindings`

Shortcut and hotkey are common synonyms (especially in web and GUI land) for keybindings.
2022-05-27 16:38:54 +02:00
pwygab
545b1dcd94
Add search terms to error make (#5657)
* add search terms to error make

* add throw

Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
2022-05-27 06:04:33 -05:00
Stefan Holderbach
d69a4db2e7
Unpin reedline for regular development (#5634)
Co-authored-by: JT <547158+jntrnr@users.noreply.github.com>
2022-05-26 23:21:16 +02:00
tenshik
d4bfbb5eaf
feat: add search terms to random & typo fix (#5652)
Co-authored-by: chinsaw <chinsaw@example.com>
2022-05-26 13:09:22 -07:00
Stefan Holderbach
507f24d029
Improve test coverage of command examples (#5650)
* Ignore `cargo tarpaulin` output files

* Add expected result for `columns` example

Examples without provided expected output will never be tested.
The subset of commands available in `test_examples()` is limited thus
excluding the tests depending on other commands

* Add example test harness to `reject`

* Test and fix `wrap` example

* Test and fix `drop column` example

* Update `from ods` examples

* Update `from xlsx` examples

* Run `to nuon` examples

* Run `hash base64` examples

* Add example output to `path parse`

* Test and fix the `grid` examples
2022-05-26 13:51:31 -05:00
WindSoilder
219c719e98
make cp can copy folders contains dangling symbolic link (#5645)
* cp with no dangling link

* add -p to not follow symbolic link

* change comment

* add one more test case to check symblink body after copied

* better help message
2022-05-26 10:42:52 -05:00
Jakub Žádník
50146bdef3
Shorten the links of parser keywords help msgs (#5648) 2022-05-26 18:15:36 +03:00
Jakub Žádník
2042f7f769
Add 'overlay new' command (#5647)
* Add 'overlay new' command

* Add missing file
2022-05-26 17:47:04 +03:00
Stefan Holderbach
3b8deb9ec7
Add search terms for describe (#5644) 2022-05-26 08:11:45 -05:00
Vanilla
727ff5f2d4
feat[table]: Allow specific table width with -w, like command grid. (#5643) 2022-05-26 06:53:05 -05:00
WindSoilder
9602e82029
make sure no duplicate records exists during eval and merge (#5633) 2022-05-25 19:10:31 -05:00
JT
8e98df8b28
bump to dev version (#5635) 2022-05-25 19:09:44 -05:00
JT
06cf3fa5ad
Bump to 0.63 (#5627) 2022-05-25 11:33:28 +12:00
Jakub Žádník
9a482ce284
Overlay keep (#5629)
* Allow env vars to be kept from removed overlay

* Rename --keep to --keep-custom; Add new test

* Rename some symbols

* (WIP) Start working on --keep for defs and aliases

* Fix decls/aliases not melting properly

* Use id instead of the whole cloned overlay

* Rewrite overlay remove for no reason

Doesn't fix the bug but at least looks better.

* Rename variable

* Fix adding overlay env vars

* Add more tests; Fmt + Clippy
2022-05-25 09:22:17 +12:00
Stefan Holderbach
8018ae3286
Pin reedline v0.6.0 for the nushell v0.63.0 release (#5620)
Release notes: https://github.com/nushell/reedline/releases/tag/v0.6.0

This release contains several bug fixes and improvements to the vi-emulation and documentation.

- Improvements to the vi-style keybindings (@sadmac7000):
  - `w` now correctly moves to the beginning of the word.
  - `e` to move to the end of the word.
- Bugfixes:
  - Support terminal emulators that erroneously report a size of 0x0 by assuming a default size to avoid panics and draw nevertheless (@DhruvDh)
  - Fix `ListMenu` layout calculations. Avoids scrolling bug when wrapping occurs due to the line numbering (@ahkrr)
  - Avoid allocating to the total history capacity which can cause the application to go out of memory (@sholderbach)
- Documentation improvements including addition of documentation intended for reedline developers (@petrisch, @sholderbach)
2022-05-24 00:39:55 +02:00
WindSoilder
ef322a24c5
fix date format (#5619) 2022-05-23 09:59:34 -07:00
Stefan Holderbach
6ff717c0ba
Add meta command for the config subcommands (#5616)
When using `config` without the `config nu` or `config env` subcommands
introduced by #5607 display basic usage like `str`.
2022-05-23 05:31:57 +12:00
WindSoilder
d534a89867
Make flatten works better and predictable (#5611)
* only want to flatten at most one column which contains a list

* make flatten works better

* more readable
2022-05-22 06:22:38 -05:00
Justin Ma
1e89cc3578
fix typo for version command (#5610) 2022-05-22 16:48:39 +08:00
Kangaxx-0
06f5199570
Add config command (#5607)
* Add config command

* Format code

Co-authored-by: Frank Zhang <v-frankz@microsoft.com>
2022-05-22 15:13:58 +12:00
WindSoilder
9e5e9819d6
adjust flatten default behavior (#5606) 2022-05-21 08:32:51 -05:00
victormanueltn
1f8ccd8e5e
Add search term to str substring command. (#5603) 2022-05-21 11:40:37 +03:00
Yiheng Li
e9d8b19d4d
feat: add search terms to network (#5602)
Co-authored-by: Leyoh Li <leyohli@LeyohdeMacBook-Air.local>
2022-05-20 23:19:17 -04:00
pwygab
7c63ce15d8
attempts to allow the test to work when run as root (#5601) 2022-05-20 21:48:36 -05:00
Stefan Stanciulescu
2cc5952c37
Fix cp bug (#5462)
* Cleanup - remove old commented code

* Force a / or \ to distinguish between folders and files for cp

* Force a / or \ to distinguish between folders and files for cp

* Remove unneeded code

* Add cp test for checking copy to non existing directory

* Fix warning in test
2022-05-21 09:49:29 +12:00
Stefan Holderbach
aa88449f29
Refer to the span of error make if not given (#5599)
* Refer to the span of `error make` if not given

Implements #5591

Currently the span of the "throwing" `error make`

Also allow to set `msg` and `label` without an additional span.

* Message plus "originates from here" label
2022-05-21 09:48:36 +12:00
Stefan Holderbach
06199d731b
Use bleeding edge reedline, with fix for #5593 (#5598)
Fixes #5593 (OOM introduced with #5587 when no config was present and an attempt was
made to allocate all memory in advance)

Includes also other changes to reedline:

- Vi word definition fixed and `w` and `e` work as expected
2022-05-20 17:35:25 +02:00
Justin Ma
0ba86d7eb8
Fix #5578, assume pipe file be zero-sized (#5594)
* Fix #5578, assume pipe file be zero-sized

* rust fmt
2022-05-20 09:27:21 -05:00
WindSoilder
6efd1bcb3f
Don't report error when cwd is not exists. (#5590)
* only set cwd for child process if cwd exists, and avoid showing error when pwd is not exists

* better comment text

Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
2022-05-20 07:03:03 -05:00
Stefan Holderbach
0d06b6259f
Change miette theme based on ANSI config (#5588)
* Change miette theme based on ANSI config

Use the base ansi colors to simplify the use of the terminal emulator
theming.
Turn of most eye-candy (including unicode) when using
`$config.use_ansi_coloring: false`

Addresses #5582

* Fix error test affected by changed styling
2022-05-19 13:59:14 -05:00
WindSoilder
1999e0dcf3
Fix flatten behavior (#5584)
* one step closer to flatten

* integration code is passing, but still need to do one more level flatten for table

* fix flatten

* using match instead of several if let

* make better comment

* fmt code

* better comment
2022-05-19 06:46:48 -05:00
WindSoilder
2b1e05aad0
add quantile column (#5583) 2022-05-18 20:47:26 -05:00
njbull4
2c58beec13
cp, mv, and rm commands need to support -i flag (#5523)
* restored interactive mode to rm command

* removed unnecessary whitespace in rm file

* removed unnecessary whitespace in rm file

* fixed python-vertualenv build issue

* moved interactive logic to utils file

* restored interactive mode to cp command

* interactive mode for mv wip

* finished mv implementation

* removed unnecessary whitespace

* changed unwrap to expect
2022-05-18 09:53:46 -05:00
Jae-Heon Ji
9c779b071b
feat: apply the --numbered option to acc in reduce command. (#5575)
* feat: apply the `-n` option to acc

* feat: update tests and examples
2022-05-18 09:49:34 -05:00
krober
1e94793df5
Add str title-case (#5573)
Co-authored-by: kyle <kyle@archtop.local>
2022-05-18 08:57:20 -05:00
WindSoilder
7d9a77f179
fix select tests (#5577) 2022-05-18 06:20:26 -05:00
WindSoilder
bb079608dd
fix move test (#5576)
* fix move test

* remove ignore
2022-05-18 06:18:21 -05:00
WindSoilder
5fa42eeb8c
Make format support nested column and use variable (#5570)
* fix format for nested structure

* make little revert

* add tests

* fix format

* better comment

* make better comment
2022-05-18 06:08:43 -05:00
krober
3e09158afc
Move capitalize, downcase, upcase to /cases; fix some example descriptions; clarify usage text (#5572)
Co-authored-by: kyle <kyle@archtop.local>
2022-05-18 00:55:43 -04:00
Darren Schroeder
f0cb2f38df
refactor all write_alls to ensure flushing (#5567) 2022-05-17 13:28:18 -05:00
Reilly Wood
038391519b
Upgrade trash crate for faster non-Windows builds (#5563) 2022-05-16 17:48:41 -07:00
victormanueltn
a22d70718f
Add search terms to build-string command. (#5557) 2022-05-16 12:21:01 -07:00
Darren Schroeder
d1e7884d19
table refactor for readability (#5555) 2022-05-16 10:35:57 -05:00
WindSoilder
fc41a0f96b
use reverse iter on value search (#5553) 2022-05-16 06:29:40 -05:00
Fernando Herrera
8bd68416e3
Lazy dataframes (#5546)
* lazyframe definition

* expressions and lazy frames

* new alias expression

* more expression commands

* updated to polars main

* more expressions and groupby

* more expressions, fetch and sort-by

* csv reader

* removed open csv

* unique function

* joining functions

* join lazy frames commands with eager commands

* corrected tests

* Update .gitignore

* Update .gitignore

Co-authored-by: JT <547158+jntrnr@users.noreply.github.com>
2022-05-16 08:27:43 +01:00
Reilly Wood
d90b25c633
Look up git commit hash ourselves, drop libgit2 dependency (#5548) 2022-05-16 13:57:25 +12:00
WindSoilder
44bcfb3403
fix zip test (#5536) 2022-05-15 16:44:32 -05:00
WindSoilder
16bd7b6d0d
Fix Value::Record compare logic, and pass uniq tests. (#5541)
* fix record compare logic

* add more comment
2022-05-14 06:04:09 -05:00
WindSoilder
852de79212
Implement histogram command (#5518)
* finish histogram

* adjust comment

* add test for histogram

* add Date to test

* move hashable value back inside chart package
2022-05-13 06:48:47 -05:00
WindSoilder
06f40405fe
add rename (#5534) 2022-05-13 06:47:11 -05:00
Herlon Aguiar
32d1939a95
nu-command/filesystem: fix rm .sock file (#5524) 2022-05-12 19:25:21 -05:00
Justin Ma
2145feff5d
feat: add tutor list support, remove tutor engine-q, fix: #4950 (#5511)
* feat: add `tutor list` support, remove tutor `engine-q`, fix: #4950

* cs

* fmt
2022-05-11 16:16:01 -05:00
Darren Schroeder
0b95465ea1
add --table_mode -m parameter (#5513)
* add `--table_mode` `-m` parameter

* underscores to dashes
2022-05-11 16:15:31 -05:00
Carl Schierig
ec804f4568
nu-command ls - bump umask crate to 2.0.0 (#5514) 2022-05-11 16:13:45 -05:00
Kangaxx-0
4717ac70fd
Add verbose (#5512)
Co-authored-by: Frank Zhang <v-frankz@microsoft.com>
2022-05-11 11:46:13 -05:00
Kangaxx-0
9969fbfbb1
Add feedback to cp (#5482)
Co-authored-by: Frank Zhang <v-frankz@microsoft.com>
2022-05-11 20:06:30 +08:00
Peter Tolsma
5f39267a80
Make $nothing | into string == "" (#5490)
* Make $nothing | into string == ""

* Fix up existing into string tests

* Add $nothing | into string test

* Formatting

* Windows line endings test fix
2022-05-11 12:26:43 +03:00
Reilly Wood
c0b99b7131
Enable converting dates to ints (#5489) 2022-05-10 13:15:28 -05:00
Darren Schroeder
75c033e4d1
refactor for legibility (#5503)
* refactor for legibility

* clippy
2022-05-10 12:49:34 -05:00
WindSoilder
d88d057bf6
keep metadata while format filesize (#5502) 2022-05-10 11:24:06 -05:00
Justin Ma
b00098ccc6
opt: improve ls by call get_file_type only one time (#5500)
* opt: improve ls by call get_file_type only one time

* fmt

* cs
2022-05-10 08:01:06 -05:00
Justin Ma
7e5e9c28dd
Fix #3899, make mv and rm to be quiet by default (#5501) 2022-05-10 08:00:27 -05:00
Justin Ma
8ffffe9bcc
Improve #4975 of filtering ls output by size issue (#5494)
* Improve #4975 of filtering `ls` output by size issue

* cargo fmt
2022-05-10 06:39:37 -05:00
WindSoilder
8030f7e9f0
add format filesize (#5498)
* add format filesize

* add comment

* add comment

* remove comment
2022-05-10 06:35:14 -05:00
Reilly Wood
14d80d54fe
Parse timestamps as UTC by default (#5488)
* Parse timestamps as UTC by default

* Fix up flags and examples
2022-05-09 13:57:28 -05:00
Reilly Wood
23b467061b
Display range values better (#5487) 2022-05-09 12:18:37 -05:00
Justin Ma
7ee22603ac
Fix #5469, making $nothing or null convert to filesize of 0B (#5485) 2022-05-09 06:19:28 -05:00
Reilly Wood
4052a99ff5
Handle int input in into datetime (#5484) 2022-05-09 06:16:01 -05:00
Justin Ma
ccfa35289b
Fix to csv and to tsv for simple list, close: #4780 (#5483)
* Fix `to csv` and `to tsv` for simple list, close: #4780

* ci skip
2022-05-09 06:14:42 -05:00
JT
3a35bf7d4e
Add hooks to cli/repl (#5479)
* Add hooks to cli/repl

* Clippy

* Clippy
2022-05-09 07:28:39 +12:00
WindSoilder
a61d09222f
document out positional argument type (#5461) 2022-05-08 08:11:28 -05:00
Jakub Žádník
07ac3c3aab
Add Nushell REPL simulator; Fix bug in overlay add (#5478)
* Add Nushell REPL simulator; Fix bug in overlay add

The `nu_repl` function takes an array of strings and processes them as
if they were REPL lines entered one by one. This helps to discover bugs
due to the state changes between the parse and eval stages.

* Fix REPL tests on Windows
2022-05-08 16:09:39 +03:00
Fernando Herrera
061e9294b3
join and from derived tables (#5477) 2022-05-08 11:12:03 +01:00
JT
374757f286
Bump to the 0.62.1 dev version (#5473) 2022-05-08 08:38:12 +12:00
Justin Ma
d08c072f19
feat: add disable field type inferencing for from csv and from tsv, fix: #3485 and #4217 (#5467) 2022-05-07 15:04:31 -05:00
Jakub Žádník
9b99b2f6ac
Overlays (#5375)
* WIP: Start laying overlays

* Rename Overlay->Module; Start adding overlay

* Revamp adding overlay

* Add overlay add tests; Disable debug print

* Fix overlay add; Add overlay remove

* Add overlay remove tests

* Add missing overlay remove file

* Add overlay list command

* (WIP?) Enable overlays for env vars

* Move OverlayFrames to ScopeFrames

* (WIP) Move everything to overlays only

ScopeFrame contains nothing but overlays now

* Fix predecls

* Fix wrong overlay id translation and aliases

* Fix broken env lookup logic

* Remove TODOs

* Add overlay add + remove for environment

* Add a few overlay tests; Fix overlay add name

* Some cleanup; Fix overlay add/remove names

* Clippy

* Fmt

* Remove walls of comments

* List overlays from stack; Add debugging flag

Currently, the engine state ordering is somehow broken.

* Fix (?) overlay list test

* Fix tests on Windows

* Fix activated overlay ordering

* Check for active overlays equality in overlay list

This removes the -p flag: Either both parser and engine will have the
same overlays, or the command will fail.

* Add merging on overlay remove

* Change help message and comment

* Add some remove-merge/discard tests

* (WIP) Track removed overlays properly

* Clippy; Fmt

* Fix getting last overlay; Fix predecls in overlays

* Remove merging; Fix re-add overwriting stuff

Also some error message tweaks.

* Fix overlay error in the engine

* Update variable_completions.rs

* Adds flags and optional arguments to view-source (#5446)

* added flags and optional arguments to view-source

* removed redundant code

* removed redundant code

* fmt

* fix bug in shell_integration (#5450)

* fix bug in shell_integration

* add some comments

* enable cd to work with directory abbreviations (#5452)

* enable cd to work with abbreviations

* add abbreviation example

* fix tests

* make it configurable

* make cd recornize symblic link (#5454)

* implement seq char command to generate single character sequence (#5453)

* add tmp code

* add seq char command

* Add split number flag in `split row` (#5434)

Signed-off-by: Yuheng Su <gipsyh.icu@gmail.com>

* Add two more overlay tests

* Add ModuleId to OverlayFrame

* Fix env conversion accidentally activating overlay

It activated overlay from permanent state prematurely which would
cause `overlay add` to misbehave.

* Remove unused parameter; Add overlay list test

* Remove added traces

* Add overlay commands examples

* Modify TODO

* Fix $nu.scope iteration

* Disallow removing default overlay

* Refactor some parser errors

* Remove last overlay if no argument

* Diversify overlay examples

* Make it possible to update overlay's module

In case the origin module updates, the overlay add loads the new module,
makes it overlay's origin and applies the changes. Before, it was
impossible to update the overlay if the module changed.

Co-authored-by: JT <547158+jntrnr@users.noreply.github.com>
Co-authored-by: pwygab <88221256+merelymyself@users.noreply.github.com>
Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
Co-authored-by: WindSoilder <WindSoilder@outlook.com>
Co-authored-by: Yuheng Su <gipsyh.icu@gmail.com>
2022-05-08 07:39:22 +12:00
Fernando Herrera
1cb449b2d1
Database commands (#5466)
* change query to statement

* internal functions and over definitions

* cargo fmt
2022-05-07 13:33:33 +01:00
WindSoilder
6cc66c8afd
complete some commands tests (#5464)
* complete hash test

* unignore source relative tests
2022-05-07 06:23:49 -05:00
Darren Schroeder
2dfd975940
add -n flag to print to print without a newline (#5458)
* add -n flag to print to print without a newline

* clippy
2022-05-06 15:33:00 -05:00
Yuheng Su
fbdb125141
Add split number flag in split row (#5434)
Signed-off-by: Yuheng Su <gipsyh.icu@gmail.com>
2022-05-06 10:53:02 -05:00
WindSoilder
c2ea993f7e
implement seq char command to generate single character sequence (#5453)
* add tmp code

* add seq char command
2022-05-06 10:40:02 -05:00
Darren Schroeder
768ff47d28
enable cd to work with directory abbreviations (#5452)
* enable cd to work with abbreviations

* add abbreviation example

* fix tests

* make it configurable
2022-05-06 07:58:32 -05:00
pwygab
0b9c0fea9d
Adds flags and optional arguments to view-source (#5446)
* added flags and optional arguments to view-source

* removed redundant code

* removed redundant code

* fmt
2022-05-05 06:37:56 -05:00
Darren Schroeder
6623ed9061
sometimes you want a text output (#5441) 2022-05-04 14:12:23 -05:00
pwygab
48cf103439
Allowed for view-source to include entire custom command definition (#5435)
* allowed for view-source to include entire custom command definition

* fmt

* clippy
2022-05-04 06:35:09 -05:00
JT
d306b834ca
Bump to 0.62 (#5422) 2022-05-04 09:01:27 +12:00
Stefan Holderbach
d4371438d1
Pin reedline to v0.5.0 for the next release (#5427)
Release notes: https://github.com/nushell/reedline/releases/tag/v0.5.0

Co-authored-by: JT <547158+jntrnr@users.noreply.github.com>
2022-05-04 08:11:31 +12:00
Fernando Herrera
1a52460695
Database commands (#5417)
* dabase access commands

* select expression

* select using expressions

* cargo fmt

* alias for database

* database where command

* expression operations

* and and or operators

* limit and sort by commands
2022-05-03 06:38:18 +12:00
panicbit
49cbc30974
Add ends-with operator and fix dataframe operator behavior (#5395)
* add ends-with operator

* escape needles in dataframe operator regex patterns
2022-05-02 20:02:38 +12:00
Yuheng Su
07a7bb14bf
Fixed interrupting a for-loop over a list bug #5378 (#5408)
Signed-off-by: gipsyh <gipsyh.icu@gmail.com>
2022-05-02 19:56:37 +12:00
JT
98ab31e15e
Move uses of trim_quotes to unescape for filenames (#5398)
* Move uses of trim_quotes to unescape for filenames

* Fix Windows tests
2022-05-02 06:37:20 +12:00
Darren Schroeder
80d57d70cd
a little database cleanup (#5394) 2022-05-01 07:44:29 -05:00
Reilly Wood
5077242892
Error printing changes for watch (#5389)
* Move CliError to nu-protocol

clean up comment

* Enable printing errors instead of just returning them

* Nicer Miette error printing in watch command
2022-05-01 19:33:41 +12:00
Andrés N. Robalino
7a7aa310aa
Remove 'empty' block support reminders, for now. (#5214) 2022-04-30 22:32:30 -05:00
JT
f16401152b
Make if else more lazy (#5386) 2022-05-01 09:13:21 +12:00
Tomoki Aonuma
ae9c0fc138
Fix quoting for command line args (#5384)
* Fix quoting for command line args

* Replace custom quoting with escape_quote_string

* Use raw string for now
2022-04-30 13:23:05 -05:00
Darren Schroeder
5999506f87
allows for nushell to have tables without the index column (#5380) 2022-04-30 09:07:46 -05:00
Tomoki Aonuma
fa27110651
Avoid using time conversion methods that may panic (#5365) 2022-04-29 06:03:39 -05:00
Michael Angerman
8e5cc655e9
cleanup version command and add in database feature (#5356)
* cleanup version command and add in database feature

* static-link-openssl
2022-04-28 15:25:04 -05:00
Jonathan Moore
f189369fd7
Change description of sort (#5355) 2022-04-28 14:33:26 -05:00