Commit Graph

2100 Commits

Author SHA1 Message Date
WindSoilder
376d22e331
In unix like system, set foreground process while running external command (#6206)
* while executing external command, make it as foreground

* remove useless file

* add comment, make var more readable

* add comment

* fmt code

* fix windows

* fix func name

* fix clippy

* fix windows clippy

* add comments, introduce `ForegroundProcess and ForegroundChild

* fix windows clippy

* fix on windows

* no need fg_process_setup module

* Revert "no need fg_process_setup module"

This reverts commit 21ee4ffbf6.

* restrict visibility for helper functions
2022-08-02 16:53:50 +02:00
Fernando Herrera
1f4791a191
use from table to remove into-db command (#6205)
* use from table to remove into-db command

* correct tests for db expressions
2022-08-01 21:27:55 +01:00
Reilly Wood
2ac7a4d48d
performance improvements for SQLite reads (#6204) 2022-07-31 23:09:03 -07:00
pwygab
01386f4d58
adds a config reset command (#6149)
* moves config files to nu_utils

* fmt

* fix dockerfile

* fix docs
2022-07-31 20:44:33 -05:00
Reilly Wood
1086fbe9b5
Revert query command to query db (#6200) 2022-07-31 15:36:14 -04:00
Darren Schroeder
a83bd4ab20
allow uppercase chars to be captured during suppressed input (#6199) 2022-07-31 08:12:13 -05:00
nibon7
26caf7e1b2
Return error early if seconds part of timestamp is invalid (#6193)
Signed-off-by: nibon7 <nibon7@163.com>
2022-07-31 07:32:16 -05:00
Reilly Wood
dd2a0e35f4
Add $OLDPWD example for cd (#6194)
* add example for cd

* Fix format_conversions tests
2022-07-30 23:29:52 -04:00
Justin Ma
6a4eabf5c7
Add bits or and bits xor command (#6190) 2022-07-30 13:26:37 -05:00
Justin Ma
0e2c888f73
Add bits root command and bits and command (#6188) 2022-07-30 07:34:11 -05:00
Stefan Holderbach
c140da5740
Update crossterm to version 0.24 (#6172)
- Includes version bump for `lscolors = 0.11` and `reedline` as git
patch
2022-07-30 11:41:15 +02:00
WindSoilder
586c0ea3d8
Add bits not command (#6143)
Add `bits not`

Options: `--number-bytes` and `--sized`
2022-07-30 11:25:44 +02:00
Justin Ma
767201c40d
bump to 0.66.3 dev version (#6183) 2022-07-30 05:48:10 +12:00
nibon7
9e24e452a5
Fix touch panics when using invalid timestamp (#6181)
Signed-off-by: nibon7 <nibon7@163.com>
2022-07-29 06:41:28 -05:00
Jakub Žádník
2cffff0c1b
Allow modules to use other modules (#6162)
* Allow private imports inside modules

Can call `use ...` inside modules now.

* Add more tests

* Add a leak test

* Refactor exportables; Prepare for 'export use'

* Fix description

* Implement 'export use' command

This allows re-exporting module's commands and aliases from another
module.

* Add more tests; Fix import pattern list strings

The import pattern strings didn't trim the surrounding quotes.

* Add ignored test
2022-07-29 11:57:10 +03:00
nibon7
cf2e9cf481
Prevent mv panic again (#6171)
Closes #6170

Signed-off-by: nibon7 <nibon7@163.com>
2022-07-29 10:00:52 +03:00
JT
98e199f7b5
Move ls back to last-known-good state (#6175)
* revert the recent ls changes

* cargo fmt
2022-07-29 11:00:54 +12:00
JT
10e463180e
Revert cp and mv back to last-known-good state (#6169) 2022-07-29 07:49:20 +12:00
Fernando Herrera
e2a21afca8
maintain quotes for arguments (#6161) 2022-07-28 16:35:55 +01:00
nibon7
2ea209bcc0
Prevent mv panic (#6158)
Signed-off-by: nibon7 <nibon7@163.com>
2022-07-28 01:15:02 -04:00
JT
e049ca8ebf
bump to 0.66.2 dev version (#6157) 2022-07-28 11:38:52 +12:00
nibon7
4c6cf36aa5
Fix ls panics when a file or directory not exists (#6148)
* Fix ls panics when a file or directory not exists

Fixes #6146

Signed-off-by: nibon7 <nibon7@163.com>

* add test

Signed-off-by: nibon7 <nibon7@163.com>
2022-07-27 18:53:00 +03:00
Jakub Žádník
c92211c016
Use relative paths as file-relative when parsing a file (#6150)
* Make function local (not used anywhere else)

* Use path relative to the parsed file

* Do not use real cwd at all
2022-07-27 18:36:56 +03:00
JT
9695331eed
require variable names to follow additional restrictions (#6125) 2022-07-27 14:08:54 +12:00
JT
d42cfab6ef
bump to 0.66.1 dev version (#6140) 2022-07-27 13:15:04 +12:00
JT
2b7c811402
fix 0.66 nu-command crate (#6138) 2022-07-27 11:20:12 +12:00
JT
c6cb491e77
bump to 0.66 (#6137) 2022-07-27 07:56:14 +12:00
JT
e2a4632159
move to latest stable reedline (#6136) 2022-07-27 07:19:38 +12:00
Matthew Ma
65f0edd14b
Allow multiple patterns in ls command (#6098)
* Allow multiple patterns in ls command

* Run formatter

* Comply with style

* Fix format error
2022-07-26 13:08:19 -05:00
pwygab
b12a3dd0e5
allow view-source to view aliases (#6135) 2022-07-26 08:06:16 -05:00
Darren Schroeder
d856ac92f4
expand durations to include month, year, decade (#6123)
* expand durations to include month, year, decade

* remove commented out fn

* oops, found more debug comments

* tweaked tests for the new way, borrowed heavily from chrono-humanize-rs

* clippy

* grammar
2022-07-26 08:05:37 -05:00
Darren Schroeder
8c675a0d31
update some dependencies (#6131) 2022-07-25 21:09:32 -05:00
JT
475d32045f
Revert "Refactor external command (#6083)" (#6116)
This reverts commit 0646f1118c.
2022-07-26 05:37:15 +12:00
Justin Ma
9097e865ca
fix typo of port command (#6120) 2022-07-25 07:07:26 -05:00
WindSoilder
894d3e7452
try make port test more reliable (#6117) 2022-07-25 06:42:06 -05:00
pwygab
8b35239bce
remove misleading example from source (#6118) 2022-07-25 11:52:16 +03:00
Matthew Ma
87e2fa137a
Allow cp multiple files at once (#6114)
* Allow cp multiple files at once

* Expand destination with expand_ndots
2022-07-25 10:42:25 +03:00
pwygab
5706eddee3
throw error if any? or all? expression invokes invalid command (#6110)
* throw error if any? or all? expression invokes invalid command

* fix tests for windows
2022-07-24 06:28:12 -05:00
Darren Schroeder
388ff78a26
trim spaces when converting strings to ints (#6105) 2022-07-23 09:23:04 -05:00
Matthew Ma
7d46177cf3
Allow mv multiple files at once (#6103)
* Allow mv multiple files at once

* Expand dots in mv src + dst
2022-07-23 07:51:41 -05:00
Mikołaj Powierża
a1a5a3646b
Bump powierza-coefficient to 1.0.1 (#6099) 2022-07-22 19:12:41 -05:00
Kangaxx-0
0646f1118c
Refactor external command (#6083)
Co-authored-by: Frank <v-frankz@microsoft.com>
2022-07-21 19:56:57 -04:00
Darren Schroeder
0bcfa12e0d
enable find to work on some external streams (#6094) 2022-07-21 13:19:16 -05:00
Fernando Herrera
b2ec32fdf0
concat string with lazy expressions (#6093) 2022-07-21 18:05:56 +01:00
pwygab
8f00848ff9
add a fair amount ofsearch terms (#6090) 2022-07-21 06:29:41 -05:00
Fernando Herrera
604025fe34
append string to series (#6089) 2022-07-21 10:42:12 +01:00
Darren Schroeder
db9b88089e
enable find to be able to highlight some hits (#6086)
* enable find to be able to highlight some hits

* oops, deps in the wrong place
2022-07-20 10:09:33 -05:00
WindSoilder
a35a71fd82
Make Semicolon stop on error (#6079)
* introduce external command runs to failed error, and implement semicolon relative logic

* ignore test due to semicolon works

* not raise ShellError for external commands

* update comment

* add relative test in for windows

* fix type-o

Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
2022-07-20 07:44:42 -05:00
pwygab
558cd58d09
make into string --decimals add decimals to integer numbers (#6084)
* make `into string --decimals` add decimals to integer numbers

* add exception for 0
2022-07-20 06:16:35 -05:00
Kangaxx-0
eeaca50dee
Conditionally disable expansion for external command (#6014)
* Fix 5978

* Add unit test for explicit glob

* Format

* Expansion vs none-expansion

* Add unit tests

* Fix format..

* Add debug message for MacOS

* Fix UT on Mac and add tests for windows

* cleanup

* clean up windows test

* single and double qoutes tests

* format...

* Save format.

* Add log to failed windows unit tests

* try `touch` a file

* PS or CMD

* roll back some change

* format

* Remove log and test case

* Add unit test comments

* Fix

Co-authored-by: Frank <v-frankz@microsoft.com>
2022-07-17 16:30:33 -05:00
Fernando Herrera
9d0be7d96f
check column type during aggregation (#6058)
* check column type during aggregation

* check first if there is schema
2022-07-16 15:34:12 +01:00
pwygab
57a6465ba0
add split list subcommand to split up lists (#6062)
* add `split list` subcommand to split up lists

* fmt

* fix shoddy signature
2022-07-16 06:24:37 -05:00
pwygab
3d45f77692
add wc search term for size and length (#6056) 2022-07-15 10:17:14 -05:00
Darren Schroeder
e01974b7ab
Ensure users colors are maintained when highlighting find matches (#6054) 2022-07-15 08:06:29 -05:00
Darren Schroeder
1f01677b7b
allow into int to convert octal numbers and 0 padded strings (#6053)
* allow `into int` to convert octal numbers and 0 padded strings

* added some tests in examples
2022-07-15 07:47:33 -05:00
Maxim Zhiburt
7bf09559a6
Refactoring nu_table (#6049)
* nu-table: Remove unused dependencies

Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>

* nu-table: Small refactoring

Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>

* nu-table: Refactoring

Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>

* nu-table: Refactoring alignments

Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>

* nu-table: Add width check

Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>

* nu-table/ Use commit instead of branch of tabled

To be safe

* Update Cargo.lock

Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>

* nu-table: Bump tabled

Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>
2022-07-14 15:24:32 -05:00
Jakub Žádník
26f31da711
Split merging of parser delta and stack environment (#6005)
* Remove comment

* Split delta and environment merging

* Move table mode to a more logical place

* Cleanup

* Merge environment after reading default_env.nu

* Fmt
2022-07-14 17:09:27 +03:00
pwygab
89b374cb16
allow for easy reset of config files with a single command (#6041)
* allow for easy config reset with a single command

* add slightly better help, rebase

* add option to make no backups, make all backups unique through including UNIX Epoch Time in the filename

* time is now formatted in rfc3339

* time is now formatted in a window-friendly format
2022-07-13 10:03:42 -05:00
nibon7
47c1f475bf
Fix panic when opening symlink which points to an inaccessible directory (#6034)
* Fix panic when opening symlink which points to an inaccessible directory

Fixes #6027

Signed-off-by: nibon7 <nibon7@163.com>

* tweak words

Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
2022-07-13 07:00:30 -05:00
Maxim Zhiburt
f2a79cf381
nu-table: Don't show empty header (#6035)
Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>
2022-07-13 06:43:39 -05:00
Darren Schroeder
ad9449bf00
add ability to do into int on floats using a radix (#6033) 2022-07-12 20:37:57 -05:00
Darren Schroeder
c2f8f4bd9b
fix small bug converting string to int (#6031) 2022-07-12 19:34:26 -05:00
Maxim Zhiburt
93a965e3e2
nu_table: Fix style of tables with no header (#6025)
Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>
2022-07-12 20:56:36 +03:00
pwygab
a54f9719e5
add unspanned flag to error make, add tests (#6017)
* add `unspanned` flag to error make, add tests

* fmt
2022-07-12 06:03:50 -05:00
JT
a5470b2362
use simpler reedline (#6016) 2022-07-12 13:25:31 +12:00
Jakub Žádník
f3036b8cfd
Allow keeping selected environment variables from removed overlay (#6007)
* Allow keeping selected env from removed overlay

* Remove some duplicate code

* Change --keep-all back to --keep-custom

Because, apparently, you cannot have a named flag called --keep-all,
otherwise tests fail?

* Fix missing line and wrong test value
2022-07-11 23:58:28 +03:00
Darren Schroeder
9b6b817276
update some dependencies (#6009)
* update some dependencies

* there may be some bugs here but it seems to compile and run

* clippy
2022-07-11 11:18:06 -05:00
WindSoilder
9e3c64aa84
Add bytes collect, bytes remove, bytes build cmd (#6008)
* add bytes collect

* index_of support searching from end

* add bytes remove

* make bytes replace work better for empty pattern

* add bytes build

* remove comment

* tweak words

Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
2022-07-11 06:26:00 -05:00
pwygab
f85a1d003c
throw parser error when multiple short flags are defined without whitespace (#6000)
* throw error when multiple short flags are defined without whitespace

* add tests
2022-07-10 20:32:52 +12:00
Maxim Zhiburt
121e8678b6
nu-table: Fix a term_width value (#5997)
Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>
2022-07-09 14:55:47 -05:00
WindSoilder
81df42d63b
add more bytes cmd (#5989) 2022-07-08 21:42:31 -05:00
Darren Schroeder
c0ce78f892
add the ability to highlight with regular expressiosn (#5992) 2022-07-08 16:28:10 -05:00
默可思
221f36ca65
Add --directory (-D) flag to ls, list the directory itself instead of its contents (#5970)
* Avoid extending the directory without globs in `nu_engine::glob_from`

* avoid joining a `*` to the directory without globs

* remove checks on directory permission and whether it is empty

The previous implemention of `nu_engine::glob_from` will extend the
given directory even if it containes no glob pattern. This commit
overcomes lack of consistency with the function `nu_glob::glob`.

* Add flag -D to ls, to list the directory itself instead of its contents

* add --directory (-d) flag to ls

* correct the difference between the given path and the cwd

* set default path to `.` instead of `./*` when --directory (-d) flag is true

* add comments

* add an example

* add tests

* fmt
2022-07-08 14:15:34 -05:00
valdaarhun
125e60d06a
Add search terms to 'math' commands (#5990)
* Remove 'average' from search_terms

* Add search_terms to 'floor' and 'variance'
2022-07-08 09:14:51 -05:00
Reilly Wood
83458510a9
Revert "Return error when external command core dumped (#5908)" (#5987)
This reverts commit 5d00ecef56.
2022-07-07 20:00:04 -04:00
Darren Schroeder
eac5f62959
tweak the find hit highlighting (#5981) 2022-07-07 11:32:58 -05:00
Darren Schroeder
b19cc799aa
make history.txt and history.sqlite3 tables have same command column (#5980) 2022-07-07 07:59:00 -05:00
Darren Schroeder
efa56d0147
add the ability to highlight searched for terms (#5979) 2022-07-07 07:14:06 -05:00
pwygab
47f6d20131
adds better error for failed string-to-duration conversions (#5977)
* adds better error for failed string-to-duration conversions

* makes error multi-spanned, conveys literally all the information available now
2022-07-07 05:54:38 -05:00
WindSoilder
e0b4ab09eb
compatible with old rust (#5974) 2022-07-06 18:22:45 -05:00
Maxim Zhiburt
d1687df067
Give tabled a try (#5969)
* Drop in replacement from nu-table to tabled.

Must act the same way as original nu-table.

Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>

Fix some issues

Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>

* Bump ansi-str version

Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>

* Update to latest

Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>

* Fix footer issue

Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>

* Fix header alignment

Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>

* Fix header style

Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>

* Use latest tabled/ansi-str

* Refactorings

Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>

* Fix clippy warnings

Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>
2022-07-06 14:57:40 -05:00
pwygab
e77219a59f
allow where to work with variables (#5955)
* allow `where` to work with variables; breaking change

* change is no longer breaking, adds named to allow passage of blocks

* adds tests

* fmt
2022-07-06 08:49:07 -05:00
WindSoilder
22edb37162
Add some bytes relative cmd (#5967)
* add reverse, ends_with command

* add bytes replace, make little refactor

* add bytes add
2022-07-06 08:25:37 -05:00
Darren Schroeder
1ac87715ff
add bytes root command (#5956)
* add bytes root command

* fixed type-o
2022-07-06 16:46:56 +12:00
Justin Ma
de162c9aea
Bump to 0.65.1 dev version (#5962) 2022-07-06 16:25:09 +12:00
WindSoilder
390d06d4e7
add bytes starts-with command (#5950)
* refactor operate, make it generic

* refactor operate, add starts with command

* add comment

* remove useless file
2022-07-05 06:42:01 -05:00
Stefan Holderbach
89acbda877
Pin reedline to new 0.8.0 release (#5954)
For the nushell 0.65.0 release

https://github.com/nushell/reedline/releases/tag/v0.8.0
2022-07-05 21:25:35 +12:00
JT
0d40d0438f
bump to 0.65 (#5952) 2022-07-05 17:54:16 +12:00
WindSoilder
1e8212a938
add bytes len (#5945) 2022-07-04 05:51:07 -05:00
JT
2da8310b11
Fix 'skip' support for binary streams (#5943) 2022-07-04 19:53:54 +12:00
JT
c16d8f0d5f
Make take work like first (#5942) 2022-07-04 08:03:35 +12:00
JT
2ac5b0480a
Binary into int (#5941)
* Add support for binary to into int

* Add test
2022-07-04 06:31:50 +12:00
Justin Ma
4e90b478b7
Add bit operator: bit-xor (#5940) 2022-07-03 06:45:20 -05:00
pwygab
3a38fb94f0
add search terms for is-admin (#5939) 2022-07-03 06:44:26 -05:00
Justin Ma
b82dccf0bd
Add band and bor operator for bit operations (#5936)
* Add `band` and `bor` Operator

* Add tests
2022-07-02 13:03:36 -05:00
WindSoilder
84caf8859f
add -e flag to print, to print the value to stderr (#5935)
* Refactor: make stdout write all and flush as generic function

* support print to stderr
2022-07-02 09:54:49 -05:00
nibon7
be7f35246e
Fix to md --pretty when rendering a list (#5932)
Fixes #5931

Signed-off-by: nibon7 <nibon7@163.com>
2022-07-02 15:36:16 +03:00
Justin Ma
3917fda7ed
Update #4202: Add shift operator bshl and bshr for integers (#5928)
* Update #4202: Add shift operator bshl and bshr for integers

* Add more tests
2022-07-02 06:48:43 -05:00
Darren Schroeder
3b357e5402
fix parse_failure_due_conflicted_flags test (#5926) 2022-07-01 21:59:51 -05:00
WindSoilder
79da470239
simplify error make (#5883) 2022-07-01 21:06:36 -05:00
Kangaxx-0
37949e70e0
Add all flag to nu-check command (#5911)
* Add all flag

* Make all and moduel flags as mutually exclusive

* Fix new test

* format code...

* tweak words

* another tweak

Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
2022-07-01 15:49:24 -05:00
nibon7
5d00ecef56
Return error when external command core dumped (#5908)
* Return error when external command core dumped

Fixes #5903

Signed-off-by: nibon7 <nibon7@163.com>

* Use signal-hook to get signal name

Signed-off-by: nibon7 <nibon7@163.com>

* Fix comment

Signed-off-by: nibon7 <nibon7@163.com>
2022-07-01 08:58:21 -05:00
Michael Angerman
58fa2e51a2
update crate thiserror to version 1.0.31 in crates nu-cli, nu-command, nu-parser, nu-protocol (#5919) 2022-06-30 13:55:01 -07:00
pwygab
a0db4ce747
Better error handling using do (#5890)
* adds `capture-errors` flag for `do`

* adds `get-type` core command to get type

* fmt

* add tests in example

* fmt

* fix tests

* manually revert previous changes related to `get-type`

* adds method to check for error name using `into string`

* fix clippy
2022-06-29 20:01:34 -05:00
Benoît Cortier
1c15a4ed3a
docs: clarify print and echo commands (#5909)
I thought this comment was relevant:
https://github.com/nushell/nushell/issues/5724#issuecomment-1148164153
2022-06-29 18:43:46 -04:00
Darren Schroeder
7aabc381a3
fix bug where thin theme wasn't getting applied correctly (#5905) 2022-06-28 14:14:20 -05:00
Reilly Wood
06d5a31301
Make sort logic available outside sort-by (#5893) 2022-06-27 13:36:59 -04:00
Fernando Herrera
ffbc0b0180
Header filtering out of for loop (#5896)
* remove extra print

* dataframe with real index

* corrected dataframe tests

* clippy error

* clippy error

* moved header filter out of loop
2022-06-27 06:33:45 -05:00
Fernando Herrera
c0901ef707
Dataframe with real index (#5892)
* remove extra print

* dataframe with real index

* corrected dataframe tests

* clippy error

* clippy error
2022-06-26 17:32:18 -05:00
Fernando Herrera
d3e84daa49
remove extra print (#5891) 2022-06-26 11:48:30 -05:00
WindSoilder
c5a69271a2
make path exists work on expanded path (#5886)
* make path exists works with home

* fix test name
2022-06-26 06:55:55 -05:00
Kangaxx-0
dc9d939c83
Introduce new command - nu check (#5864)
* nu check command - 1

* Support stream

* Polish code and fix corner case
2022-06-26 06:53:06 -05:00
Benoît Cortier
32f0f94b46
feat: add --binary(-b) option to hash commands (#5885)
For instance,

```
echo 'abcdefghijklmnopqrstuvwxyz' | hash sha256 --binary
```

Will returns the hash as a binary value instead of a hexadecimaly encoded string.
2022-06-26 06:50:56 -05:00
Darren Schroeder
a142d1a192
update encode decode with new signature (#5881) 2022-06-25 19:06:39 -05:00
Benoît Cortier
173d60d59d
Deprecate hash base64, extend decode and add encode commands (#5863)
* feat: deprecate `hash base64` command

* feat: extend `decode` and `encode` command families

This commit
- Adds `encode` command family
- Backports `hash base64` features to `encode base64` and `decode base64` subcommands.
- Refactors code a bit and extends tests for encodings
- `decode base64` returns a binary `Value` (that may be decoded into a string using `decode` command)

* feat: add `--binary(-b)` flag to `decode base64`

Default output type is now string, but binary can be requested using this new flag.
2022-06-26 00:35:23 +03:00
JT
f2989bf704
Move input/output type from Command to Signature (#5880) 2022-06-26 09:23:56 +12:00
Darren Schroeder
ef9b72d360
add ability to convert timestamp_millis() (#5876)
* add ability to convert timestamp_millis()

* add example test

* add nanos too
2022-06-25 09:51:41 -05:00
Justin Ma
25349a1eac
Add an example for default command to get an env var with fallback (#5874)
* Add an example for `default` command to get an env var with fallback

* update test

* update test
2022-06-25 17:27:54 +08:00
pwygab
1345f97202
Errors when let in, let env and similar commands are passed. (#5866)
* throw `let nu/env/nothing/in` error in parsing

* add tests and fmt

* fix clippy

* suggestions

* fmt

* `lvalue.span` instead of `spans[1]`

* clippy

* fmt
2022-06-25 00:55:25 +03:00
JT
533e04a60a
Bump to 0.64.1 dev version (#5865) 2022-06-24 16:47:00 +12:00
Fernando Herrera
f231a6df4a
Remove quotes from external args (#5846)
* remove quotes from external args

* remove internal quotes

* correct escaped quotes in string
2022-06-22 22:01:44 -05:00
Fernando Herrera
3c0bccb900
Exclude ./... from expansion (#5839)
* exclude ./... from expansion

* use all instead of any

* no path expansion for external arguments

* clippy error

* expand only tilde
2022-06-22 22:00:30 -05:00
pwygab
f43a65d7a7
Prevents duplicate fields in transpose -r (#5840) 2022-06-22 19:19:06 -05:00
WindSoilder
82ae06865c
Port command (#5849)
* implement port command

* better comment

* fmt code

* fix example description

* fix usage

* fix tests
2022-06-21 23:27:58 -04:00
Fernando Herrera
7164929c61
Db commands without DB (#5838)
* database commands without db

* database command tests
2022-06-21 12:14:29 -05:00
pwygab
dbcfcdae89
calculates history duration properly (#5827) 2022-06-19 00:44:46 -04:00
pwygab
28c21121cf
fixes to nuon for inf, -inf, and NaN (#5818) 2022-06-17 21:01:37 +03:00
Darren Schroeder
a17d46f200
add more columns to the history command when using sqlite history (#5817) 2022-06-17 09:35:34 -05:00
Fernando Herrera
6cc8402127
Standardise to commands (#5800)
* standarize to commands

* move from to to into
2022-06-17 07:51:50 -05:00
Michael Angerman
bc48b4553c
Move the history and tutor commands out of core_commands (#5813)
* move history and tutor commands from core to misc

* add in the Misc Category for the history and tutor commands
2022-06-16 09:58:38 -07:00
nibon7
8b368b6a4e
Fix drop nth with open end range on 32-bit platforms (#5808)
Fixes #5793

Signed-off-by: nibon7 <nibon7@163.com>
2022-06-16 06:39:48 -05:00
WindSoilder
8c0d60d0fb
add notes for def_env (#5807)
* add notes for def_env

* Update crates/nu-command/src/core_commands/export_def_env.rs

Co-authored-by: Stefan Holderbach <sholderbach@users.noreply.github.com>

* Update crates/nu-command/src/core_commands/def_env.rs

Co-authored-by: Stefan Holderbach <sholderbach@users.noreply.github.com>

Co-authored-by: Stefan Holderbach <sholderbach@users.noreply.github.com>
2022-06-16 06:37:44 -05:00
Michael Angerman
cfe4eff566
update default_context.rs to put the Du command in platform instead core (#5795) 2022-06-15 11:11:26 -07:00
Fernando Herrera
38f3957edf
update polars (#5791) 2022-06-15 11:45:03 -05:00
JT
d1c719a8cc
bump to 0.64 (#5777)
Co-authored-by: sholderbach <sholderbach@users.noreply.github.com>
2022-06-15 14:39:17 +12:00
WindSoilder
4d854f36af
add --values flag to sort record by values, by default, sort record by keys (#5782) 2022-06-14 20:42:22 -05:00
Fernando Herrera
8d5848c955
bool type for binary operations (#5779)
* bool type for binary operations

* fixed type in commands
2022-06-14 20:31:14 -05:00
Stefan Holderbach
fe88d58b1e
Pin reedline v0.7.0 for the nushell v0.64.0 release (#5781)
Includes the new History API and sqlite history backend

Release notes: https://github.com/nushell/reedline/releases/tag/v0.7.0
2022-06-14 23:21:14 +02:00
phiresky
42dbfd1fa0
SQLite History MVP with timestamp, duration, working directory, exit status metadata (#5721)
This PR adds support for an SQLite history via nushell/reedline#401

The SQLite history is enabled by setting history_file_format: "sqlite" in config.nu.

* somewhat working sqlite history
* Hook up history command
* Fix error in SQlitebacked with empty lines

When entering an empty line there previously was the "No command run"
error with `SqliteBackedHistory` during addition of the metadata

May be considered a temporary fix

Co-authored-by: sholderbach <sholderbach@users.noreply.github.com>
2022-06-14 22:53:33 +02:00
Fernando Herrera
ff946a2f21
each while command (#5771)
* each while command

* test value adjustment
2022-06-14 16:16:31 +02:00
WindSoilder
3c0cbec993
sort not change shape (#5778) 2022-06-14 06:41:45 -05:00
WindSoilder
48e29e9ed6
path join support multi path (#5775) 2022-06-14 06:34:00 -05:00
pwygab
ff53352afe
Add option to sort-by naturally (#5774)
* add `natural` option to sort-by

* clippy

* Add tests
2022-06-14 09:03:13 +03:00
Mathspy
4fd4136d50
Should we keep old semantics of uniq command? (#5761)
* Update uniq tests with less surprising output

* Remove original nushell surprising semantics
2022-06-14 16:04:29 +12:00
Stefan Stanciulescu
dc1248a454
Fix drop nth bug (#5312)
* Fix drop nth bug on ranges. Should fix & close #5260

* Fix drop nth bug on ranges. Should fix & close #5260

* Add support for ranges

* Working version of drop nth, but the issue is that we unwrap the value which is problematic for Streams. Should convert to the way @stormasm was doing it before and implement the range check

* Fix fmt issue

* Drop nth now works for Lists, Records, and Ranges. We need support for ListStreams and for ExternalStreams

* Keep consistent naming

* Fix fmt issue

* Support ListStreams for drop nth

* Use DropNthIterator instead

* Found a more elegant way to deal with the check for no upper bound input

* Add extra checks for negative inputs or to < from for ranges

Co-authored-by: Stefan Stanciulescu <test@test.com>
2022-06-13 20:49:59 -07:00
Fernando Herrera
de554f8e5f
filesize conversion (#5770) 2022-06-13 14:44:32 -05:00
Fernando Herrera
44979f3051
expression to literal (#5769) 2022-06-13 13:22:46 -05:00
JT
7ae7394c85
Force floats to output a decimal in nuon (#5768)
* Force floats to output a decimal in nuon

* Add test
2022-06-14 05:45:07 +12:00
Darren Schroeder
9dbf7556b8
more verbose error handling (#5765) 2022-06-13 07:01:00 -05:00
pwygab
caafd26deb
Attempts to add // math operator (#5759)
* attempts to add `div` math operator

* allows `//` to be used too

* fmt:

* clippy issue

* returns appropriate type

* returns appropriate type 2

* fmt

* ensure consistency; rename to `fdiv`

* Update parser.rs
2022-06-13 13:54:47 +03:00
Fernando Herrera
11d7d8ea1e
Remove dfr from dataframe commands (#5760)
* input and output tests

* input and output types for dfr

* expression converter

* remove deprecated command

* correct expressions

* cargo clippy

* identifier for ls

* cargo clippy

* type for head and tail expression

* modify full cell path if block
2022-06-12 14:18:00 -05:00
Fernando Herrera
d5b99ae316
input and output types (#5750)
* input and output types

* added description

* type from stored variable

* string in custom value

* more tests with non custom
2022-06-10 10:59:35 -05:00
WindSoilder
b42ef45c7c
add as record tag to transfer result to record (#5736)
* add as record tag to transfer result to record

* tweak text

Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
2022-06-08 07:00:19 -05:00
pwygab
3423cd54a1
add search terms to alias (#5737) 2022-06-08 06:22:53 -05:00
Darren Schroeder
c57f41e5f2
make to text work more intuitively (#5733) 2022-06-07 14:43:24 -05:00
pwygab
8318d59ef1
improve str substring (#5730) 2022-06-07 06:09:16 -05:00
Justin Ma
64efa30f3e
fix: normalize some parameter names (#5725) 2022-06-06 09:42:13 -05:00
Jae-Heon Ji
820a6bfb08
feat: add search terms to category of strings (#5723) 2022-06-06 08:47:09 -05:00
pwygab
b8d253cbd7
Attempts to add a command that checks if nushell is running with admin priveleges (#5712)
* attempts to add is-admin command

* fmt and clippy

* fmt

* Update is_admin.rs

* typos

* typo in example
2022-06-06 06:55:23 -05:00
WindSoilder
75b2d26187
fix argument type (#5695)
* fix argument type

* while run external, convert list argument to str

* fix argument converting logic

* using parse_list_expression instead of parse_full_cell_path

* make parsing logic more explicit

* revert changes

* add tests
2022-06-06 13:19:06 +03:00
pwygab
fda456e469
make range require the rows (#5710) 2022-06-04 18:48:01 +12:00
Stefan Holderbach
e5d38dcff6
Address lints from clippy for beta/nightly (#5709)
* Fix clippy lints in tests

* Replace `format!` in `.push_str()` with `write!`

Stylistically that might be a bit rough but elides an allocation.

Fallibility of allocation is more explicit, but ignored with `let _ =`
like in the clippy example:

https://rust-lang.github.io/rust-clippy/master/index.html#format_push_string

* Remove unused lifetime

* Fix macro crate relative import

* Derive `Eq` for `PartialEq` with `Eq` members

https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

* Remove unnnecessary `.to_string()` for Cow<str>

* Remove `.to_string()` for `tendril::Tendril`

Implements `Deref<Target = str>`
2022-06-04 18:47:36 +12:00
Stefan Holderbach
a82fa75c31
Update nu-ansi-term to remove Deref impl (#5706)
Resolves an unexpected issue due to `Deref` and `ToString` interacting

Details: https://github.com/nushell/nu-ansi-term/pull/5 and https://github.com/nushell/reedline/pull/435#issuecomment-1141348209

Also updates reedline: Includes a fix for a panic when the directory containing the history is deleted during a running reedline session. (nushell/reedline#436)
2022-06-03 21:38:54 +02:00
Reilly Wood
888758b813
Fix ls for Windows system files (#5703)
* Fix `ls` for Windows system files

* Fix non-Windows builds

* Make Clippy happy on non-Windows platforms

* Fix new test on GitHub runners

* Move ls Windows code into its own module
2022-06-03 12:37:27 -04:00
Stefan Holderbach
a75318d7e8
Improve internal documentation of save command (#5704)
- Example for `--append` mode.
- Search terms for redirection
2022-06-03 11:35:31 +02:00
Per Bothner
a06299c77a
Improve <table> output of 'to html', (#5699)
* Fix <table> output of 'to html',

Specifically, add <thead> and <tbody> elements.
That allows for better styling and (future) some neat JavaScript.

* Update tests for previous <table> changes.
2022-06-02 17:34:31 -05:00
Jakub Žádník
4673adecc5
Fix wrong path help message (#5698) 2022-06-02 23:00:29 +03:00
Justin Ma
1b8051ece5
Fix doc building for vuepress-next, avoid using angle brackets (#5696)
* Fix doc building for vuepress-next, avoid using angle brackets

* [ci skip]
2022-06-02 17:38:42 +08:00
Justin Ma
d44059c36b
feat: Add sensitive flag to get, fix #4295 (#5685)
* feat: Add insensitive flag to get, fix #4295

* add get insensitive example

* Fix get flags

* Update get examples
2022-06-01 08:34:42 -05:00
Kangaxx-0
ee8a0c9477
Fix cp bug (#5642) 2022-05-31 18:24:33 -05:00
Fernando Herrera
997d56a288
Lazy dataframes (#5687)
* change between lazy and eager

* when expressions

* examples for aggregations

* more examples for agg

* examples for dataframes

* checked examples

* cargo fmt
2022-05-31 07:29:55 +01:00
WindSoilder
0769e9b750
make ls works better with glob (#5691)
* fix glob behavior

* fix doc
2022-05-30 19:13:27 -05:00
WindSoilder
f5519e2a09
base64 command more friendly (#5680)
* base64 command more friendly

* using match instead of so much else if..
2022-05-30 09:30:16 +02:00
pwygab
c42096c34e
Add '-o'/--output flag to fetch to download to file (#5673)
* attemps to add '-o' flag to `fetch`

* fmt

* changed from 'output' to 'file'.

* Revert "changed from 'output' to 'file'."

As @hustcer mentioned, all typical command line tools for downloading
use `-o` or `-O` and a variation on `--output` for the file

This reverts commit 6baf718f91.

Co-authored-by: sholderbach <sholderbach@users.noreply.github.com>
2022-05-29 18:32:30 +02:00
Justin Ma
23a73cd31f
feat: Add search terms to find, where, exit, which and fetch, update #5093 (#5671)
* feat: Add search terms to find, where, exit, which and fetch, update #5093

* Update crates/nu-command/src/filters/where_.rs

Co-authored-by: Stefan Holderbach <sholderbach@users.noreply.github.com>

* Update crates/nu-command/src/filters/find.rs

Co-authored-by: Stefan Holderbach <sholderbach@users.noreply.github.com>

* Update crates/nu-command/src/shells/exit.rs

Co-authored-by: Stefan Holderbach <sholderbach@users.noreply.github.com>

Co-authored-by: Stefan Holderbach <sholderbach@users.noreply.github.com>
2022-05-28 13:25:11 +02:00
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
Reilly Wood
f2d7454330
Add watch command (#5331) 2022-04-28 09:26:34 -05:00
Michael Angerman
4ec4649903
mute false import warning for nu-command test where_ (#5350) 2022-04-27 22:45:39 -07:00
Fernando Herrera
5c9fe85ec4
Database commands (#5343)
* dabase access commands

* select expression

* select using expressions

* cargo fmt
2022-04-27 11:52:31 +01:00
Reilly Wood
cd5199de31
db info tweaks (#5338)
* Rename db info to db schema

* Change db schema to take db as input
2022-04-26 18:16:46 -05:00
Darren Schroeder
5319544481
db info command (#5335)
* db info WIP

* working now

* clippy
2022-04-26 14:20:59 -05:00
JT
be3f0edc97
Fix 'range' range exclusive (#5334) 2022-04-26 13:39:38 -05:00
Xavier Gillard
190f379ff3
activates optional trim in 'from csv' and 'from tsv' (#5326) 2022-04-25 12:54:14 -05:00
Herlon Aguiar
cd2df83ddc
nu-command/filesystem: clean whitespaces from paths in cd and open (#5310) 2022-04-25 07:15:33 +12:00
Fernando Herrera
e94d13da1b
Database commands (#5307)
* database commands

* db commands

* filesystem opens sqlite file

* clippy error

* corrected error in ci file

* removes matrix flag from ci

* flax matrix for clippy

* add conditional compile for tests

* add conditional compile for tests

* correct order of command

* correct error msg

* correct typo
2022-04-24 10:29:21 +01:00
Ron Waldon
c20ba95885
fix: remove println!() from exec builtin (#5311) 2022-04-24 15:24:44 +12:00
Darren Schroeder
e2b510b65e
update sys with new items, add kernel version to os-info (#5308)
* update sys with new items, add kernel version to os-info

* clippy
2022-04-23 16:33:27 -05:00
Abdulqudduus Babalola
667eb27d1b
feat: add search terms to date (#5306)
* add search terms

* add search terms

* add search terms

* add search terms

* add search terms

* add search terms

* add search terms

* add search terms

* add search patterns

* run cargo fmt --all
2022-04-23 08:54:03 -05:00
JT
cc78446ffd
Fix cd - (#5301) 2022-04-23 11:48:10 +12:00
Herlon Aguiar
5ff2ae628b
nu-cli: directory syntax shape + completions (#5299) 2022-04-22 15:18:51 -05:00
Reilly Wood
a26272b44b
Clean up tests and unused documentation code (#5273)
* Delete unused documentation code+test

* Fix up test to account for new select behavior
2022-04-21 06:13:58 -05:00
JT
96253c69fb
Use better quoting for commandline args (#5271) 2022-04-21 15:31:52 +12:00
JT
ded9d1cedb
Some cleanups for clippy (#5266) 2022-04-21 12:08:12 +12:00
Jae-Heon Ji
e97ba9b74c
feat: add search terms for conversions (#5259) 2022-04-20 11:48:32 -05:00
Jaffar Ashoor
0fb6f8f93c
refactor html module (#5246)
* refactor around html module

* Update html.rs

fix clippy warning

* minify json
2022-04-20 08:50:14 -05:00
Stefan Holderbach
995d8db1fe
Set to reedline main branch for development cycle (#5249)
Changes to reedline since `v0.4.0`:

- vi normal mode `I` for inserting at line beginning
- `InsertNewline` edit command that can be bound to `Alt-Enter` if
desired to have line breaks without relying on the `Validator`
- `ClearScreen` will directly clear the visible screen. `Signal::CtrlL` has been
removed.
- `ClearScrollback` will clear the screen and scrollback. Can be used to
mimic macOS `Cmd-K` screen clearing. Helps with #5089
2022-04-20 21:10:33 +12:00
Reilly Wood
7e97be1dd4
Handle custom values in describe command (#5248) 2022-04-20 16:59:53 +12:00
Reilly Wood
b501db673a
SQLite overhaul: custom value, query db command (#5247)
Clean up query errors
2022-04-20 16:58:21 +12:00
JT
76079d5183
Move config to be an env var (#5230)
* Move config to be an env var

* fix fmt and tests
2022-04-19 10:28:01 +12:00
Yethal
409f1480f5
allow par-each to receive $in (#5229)
Co-authored-by: Yethal <nosuchemail@email.com>
2022-04-19 10:02:58 +12:00
merelymyself
88ec4186ec
Added search terms to math commands (#5224) 2022-04-19 09:33:32 +12:00
Kat Marchán
1314a87cb0
update miette and switch to GenericErrors (#5222) 2022-04-19 00:34:10 +12:00
Thomas B Homburg
c9f05f074a
nth -> select command (#5217) 2022-04-17 09:54:24 -05:00
nicole mazzuca
6e85b04923
[ls, path relative-to] Fix use of ls ~ | path relative-to ~ (#5212)
* [ls] implement 1b.

> `ls ~` does not return paths relative to the current directory.

We now return `/Users/blah` instead of `../../blah`

* expand lhs and rhs on `path relative-to`

/Users/nimazzuc/projects/nushell〉'~' | path relative-to '~'
/Users/nimazzuc/projects/nushell〉'~/foo' | path relative-to '~'
foo
/Users/nimazzuc/projects/nushell〉'/Users/nimazzuc/foo' | path relative-to '~'
foo
/Users/nimazzuc/projects/nushell〉'~/foo' | path relative-to '/Users/nimazzuc'
foo

* format
2022-04-16 15:05:42 -05:00
Darren Schroeder
4d31139a44
add hex color parsing to ansi (#5209) 2022-04-16 10:44:04 -05:00
Michael Angerman
1bad40726d
cleanup nu-command, remove redundant code (#5208) 2022-04-16 18:16:46 +12:00
JT
5bf1c98a39
Move to dev version 0.61.1 (#5206) 2022-04-16 09:29:30 +12:00
ZetaNumbers
583b7b1821
fix: reduce command have not redirected block's evaluation output (#5193)
fixes https://github.com/nushell/nushell/issues/5190
2022-04-15 07:03:16 -05:00
Dan Swain
8e2847431e
Avoid duplicating post headers (#5200)
* Avoid duplicating post headers

This should fix #5194

* Update post.rs

Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
2022-04-15 06:02:22 -05:00
nibon7
2fe14a7a5a
fix timestamp parsing on 32-bit platforms (#5192)
Fixes #5191
2022-04-14 08:52:32 -05:00
Tiffany Bennett
7490392eb9
Add char -i for chars from integers (#5183)
* Revert "Allow integer to `char -u` (#5174)"

This reverts commit cfefb65d55.

* Add `char -i`

* Reword example
2022-04-14 08:34:02 -05:00
Michael Angerman
1d1dbfd04c
update crate chrono-tz to its latest version (#5184) 2022-04-13 21:16:08 -07:00
Reilly Wood
c150e11cb4
Initial SQLite functionality (#5182)
* Add SQLite functionality to open

* Add in-memory SQLite tests

* clippy fixes

* Fix up old SQLite-related tests
2022-04-13 20:15:02 -07:00
nicole mazzuca
87c684c7da
don't join paths to cwd ever in calls to external functions (#5180)
This is a follow-up to #5131, since I don't personally like the way it worked.
2022-04-13 21:42:57 +03:00
Darren Schroeder
10792a29f7
allow default color shortcut names (#5177)
* allow default color shortcut names

* clippy
2022-04-13 07:02:15 -05:00
Tiffany Bennett
cfefb65d55
Allow integer to char -u (#5174) 2022-04-13 13:33:08 +03:00
JT
4566c904d0
Bump 0.61 (#5166) 2022-04-13 05:42:26 +12:00
Stefan Holderbach
9b020c056b
Pin reedline version for 0.61 release (#5164) 2022-04-13 04:38:36 +12:00
Reilly Wood
57761149f4
Update incorrect crate descriptions (#5159) 2022-04-12 06:17:06 +12:00
nicole mazzuca
521e28dcdc
fix #5131 (#5153)
I don't personally agree with this; I'd prefer less magic,
and not expanding _anything_ except `~` as an initial path element

Co-authored-by: nicole mazzuca <mazzucan@outlook.com>
2022-04-11 20:05:39 +12:00
JT
4fd73ef54a
Allows aliases in use lists (#5150) 2022-04-11 07:37:22 +12:00
Darren Schroeder
791e8a0e59
enable ls to output datetime in local time vs utc (#5141)
* enable `ls` to output datetime in local time vs utc

* clippy
2022-04-09 11:39:41 -05:00
JT
14066ccc30
Fix known externals, fix operator spans (#5140) 2022-04-09 17:17:48 +12:00
Hristo Filaretov
683b912263
Track call arguments in a single list (#5125)
* Initial implementation of ordered call args

* Run cargo fmt

* Fix some clippy lints

* Add positional len and nth

* Cargo fmt

* Remove more old nth calls

* Good ole rustfmt

* Add named len

Co-authored-by: Hristo Filaretov <h.filaretov@protonmail.com>
2022-04-09 14:55:02 +12:00
JT
97eb8492a3
Improve $in handling (#5137)
* Simplify in logic

* Add tests

* more tests, and fixes
2022-04-09 09:41:05 +12:00
JT
0892a16a3d
Let 'each' also send input to block (#5136) 2022-04-09 07:57:43 +12:00
Darren Schroeder
74d0f19291
added ability to opt in to normal string replacement in replace cmd (#5133)
* added ability to opt in to normal string replacement in `replace` cmd

* type-o
2022-04-08 12:23:16 -05:00
Michel Alexandre Salim
6ed033737d
Include license text in all crates (#5094)
* Include license text in all crates

Three crates already have license texts, so I'm keeping them, but
symlinking the `LICENSE` from the top level to the rest of the crate
directories. This works as long as `cargo publish` is done on a Unix-y
system and not Windows.

Also bump the copyright year to end in 2022.

Signed-off-by: Michel Alexandre Salim <salimma@fedoraproject.org>

* Replace symlinks

Co-authored-by: sholderbach <sholderbach@users.noreply.github.com>
2022-04-08 10:47:13 +02:00
Reilly Wood
d38a3a8b4e
Fix command descriptions+examples (#5129)
* Fix exit usage

* Move dfr as-date* format examples to extra_usage

* Update command usage and examples

* More docs on `str trim`

Co-authored-by: sholderbach <sholderbach@users.noreply.github.com>
2022-04-08 10:30:49 +02:00
Darren Schroeder
bdfad6b1de
add keep deprecated commands (#5124) 2022-04-08 10:10:46 +12:00
JT
4f974efeba
Move 'keep' to 'take' (#5123) 2022-04-08 08:49:28 +12:00
Darren Schroeder
4129f15eb9
update str find-replace to str replace (#5120) 2022-04-07 08:41:09 -05:00
Robert Broketa
690ec9abfa
Implement rest of touch flags (#5119)
* Add timestamp flag to `touch` command

* Add modify flag to `touch` command

* Add date flag to `touch` command

* Remove unnecessary `touch` test and fix tests setups

* Change `touch` flags descriptions

* Update `touch` example

* Add reference flag to `touch` command

* Add access flag to `touch` command

* Add no-create flag to `touch` command

* Replace `unwrap` with `expect`
2022-04-07 06:44:05 -05:00
Reilly Wood
b2c52b51b7
Change string contains operators to regex (#5117) 2022-04-07 18:23:14 +12:00
JT
591fb4bd36
Add unary not (#5111) 2022-04-07 07:10:25 +12:00
Reilly Wood
d0e636ae7a
Trim newline from input results (#5097) 2022-04-05 12:52:09 -05:00
Darren Schroeder
6e7e2dbb97
enables find to search records with regex (#5100)
* enables find to search records with regex

* clippy
2022-04-05 12:26:11 -05:00
Reilly Wood
d64cf1687e
Fix Format for non-basic data types (#5095) 2022-04-05 07:45:38 -05:00
Reilly Wood
657b631fdc
Add search terms to many commands (#5096) 2022-04-05 07:01:21 -05:00
Darren Schroeder
e2cf4cc7d6
new glob command (#5087) 2022-04-05 08:45:01 +12:00
Elijah Koreman
1e4b33b9c6
Add quiet and feedback to mv command (#5073)
* Add quiet and feedback to mv command

* replaced filter and map with filter_map
2022-04-05 06:30:51 +12:00
Darren Schroeder
4654f03d31
update shadow-rs, update git2, remove indexmap from version (#5086) 2022-04-04 09:59:59 -05:00
Reilly Wood
d40109f210
Tweak append+prepend help (#5080) 2022-04-03 17:50:22 -05:00
Reilly Wood
20be8a4987
Fix for search terms in help --find (#5081)
* Fix search terms in help --find

* Update help --find description
2022-04-03 17:37:22 -05:00
Simon Goller
19c3570cf9
Allow open to work with 'from ...' block commands (#5049)
* Remove panic from BlockCommands run function

Instead of panicing, the run method now returns an error to prevent
nushell from unexpected termination.

* Add ability to open command to run with blocks

The open command tries to parse the content of the file
if there is a command called 'from (file ending)'.  This works
fine if the command was 'built in' because the run method doesn't
fail in this case.  It did fail on a BlockCommand, though.

This change will first probe if the command contains a block and
evaluate it, if this is the case.  If there is no block, it will run
the command the same way as before.

* Add test open files with BlockCommands

* Update open.rs

* Adjust file type on open with BlockCommand parser

Co-authored-by: JT <547158+jntrnr@users.noreply.github.com>
2022-04-02 07:52:32 +13:00
Darren Schroeder
2cb815b7b4
Add starts with operator (#5061)
* add starts_with operator

* added a test
2022-04-01 13:35:46 -05:00
Fernando Herrera
a088081695
update reedline (#5062) 2022-04-01 19:22:40 +01:00
JT
4bb95a880f
let a simple last be a single value (#5060) 2022-04-01 23:12:31 +13:00
JT
9beecff736
Add 'date to-record' (#5058) 2022-04-01 21:09:30 +13:00
JT
fa0400c3f2
Fix sort signature (#5055) 2022-04-01 13:03:07 +13:00
JT
834f993547
Sort command (#5054) 2022-04-01 11:43:16 +13:00
Reilly Wood
f692da487e
Fix load-env unsupported input error message (#5039) 2022-04-01 10:59:04 +13:00
msp
6a6471b04b
feat: add --suppress-output (-s) to input command (#5017)
* feat: add --suppress-output (-s) to input command

* Don't handle cursor position since existing impl doesn't

* Handle all raw mode outcomes
2022-03-31 14:20:31 -05:00
Reilly Wood
e2d24c5956
Fix which-support feature (#5038) 2022-03-30 13:37:31 -05:00
Reilly Wood
79182db587
Clean up which/which-support Cargo feature (#5019)
* Rename "which" feature to "which-support"

* Ignore currently broken environment tests
2022-03-29 06:10:43 -05:00
Richard Wang
1aef3a730a
fix: pass metadata to more filter commands for ls_colors (#5009)
* fix(filters): pass metadata for select

* fix(filters): pass metadata for group, window

* fix(filters): pass metadata for each, every

* fix(filters): pass metadata for collect, compact, flatten

* fix(filters): pass metadata for get

* fix: get rid of necessary `.clone()``

* style: rename closure call to be consistent w/ others

* fix(filters): pass metadata for par-each, prepend

* fix(filters): pass metadata for range

* fix(filters): pass metadata for reject

* fix(filters): pass metadata for more commands

* style: run cargo fmt
2022-03-28 06:43:09 -05:00
JT
2e3b74f1b2
Fix for loop ctrlc not terminating (#5003) 2022-03-28 19:13:43 +13:00
Jakub Žádník
2873e943b3
Add search terms to Command and Signature (#4980)
* Add search terms to command

* Rename Signature desc to usage

To be named uniformly with extra_usage

* Throw in foldl search term for reduce

* Add missing usage to post

* Add search terms to signature

* Try to add capnp Signature serialization
2022-03-27 22:25:30 +03:00
Fernando Herrera
a4410fef40
Help menu (#4992)
* nu-completer with suggestions

* help menu with scrolling

* updates description rows based on space

* configuration for help menu

* update nu-ansi-term

* corrected test for update cells

* changed keybinding
2022-03-27 14:01:04 +01:00
Darren Schroeder
ee5064abed
Nu ansi term update (#4988)
* WIP: Testing 0.45.1 nu-ansi-term with the new Default colors

* point reedline to git in cargo.toml
2022-03-27 16:57:31 +13:00
JT
82e3bb0f38
Bump nushell to 0.60.1 (#4987) 2022-03-27 16:18:47 +13:00
Andrew Barnes
319930a1b9
Add streaming support to save for ExternalStream data (#4985)
* Add streaming support to save for ExternalStream data

Prior to this change, save would collect data from an ExternalStream (data
originating from externals) consuming memory for the full amount of data piped
to it,

This change adds streaming support for ExternalStream allowing saving of
arbitrarily large files and bounding memory usage.

* Remove broken save test

This test passes but not for the right reasons, since this test was
written filename has become a required parameter.  The parser outputs
an error but the test still passes as is checking the original un-mutated
file assuming save has re-written the contents.

This change removes the test.

```
running 1 test
=== stderr
Error: nu::parser::missing_positional (https://docs.rs/nu-parser/0.60.0/nu-parser/enum.ParseError.html#variant.MissingPositional)

  × Missing required positional argument.
   ╭─[source:1:1]
 1 │ open save_test_1/cargo_sample.toml | save
   ·                                          ▲
   ·                                          ╰── missing filename
   ╰────
  help: Usage: save {flags} <filename>

test commands::save::figures_out_intelligently_where_to_write_out_with_metadata ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 515 filtered out; finished in 0.10s
```
2022-03-27 15:39:27 +13:00
Andrew Barnes
a64e0956cd
Support binary data to stdin of run-external (#4984)
* Add test for passing binary data through externals

This change adds an ignored test to confirm that binary data is passed
correctly between externals to be enabled in a later commit along with
the fix.

To assist in platform agnostic testing of binary data a couple of
additional testbins were added to allow testing on `Value::Binary` inside
`ExternalStream`.

* Support binary data to stdin of run-external

Prior to this change, any pipeline producing binary data (not detected
as string) then feed into an external would be ignored due to
run-external only supporting `Value::String` on stdin.

This change adds binary stdin support for externals allowing something
like this for example:

  〉^cat /dev/urandom | ^head -c 1MiB | ^pv -b | ignore
  1.00MiB

This would previously output `0.00 B [0.00 B/s]` due to the data not
being pushed to stdin at each stage.
2022-03-27 15:35:59 +13:00
Andrew Barnes
91e17d2f9f
Limit mem usage + back-pressure via bounded channels (#4986)
Prior to this change, a pipeline of externals would result in high memory
usage if any of the producers in the chain, produced data faster than
the consumers.

For example a pipeline:

  > fast-producer | slow-consumer

Would cause a build up of `Value::{String,Binary}`'s in the mpsc channels
between each command as values are added to the channels faster than they
are consumed, eventually OOM'ing depnding on system resources, the volume
of data and speed diff. between fast v's slow.

This change replaces the unbounded channels with bounded channels
to limit the number of values that can build up and providing
back-pressure to limit ram usage.
2022-03-27 15:34:34 +13:00
Darren Schroeder
56a546e73d
fix ls when file is a socket on mac (#4983) 2022-03-26 21:26:39 -05:00
Jakub Žádník
3484e0defd
Add parser keyword note to help and $nu.scope (#4978) 2022-03-26 21:22:45 +02:00
Jakub Žádník
79e4d35f01
Remove is_private from $nu.scope.commands (#4979) 2022-03-26 21:22:35 +02:00
Scott Boggs
71dd857926
Termux/Android target support for v0.60.0 (#4956)
* Add android as target os for procfs-based ps

* Turn off code for dealing with trash on platforms which are known to not support a standard trash protocol

* Update lib.rs

* Update lib.rs

Co-authored-by: JT <547158+jntrnr@users.noreply.github.com>
2022-03-27 07:21:19 +13:00
JT
19fa41b114
Fix single quote environment values (#4960)
* Fix single quote external values

* Try to fix windows

* fix test

* fix test
2022-03-26 09:14:48 +13:00
JT
91cd1717e9
Add escapes to 'to nuon' (#4964) 2022-03-26 08:35:37 +13:00
JT
12b85beecc
Fix path join on streams (#4959) 2022-03-26 07:46:48 +13:00
JT
4e9c1067fb
Fix 4946 (#4951)
* Fix reject

* test

* clippy
2022-03-25 20:48:01 +13:00
JT
d122827a30
Fix operator precedence parser (#4947) 2022-03-25 16:23:08 +13:00
Justin Ma
b007290a4e
Fix #4942, and add a table sorting example for sort-by command (#4948)
* Fix #4942, and add a table sorting example for `sort-by` command

* ci skip
2022-03-25 16:22:57 +13:00
Michael Angerman
9b5dff828d
bump csv crate to the latest 1.1.6 (#4939) 2022-03-24 12:59:27 -05:00
Jonathan Moore
ea7c8c237e
CantConvert improvements (#4926)
* CantConvert improvements

* cargo fmt
2022-03-24 07:04:31 -05:00
JT
5d5b02d8dc
Don't assume external ls (#4925) 2022-03-24 16:42:41 +13:00
Vishal Sodani
00b67d338d
added missing metadata for drop and uniq #4763 (#4908)
* added missing metadata for drop and uniq #4763

* added missing metadata for keep #4763

* added missing metadata for append #4763

* added missing metadata for shuffle #4763
2022-03-24 07:27:01 +13:00
Darren Schroeder
d32e878868
rename export def to export alias (#4912)
copy-n-paste error
2022-03-23 07:53:10 -05:00
Justin Ma
e9f9aab79f
chore: Update default register examples (#4904) 2022-03-23 20:41:58 +13:00
LebsterFace
e826540037
Pass /D flag to cmd.exe to disable AutoRun (#4903)
* Pass `/D` flag to `cmd.exe` to disable AutoRun

* Pass `/D` flag before `/c`

This avoids running the command '/D <&self.name.item>' in cmd
2022-03-23 19:05:06 +13:00
JT
ec5fd62f9f
Add licenses (#4893)
* Add licenses

* Add licenses
2022-03-23 09:25:38 +13:00
JT
1c964cdfe7
Bump to 0.60 (#4892)
* WIP

* semi-revert metadata change
2022-03-23 07:32:03 +13:00
JT
66e736dab4
Externals shouldn't expand aliases (#4889) 2022-03-22 11:57:48 +13:00
Darren Schroeder
18067138aa
created an alternate way to determine line count (#4887) 2022-03-21 11:56:14 -05:00
Darren Schroeder
bd7a506897
update size command to be more accurate (#4885) 2022-03-20 17:09:30 -05:00
JT
e6a5011fdb
Allow 'error make' to make simple errors (#4881)
* Allow 'error make' to make simple errors

* Add example
2022-03-20 16:25:45 +13:00
JT
bd5778fa24
remove the boolean vars (#4879) 2022-03-20 08:12:10 +13:00
JT
f3bb1d11d3
Add export alias and export extern (#4878)
* export alias

* export extern
2022-03-20 07:58:01 +13:00
Fernando Herrera
d6669d3f33
Polars update (#4875)
* update to polars 0.20

* add to date parser for series
2022-03-19 11:13:34 +00:00
JT
b293282e9b
Add insert/update to lists (#4873) 2022-03-19 10:12:54 +13:00
JT
983d115bc0
Add an alias denylist for expansions (#4871) 2022-03-19 08:03:57 +13:00
Darren Schroeder
5a1af4d661
fixed a couple more tests (#4870) 2022-03-18 12:35:28 -05:00
Darren Schroeder
4f05e9f4a6
add a display of what the colors look like in ansi --list (#4866)
* add a display of what the colors look like in `ansi --list`

* change 'color' to 'preview' - add the ability to turn it off via config with use_ansi_coloring
2022-03-18 06:27:33 -05:00
JT
d0cbb2d12c
Allow expanding aliases before keywords, improve hiding (#4858)
* Allow aliasing source

* Add test

* improve hiding

* Finish adding tests

* fix test
2022-03-18 11:35:50 +13:00
JT
0986eefb64
Add insert and update back (#4864) 2022-03-18 06:55:02 +13:00
Darren Schroeder
6700fbeed7
rename update to upsert to mirror what it really does (#4859)
* rename `update` to `upsert` to mirror what it really does

* change to latest reedline and nu-ansi-term
2022-03-16 19:13:34 -05:00
Darren Schroeder
ca12f39db3
added nu-utils crate, fixed issue where externals turn off vt processing (#4857)
* added `nu-utils` crate, fixed issue where externals turn off vt processing

* hopefully make work in non-windows environments

* clippy
2022-03-16 17:21:06 -05:00
Reilly Wood
cb5d997adf
Change update help+examples for creating new columns (#4849)
* Change update help/examples for creating new column

* Enable example tests for update command
2022-03-14 15:32:33 -05:00
Justin Ma
10d805c1fa
feat: fix and update some examples (#4844) 2022-03-14 07:41:09 -05:00
JT
54d9fff4f2
Revert "Alias to keywords (eg source) (#4835)" (#4841)
This reverts commit c023d4111a.
2022-03-13 13:38:16 -07:00
Jakub Žádník
72daf8c64e
Fix reporting of which and $nu.scope (#4836)
* Refactor & fix which

Instead of fetching all definitions / aliases, only show the one that is
visible.

* Fix $nu.scope to show only visible definitions

* Add missing tests file; Rename one which test
2022-03-13 21:32:46 +02:00
JT
c023d4111a
Alias to keywords (eg source) (#4835)
* Allow aliasing source

* Add test
2022-03-13 11:30:37 -07:00
JT
ff3dffd813
Nu glob (#4818)
* Fork glob. Normalise license holder

* Fix more licenses

* unwraps

* bad doc test
2022-03-13 11:30:27 -07:00
Fernando Herrera
30bb090cd4
str to datetime dfr (#4833)
* str to datetime dfr

* change description
2022-03-13 13:53:13 +00:00
Andrew Barnes
dfffd45bcd
Streaming support for lines with raw streams (#4832) 2022-03-13 04:52:55 -07:00
Darren Schroeder
ccc85a2979
remove $nu.cwd (#4824) 2022-03-12 09:11:19 -06:00
Fernando Herrera
005301647a
equal comparisson series string (#4823) 2022-03-12 13:15:30 +00:00
Jakub Žádník
90b2ec537f
Do not pass non-string env vars to externals (#4748)
* Do not pass non-string env vars to externals

Also misc cleanup

* Add note to default config

* Add a test

* Ensure PATH/Path conversion list <-> string
2022-03-12 00:18:39 +02:00
Justin Ma
f3626f7c3a
Update docs for open and decode command, regenerate all docs (#4815)
* Update docs for open and decode command, regenerate all docs

* Update open.rs

* Update open.md

Co-authored-by: JT <547158+jntrnr@users.noreply.github.com>
2022-03-11 05:39:54 -05:00
Justin Ma
ce690ed18f
Bump sysinfo version from v0.22.2 to v0.23.5, close #3909 (#4810) 2022-03-10 11:38:32 -05:00
Justin Ma
643cce8a6f
Mark match as deprecated command (#4802) 2022-03-09 20:58:42 -06:00
JT
be43b3c5fc
Allow passing block literals to do (#4798) 2022-03-09 09:56:19 -05:00
JT
355b1d9929
Simplify empty?, improve default (#4797)
* Simplify empty?, improve default

* improve test
2022-03-09 08:46:28 -05:00
Justin Ma
0d82d7df60
Update documents for commands (#4796)
* Update documents of commands

* Change plugin names for register command examples

* Remove unused docs [ci skip]
2022-03-09 08:05:35 -05:00
JT
e0fac7bc72
Change select to match 0.44 (#4792) 2022-03-09 07:05:55 -05:00
JT
fac086c826
Make reduce -n more sensible (#4791) 2022-03-09 05:56:08 -05:00
JT
2ac990655e
Add support for var decl spans (#4787) 2022-03-09 04:42:19 -05:00
Darren Schroeder
b73af3b8df
add ability to check if value does not contain something (#4783) 2022-03-08 09:10:01 -06:00
JT
dc0c5a9772
Revert "Make if blocks work like a def-env (#4656)" (#4782)
This reverts commit 477f3be8df.
2022-03-08 08:29:12 -05:00
JT
477f3be8df
Make if blocks work like a def-env (#4656)
* Make `if` work like a def-env

* Add some tests

* Add an example
2022-03-08 07:45:47 -05:00
JT
299fea8538
Fix external extra (#4777)
* Fix empty table from externals

* Fix empty table from externals
2022-03-07 20:17:33 -05:00
Genna Wingert
0a95bc7e60
Add serialization for JSON and form bodies in post (#4764)
* Add serialization for JSON and form bodies in `post`

* Reuse code from `to json` instead of duplicating

* Fix formatting. Oops
2022-03-07 10:49:45 -06:00
JT
0b6b321ad6
More nuon tests, fix table print (#4762) 2022-03-07 08:39:02 -05:00
JT
4f43d75130
Simplify group/window into their own commands (#4760) 2022-03-06 20:01:29 -05:00
Michael Angerman
fbbbde1489
Update the Readme for the dataframe directory (#4757)
* update dataframe readme

* update df readme
2022-03-06 11:05:55 -08:00
Fernando Herrera
7701c6b1d4
added real index column to history (#4756) 2022-03-06 17:22:18 +00:00
Darren Schroeder
5ae5ef5146
enable to-nu to include the whole dfr if rows is not specified (#4753) 2022-03-06 09:04:41 -06:00
Genna Wingert
4aa9a18c63
Allow save to accept a list of strings (#4743) 2022-03-05 15:56:04 -06:00
Genna Wingert
1527b34d9c
Add back --append flag to save command (#4744) 2022-03-05 13:36:58 -06:00
Darren Schroeder
5b3cc73ac6
remove the hard coded escaping from split row and split column (#4731) 2022-03-04 15:09:35 -06:00
Justin Ma
1157fcf372
fix typo, update some examples and regenerate docs (#4718) 2022-03-04 06:10:09 -06:00
Daniel Reilly
52f4c4ba7e
Adds tab indentation option for JSON files. (#4705) 2022-03-03 13:15:13 -05:00
JT
7d0531d270
Add support for escape characters, make nuon a JSON superset (#4706)
* WIP

* Finish adding escape support in strings

* Try to fix windows
2022-03-03 13:14:03 -05:00
Yutaro Ohno
210d25f2a0
Add into duration (#4683)
* Add `into duration` command

* Avoid using unwrap()

* Use existing logic to parse duration strings
2022-03-03 08:16:04 -05:00
Jakub Žádník
d90b7953dd
Use Nushell's PATH in which (#4690)
* Make which use our path instead of std::env

* Unignore which test

* Fix wrong fn signature without which feature
2022-03-03 10:38:31 +02:00
JT
96a1bf5f8d
Experiment: Allow both $true/true and $false/false (#4696)
* Change true/false to keywords

* oops, clippy

* Both kinds of bools

* Add in some boolean variables

* disable py virtualenv test for now
2022-03-02 19:55:03 -05:00
JT
fd88920a9d
Make sure we have text before json parse (#4697) 2022-03-02 15:58:56 -05:00
JT
4965f4cbf4
Bump to 0.59.1 (#4689) 2022-03-01 16:55:51 -05:00
Justin Ma
42f1874a3a
Update some examples and docs (#4682)
* Update some examples and docs

* Update now.rs

* Update date_now.md

Co-authored-by: JT <547158+jntrnr@users.noreply.github.com>
2022-03-01 08:05:29 -05:00
JT
2a89936bee
Move to latest stable crossterm, with fix (#4684) 2022-03-01 07:05:46 -05:00
Fernando Herrera
ece5e7dbb7
dataframe list command (#4681) 2022-03-01 06:41:13 -05:00
JT
a6a96b29cb
Add binary literals (#4680) 2022-02-28 18:31:53 -05:00
JT
cb5c61d217
Fix open ended ranges (#4677)
* Make open ended ranges more open ended

* Add test
2022-02-28 11:15:31 -05:00
Justin Ma
b09acdb7f9
Fix unsupported type message for some math related commands (#4672)
* Fix unsupported type message of some math related commands

* changing the error form for UnsupportedInput

* cargo fmt
2022-02-28 10:14:33 -05:00
JT
10364c4f22
don't use table compaction in to nuon if not a table (#4671)
* don't use table compaction in to nuon if not a table

* Make a proper nuon conversion test

* more nuon tests
2022-02-28 07:10:02 -05:00
Jonathan Moore
ef70c8dbe4
Date parse refactor (#4661)
* More flexible and DRY datetime parsing

* Update error messages

* cargo fmt

* clippy

* Add DatetimeParseError
2022-02-27 20:21:46 -05:00
Darren Schroeder
796d4920ab
add char separators (#4667)
* add char separators

* sir clipster

* unclippy
2022-02-27 16:03:21 -06:00
Fernando Herrera
4ebbe07d27
Polars upgrade (#4665)
* polars upgrade

* Update describe.rs

Co-authored-by: JT <547158+jntrnr@users.noreply.github.com>
2022-02-27 11:10:29 -05:00
Fernando Herrera
995757c055
flags for find (#4663) 2022-02-27 06:17:13 -05:00
Stefan Holderbach
799fa98411
Update reedline, revert crossterm (#4657)
At the moment `crossterm` apparently has a regression decoding certain important key combinations on Windows.
Thus reedline reverted to the previous version.

Some changes are necessary to remove the need for `crossterm` in the use of `lscolors`.
Introduces two local conversion traits.

Additionally update the `Highlighter` API to support the cursor
position.
This will enable brace/statement match highlighting.
2022-02-26 11:23:05 -06:00
Fernando Herrera
11bc056576
Find with regex flag (#4649)
* split find functions

* find command with regex

* corrected message

* cargo fmt
2022-02-26 04:19:19 -05:00
Jae-Heon Ji
ed46f0ea17
fix: add missing metadata for ls_colors (#4603)
* feat: add metadata to roll

* chore: apply clippy

* fix: apply clippy

* fix: revert clippy
2022-02-25 17:31:02 -05:00
JT
0c3ea636fb
Add support for stderr and exit code (#4647) 2022-02-25 14:51:31 -05:00
JT
977ef66356
Fix Windows doc comments (#4643)
* WIP windows doc comments

* WIP windows doc comments

* WIP windows doc comments

* actual fix this time
2022-02-25 13:03:39 -05:00
Justin Ma
e6570b41ca
Fix some examples and regenerate docs, should fix: #4455 (#4639) 2022-02-25 08:14:15 -05:00
JT
e8a6458f0d
finish up with examples (#4637) 2022-02-25 05:19:25 -05:00
JT
70009c015d
Use metadata with lists (#4635)
* Windows external exceptions

* Also use metadata with lists
2022-02-25 04:27:50 -05:00
JT
3c62d27c28
Try again with math-like externals (#4629)
* Try again with math-like externals

* clippy 1.59

* clippy 1.59

* clippy 1.59
2022-02-24 14:02:28 -05:00
JT
308ab91aff
Speed up the parser and nuon parser a bit more (#4626) 2022-02-24 07:58:53 -05:00
Justin Ma
c3979ef1cf
Add example for command n,g,p and grid, update date now examples (#4622) 2022-02-24 06:17:05 -06:00
Michael Angerman
feb4f5c347
replace ValueStream with ListStream (#4621) 2022-02-24 06:57:31 -05:00
Fernando Herrera
21c0f7d738
allow int and float as strings for arguments (#4615)
* allow int and float as strings for arguments

* consume iterator
2022-02-24 05:09:02 +00:00
JT
4b18fdcc6e
Date literals (#4619)
* Date literals

* update deps

* Add date+duration
2022-02-23 21:02:48 -05:00
JT
676457acd3
Better ls paths (#4612)
* Fix ls paths... again

* Fix ls paths... again

* Always expand paths inside of glob_from

* Expand in ls before we check for directory info
2022-02-23 10:54:47 -05:00
Darren Schroeder
f507613b38
fixed some more tests (#4607) 2022-02-22 11:32:29 -05:00
Justin Ma
d054a724d1
Add example for enter, shells and view-source, update some docs (#4604) 2022-02-22 09:16:56 -06:00
Fernando Herrera
c2bad71123
remove repeated function (#4600)
* remove repeated function

* name in signature
2022-02-22 08:13:38 -05:00
JT
31925c3d40
Compact nuon tables (#4596) 2022-02-21 20:48:42 -05:00
JT
9888f8f298
Add pipeline redirection support (#4594)
* redirection

* Remove commented-out

* fix tests

* more fixes
2022-02-21 17:22:21 -05:00
JT
6d4784a7c1
Make 'each' implicitly filter out nothings (#4546)
* Make 'each' implicitly filter out nothings

* another example
2022-02-21 15:49:08 -05:00
JT
24fc9c657e
Add binary support to 'skip' (#4588)
* Add binary support to 'skip'

* add streaming
2022-02-21 13:23:43 -05:00
Justin Ma
53b5012f1e
feat: update: #4518, Add examples for command: use,module,export def,export env and export def-env (#4584) 2022-02-21 09:32:31 -06:00
Jae-Heon Ji
d1ec05b12b
fix: lose ls_colors in some filters commands (#4525)
* feat: add metadata to first

* feat: add metadata to last and skip

* feat: add metadata to reverse

* fix: apply clippy
2022-02-21 08:29:51 -06:00
JT
a2c4c92fce
Remove record iteration (#4582)
* Remove record iteration

* Remove test
2022-02-21 09:12:04 -05:00
Justin Ma
917886f8ad
feat: update: #4518, Add examples for command: hide, history, from yml, def-env, and table (#4581) 2022-02-21 07:52:50 -06:00
Joseph T. Lyons
4f367a59de
Strip trailing whitespace in files (#4575)
* Strip trailing whitespace in rs files

* Strip trailing whitespace in toml files

* Strip trailing whitespace in md files

* Strip trailing whitespace in nu files
2022-02-21 08:38:15 -05:00
Justin Ma
968427c4e9
feat: update: #4518, Add example for register,source,save,shuffle and from tsv (#4577) 2022-02-21 06:25:41 -06:00
JT
d454fad4dc
Improve json errors a bit (#4579)
* Improve json errors a bit

* typo
2022-02-21 07:08:09 -05:00
JT
a96f8b891e
more strict nuon handling, better nuon errors (#4576)
* more strict nuon handling, better nuon errors

* Improve errors a bit more
2022-02-20 22:31:50 -05:00
Joseph T. Lyons
5bf2ffeaf5
Add indent flag to to json (first draft) (#4571)
* Add indent flag to `to json` (first draft)

* Run cargo fmt

* Update examples / tests

* Change order of examples
2022-02-20 16:29:19 -06:00
JT
fd22211737
Add nuon format for fun (#4401)
* Add nuon format for fun

* more fun

* More nuon fixes, allow comments, improve errors
2022-02-20 16:26:41 -05:00
eggcaker
b92aaf0432
add custom header ability to post command (#4558) 2022-02-19 19:27:48 -06:00
Justin Ma
aea4355d04
refactor: change column names from 'Column*' to 'column*' (#4556) 2022-02-19 19:26:47 -05:00
Darren Schroeder
7163721571
a few more ansi escape sequences (#4553) 2022-02-19 16:47:52 -06:00
Joseph T. Lyons
efd62f917f
Reduce code duplication in to json command (#4551) 2022-02-19 14:46:20 -06:00
Justin Ma
ac99ac003a
Add example for cd,transpose,detect columns,split column and split row (#4549) 2022-02-19 09:24:48 -06:00
Justin Ma
3f14b75153
feat: add examples for length,lines,reject,benchmark and drop column (#4547) 2022-02-18 19:03:24 -06:00
JT
d53eaac7a1
Improve comparison errors (#4541) 2022-02-18 17:11:27 -05:00
Eli Flanagan
e5bf56a7dd
port post (#4537)
This restores a basic version of the `post` command.
Some source types have been omitted from this first take.
I copied from `fetch` and from `post`@0.40.0.
Part of #4356
2022-02-18 13:53:10 -05:00
JT
786e4ab971
Make 'for' implicitly filter out nothings (#4536)
* Make 'for' implicitly filter out nothings

* Fix test
2022-02-18 13:41:41 -05:00
Justin Ma
1235d516a5
Add examples for env,let-env,rm,touch and date list-timezone (#4531)
* feat: update #4518, add examples for env,let-env,rm,touch and date list-timezone

* fix typo

* update example for `date list-timezone` command
2022-02-18 18:19:37 +02:00
Justin Ma
dd11be03be
feat: update #4518, add command examples for def, do, cp, mv, mkdir and ls (#4528) 2022-02-18 08:30:16 -06:00
Justin Ma
a5f9ad2a43
Add or update examples for some commands (#4521)
* chore: add or update examples for some commands

* chore: code formatting
2022-02-18 07:06:52 -06:00
Darren Schroeder
1377693f0f
standardize char nf terms (#4520) 2022-02-18 05:52:48 -05:00
Jakub Žádník
bccce0ab46
Use overlay ID for module import lookup (#4514)
* Add id to import pattern

* Finish testing importing in a block
2022-02-17 20:58:24 -05:00
Darren Schroeder
d4cd3f9578
allow dfr open to open tsv files (#4516) 2022-02-17 14:15:17 -06:00
Genna Wingert
8f5b857fcf
Fix ignore to run side effects of previous command (#4510)
Co-authored-by: Genna Wingert <wingertge@gmail.com>
2022-02-17 12:49:54 -05:00
JT
fa75c93765
Slight cleanup of 'from json' line-at-a-time (#4512) 2022-02-17 12:49:31 -05:00
JT
393cb7ca6f
Treat ls for absolute paths as-is (#4513)
* Absolute paths in ls are treated as-in

* Better fix
2022-02-17 12:49:20 -05:00
JT
f5f9d56c37
Move to a standard kebab/snake style (#4509) 2022-02-17 09:55:17 -05:00
JT
6e733f49bc
Require block params (#4505)
* Require block params

* Improve errors
2022-02-17 06:40:24 -05:00
Darren Schroeder
b8b2737890
make find case insensitive (#4502) 2022-02-16 19:42:40 -06:00
JT
d620f76a21
Make comparisons/sort-by more 'global' (#4500)
* Make comparisons/sort-by more 'global'

* Let custom values do their own comparisons
2022-02-16 13:30:37 -06:00
Darren Schroeder
b64ac9eb7b
more test fixes (#4499)
* more test fixes

* update multi-os err messages
2022-02-16 12:24:45 -06:00
JT
5b6156687e
Use partial_cmp and make -i case insensitive (#4498)
* Use partial_cmp and make -i case insensitive

* Insensitive sort multiple columns
2022-02-16 11:12:49 -05:00
JT
c4e1559f89
Another batch of command tests (#4496)
* Add a batch of command tests

* More tests
2022-02-16 07:38:02 -05:00
JT
644435bfe3
Move and enable with-env test (#4489) 2022-02-16 04:59:44 -05:00
Michael Angerman
bd96ce4e9c
add more examples to the sys command (#4491) 2022-02-15 21:06:38 -08:00
Darren Schroeder
7e6430def0
a few more tests (#4488) 2022-02-15 20:48:32 -05:00
JT
df07e8e410
Fix view-source command (#4486) 2022-02-15 17:03:06 -05:00
Jonathan Moore
f824388f63
Date format list (#4485)
* Add `date format --list`, and make format string optional (providing default)

* Make DRY

`into datetime --list` now uses `generate_strfttime_list` from `date format --list`

* refactor strftime to use current datetime

* Fix formatting of specification descriptions

Fixes issues caused when copying directly from docs.rs

* Change default format to rfc2822

Perhaps to make it more DRY, functions from `into datetime` can be used. However, currently `into datetime` is a bit tricky to use as it needs a separate time zone argument.

* Tweak in-shell docs to match modified behavior

* Show %#z format specifier in `into datetime --list` only

* cargo fmt

* Satisfy clippy
2022-02-15 15:13:40 -06:00
Darren Schroeder
f11fa99d30
check to make sure we have data first (#4484) 2022-02-15 15:08:11 -06:00
JT
66669d7839
Fix more command tests (#4481) 2022-02-15 10:08:07 -05:00
JT
5c1a1be02b
Don't error on failed external expansion (#4480) 2022-02-15 08:47:25 -05:00
JT
9114a2d31d
Ensure that reduce has a valid span (#4479) 2022-02-15 07:59:51 -05:00
Michael Angerman
63a2c2bc2d
remove ignore for sort_by command test by_column which is now passing (#4465) 2022-02-13 20:46:12 -08:00
Michael Angerman
06f5affc0b
add in the Value List to the sort-by Ordering (#4464) 2022-02-13 10:20:50 -08:00
Michael Angerman
7a3aeaf080
sort_by: coerce_compare now returns an Ordering (#4461)
* coerce_compare now returns an Ordering which will enable mixed type comparison

* arbitrary nushell sort order of Float / Int / String / Bool
2022-02-13 09:23:54 -08:00
Justin Ma
a520599fa0
fix: fix with-env example with pipeline input (#4458) 2022-02-13 06:40:01 -06:00
Andrew Barnes
77eb4c4188
Fix default duplicates column (#4452)
* Add test to ensure default not adding dup. columns

* Fix for default adding duplicate columns
2022-02-13 05:38:46 -05:00
Michael Angerman
e82ffc4dee
sort_by error processing return ShellError instead of static String (#4453)
* sort_by error processing part I return ShellError instead of static Strings

* more explicit details on what types are failing

* clippy fixes
2022-02-12 21:30:57 -08:00
Darren Schroeder
6fc082f6e9
fix case insensitive sort (#4449)
* fix case insensitive search

* fixed test

* tweak
2022-02-12 20:48:50 -06:00
Justin Ma
560be6e73e
feat: mark str to-datetime as deprecated command (#4448) 2022-02-12 20:30:37 -06:00
Robert O'Shea
c5e7bccee5
Fixed printing of builtin kill command #4392 (#4447)
* Fixed printing of builtin kill command

* Fixed fmt and clippy issues for kill command

* Uncommented unintentional comments

* Fixed wrong code added in kill command

* Fixed more fmt issues with kill command
2022-02-12 20:18:27 -06:00
Jakub Žádník
94a0e3060a
Update CI (#4445)
* Add different features combinations

* Specify styles manually

* Fix args

* Fix typo

* Let other CI jobs finish if one fails

* Fix unused symbols without plugin feature

* Put "which" tests behind "which" feature

* Add Python virtualenv job

* Oops forgot git command

* Install Nushell in virtualenv tests

* Add names to steps; Test v.env in separate step

* cd into virtualenv

* Do not run on Python 2.7

* Build Nushell after formatting and clippy checks
2022-02-12 22:48:17 +02:00
Justin Ma
baf6348e66
feat: add unalias to deprecated command (#4440) 2022-02-12 17:06:52 +02:00
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
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
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
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
JT
90f6b6aedf
Simplify describe (#933) 2022-02-04 14:51:36 -05:00
Darren Schroeder
ece1e43238
fix into filesize tests and filesize (#932)
* fix into filesize tests and filesize

* tweaks

* added span back for like the 10th time

* Update filesize.rs

Co-authored-by: JT <547158+jntrnr@users.noreply.github.com>
2022-02-04 13:26:08 -06:00
Darren Schroeder
dd2d601471
fix lines tests (#930) 2022-02-04 11:34:01 -06:00
Darren Schroeder
c6dad0d5eb
fix find tests (#928) 2022-02-04 10:47:24 -06:00
Darren Schroeder
b86c6db400
fix cal tests (#925)
* fix 1 test

* missed 1 test
2022-02-04 07:24:36 -06:00
Fernando Herrera
1e86af2fb9
list keybinding options (#906)
* list keybinding optins

* list keybinding options

* clippy error
2022-02-04 06:47:18 +00:00
JT
a008f1aa80
Command tests (#922)
* WIP command tests

* Finish marking todo tests

* update

* update

* Windows cd test ignoring
2022-02-03 21:01:45 -05:00
Darren Schroeder
3d3298290a
add case-insensitive sorting (#919) 2022-02-03 15:18:18 -06:00
Darren Schroeder
e1c28cf06b
add --du to ls command (#917) 2022-02-03 13:58:32 -06:00
Darren Schroeder
2f0bbf5adb
du command (#916)
* wip on `du` command

* working
2022-02-03 11:35:06 -06:00
JT
cc1b784e3d
Add initial nu-test-support port (#913)
* Add initial nu-test-support port

* finish changing binary name

* Oops, these aren't Windows-safe tests
2022-02-02 15:59:01 -05:00
Darren Schroeder
cbdc0e2010
Windows ps update (#909)
* query command with json, web, xml

* query xml now working

* clippy

* comment out web tests

* Initial work on query web

For now we can query everything except tables

* Support for querying tables

Now we can query multiple tables just like before, now the only thing
missing is the test coverage

* Revert "Query plugin"

* augment `ps -l` on windows to display more info

Co-authored-by: Luccas Mateus de Medeiros Gomes <luccasmmg@gmail.com>
2022-02-01 15:05:26 -06:00
Darren Schroeder
c80a15cdfe
should be inclusive (#904)
* should be inclusive

* changed tests due to spans being different
2022-01-31 17:02:36 -06:00
JT
4c9df9c7c1
Add a fallback if Windows external spawn fails (#902)
* Add a fallback if Windows external spawn fails

* Remove path workaround

* More fixes

* More fixes

* Be more flexible with error tests
2022-01-31 12:42:12 -05:00
Ashish Thapa
b1aa8f4edf
Add strftime cheatsheet for into datetime (#869) (#883)
* Add strftime cheatsheet for `into datetime` (#869)

* proper table for strftime cheatsheet of `into datetime` (#883)
2022-01-31 07:32:35 -06:00
JT
d62716c83e
Use 'table' during internal->external (#898)
* Use 'table' during internal->external

* Preserve more of config
2022-01-31 07:52:05 -05:00
Andrés N. Robalino
def5869c1c
command(split-by) (#897) 2022-01-30 18:29:21 -05:00
Jakub Žádník
2fbd182993
Allow viewing the source code of blocks (#894)
* Add spans to blocks and view command

* Better description; Cleanup

* Rename "view" command to "view-source"
2022-01-31 00:05:25 +02:00
Julian Aichholz
67cb720f24
Port update cells command (#891)
* Port update cells command

Clean up, nicer match statements in UpdateCellsIterator

Return columns flag into HashSet errors

Add FIXME: for update cell behavior on nested lists

* Fix: process cells for Record when no columns are specified

* Fix: address clippy lints for unwrap and into_iter

* Fix: don't step into lists and don't bind $it var
2022-01-30 23:41:05 +02:00
JT
a51d45b99d
Ignore clippy's erroneous warnings (#895) 2022-01-30 16:12:41 -05:00
JT
060a4b3f48
Port detect columns (#892) 2022-01-30 07:52:24 -05:00
Michael Angerman
95a5e9229a
add help --find to help doc (#890) 2022-01-30 05:54:15 -05:00
Stefan Stanciulescu
3c8716873e
Port rotate (#880)
* Add rotate command

* Add rotate counter clockwise

* Fix comments in the code

* Fix clippy warnings

* Fix comment

* Fix wrong step for non even table sizes

* Fix comment for moving through array

* Refactor rotate and have only one command with a --ccw flag for counter-clockwise rotation. By default, rotate is clockwise

* Update usage description
2022-01-29 15:47:28 -05:00
JT
44821d9941
Add support for def-env and export def-env (#887) 2022-01-29 15:45:46 -05:00
Stefan Stanciulescu
1a25970645
Port rename (#877)
* Port rename

* Update description

* Fix fmt issues

* Refactor the code a bit and move things around
2022-01-29 05:26:47 -05:00
JT
e91d8655c6
Only trim prompt (#876)
* Only trim the output for prompts

* Only remove the last newline
2022-01-28 18:22:09 -05:00
JT
4c029d2545
Automatically trim ends of stdin/stdout strings (#874) 2022-01-28 16:59:00 -05:00
JT
86eeb4a5e7
Fix a bad slice into erroring utf-8 buffer (#872) 2022-01-28 15:32:46 -05:00
JT
020ad24b25
"maybe text codec" version 2 (#871)
* Add a RawStream that can be binary or string

* Finish up updating the into's
2022-01-28 13:32:33 -05:00
eggcaker
9926561dd7
Fix into datetime example parameter type (#862) 2022-01-28 00:06:07 +11:00
Michael Angerman
a4421434d9
add support for Floats for sort-by (#857) 2022-01-26 14:44:37 -08:00
Stefan Stanciulescu
e8b8836977
Add suport for Filesize and Date for sort-by command (#855) 2022-01-26 13:54:31 -08:00
JT
78b5da8255
Allow let/let-env to see custom command input (#854) 2022-01-27 06:00:25 +11:00
JT
8ee619954d
Start support for commandline args to nu itself (#851)
* cmdline args wip

* WIP

* redirect working

* Add help and examples

* Only show flags in signature of more than help
2022-01-27 01:42:39 +11:00
JT
cdc8e67d61
Remove unused repo parts (#4271)
* Remove unused repo parts

* Update README

* cargo fmt
2022-01-26 07:31:04 +11:00
JT
285f65ba34
Port exec command (#849)
* Port exec command

* fix windows

* lint
2022-01-26 04:27:35 +11:00
JT
3023af66fd
Port default command (#848) 2022-01-26 02:02:15 +11:00
JT
1ca3e03578
Fix expanding external args (#847) 2022-01-26 00:11:35 +11:00
Stefan Stanciulescu
f4c0538653
Flatten records. Not thoroughly tested though (#845) 2022-01-25 23:07:37 +11:00
eggcaker
5c749fcc63
allow fetch command to add custom headers (#840) 2022-01-25 13:19:29 +11:00
JT
988a873466
Allow open to read its filename from input (#841)
* Allow `open` to read its filename from input

* Add examples
2022-01-25 08:04:28 +11:00
Jakub Žádník
53f41c1985
Port move (#833)
* Remove comment

* Fix merge not retaining LS_COLORS

* Add move command

* Add checking for non-existent columns

* Add move command examples; Disallow flag shorthand
2022-01-24 21:43:38 +02:00
JT
62e9698b11
Allow external args to expand globs (#839)
* Allow external args to expand globs

* WIP

* A bit of cleanups and refactor to glob_from

* oops, add file
2022-01-25 05:26:56 +11:00
JT
3d0b1ef1ce
Highlight help tutor (#838)
* WIP

* Syntax highlight help, add tutor
2022-01-25 02:05:19 +11:00
Michael Angerman
8a1b2d0812
fix several cases where sort-by was crashing engine-q (#836) 2022-01-23 20:52:19 -08:00
Darren Schroeder
d4fb95a98c
allow find to respect ls_colors (#834) 2022-01-24 12:23:03 +11:00
Arthur Targaryen
f82e2fbac6
Port find command (#658)
* Add `Find` command

* Complete rustdoc for test `Value` constructors

* Use `Option::unwrap_or` instead of match

* Add `Value::test_filesize` constructor

* Handle searching for terms in `find`

* Fix `find` command signature

* Return multiple elements when `find`ing by predicate

* Do not accept rest parameter with predicate

* Handle `CellPath` in `r#in` and `not_in` for `Find`

* Use `PipelineData::filter`
2022-01-23 16:32:02 -06:00
Darren Schroeder
e11a030780
capture keyboard event (#832)
* capture keyboard event

* try a different strategy - still not working right

* fixed up
2022-01-23 16:09:39 -06:00
Stefan Stanciulescu
4e171203cc
Fix cd-ing into a file (#831)
* Add custom error for path not being a directory

* Fix cd issue with cd-ing into a file

* Keep formatting style as before

* Check if path is not a directory and return error if that's the case
2022-01-23 15:02:12 +02:00
Darren Schroeder
3d40e169ce
fix to retain ls_colors coloring from ls (#824)
fixes #823
2022-01-22 18:36:27 -05:00
JT
bf9340ec48
Only escape backslash on windows (#825) 2022-01-22 18:35:52 -05:00
Michael Angerman
89d852f76c
port sort_by without float (yet) (#814) 2022-01-22 12:49:50 -08:00
Darren Schroeder
6a446f708d
add hash base64 (#813) 2022-01-22 10:23:55 -06:00
Stefan Stanciulescu
afe83104c6
Fix flatten's dropping column issue #756 (#805)
* Fix flatten's dropping column issue, and do some cleanup - better variable naming.

* Fix failing test

* Fix failing tests
2022-01-23 01:19:40 +11:00
JT
b58aad5eb0
Make external app error uniform (#812) 2022-01-23 01:12:34 +11:00
Jakub Žádník
564c2dd7d1
Port merge command from Nushell (#808)
* Add example test to zip

* Port merge command from Nushell

On top of the original merge, this one should not collect a stream
returned from the merged block and allows merging records.
2022-01-22 01:50:26 +02:00
Eli Flanagan
e1272f3b73
lint: remove trailing whitespace (#806) 2022-01-22 10:29:10 +11:00
JT
6fa022b0a8 Add group-by and transpose (aka pivot) (#803) 2022-01-21 15:28:21 -05:00
Darren Schroeder
057bfff0cb
add term size command (#792)
* add `term-size` command

* Update term_size.rs

Co-authored-by: JT <547158+jntrnr@users.noreply.github.com>
2022-01-21 14:31:33 +11:00
JT
91883bd572
Better help search (#789) 2022-01-20 18:58:58 -05:00
JT
b4e61a056c
add cd - support (#787) 2022-01-21 07:51:44 +11:00
JT
33ffb2c39a
Add which command, add external completions, and builtin var completions (#782)
* Add which and external completions

* WIP

* Finish up external and var completions

* fix windows
2022-01-21 05:02:53 +11:00
Michael Angerman
d4b6b4b09a
update all cargo crates to edition 2021 (#781) 2022-01-21 00:13:45 +11:00
Fernando Herrera
6514a30b5d
general keybindings (#775)
* general keybindings

* get value function

* check error for keybinding

* cmd and send for keybingins

* better error message
2022-01-19 07:28:08 -06:00
JT
49e8af8ea5
Bump to 0.43 (#4264) 2022-01-18 12:06:12 -05:00
JT
d5d61d14b3
Tutor eq (#4263)
* Fix clippy lints

* Fix clippy lints

* Fix clippy lints

* Add e-q tutor page
2022-01-19 03:22:23 +11:00
JT
f562a4526c
Fix clippy lints (#4262)
* Fix clippy lints

* Fix clippy lints

* Fix clippy lints
2022-01-18 23:33:28 +11:00
Guillaume Gomez
e6c09f2dfc
Update sysinfo version (#4261) 2022-01-18 22:37:52 +11:00
Darren Schroeder
085a7c18cb
fix signature (#765) 2022-01-17 09:14:33 -06:00
JT
0f85646d8e
Let 'to toml' output block source (#763) 2022-01-17 19:25:12 +11:00
Darren Schroeder
c55b6c5ed5
fix list formatting (#762) 2022-01-16 16:40:40 -06:00
JT
283a615ecc
Enter now requires a directory (#761) 2022-01-17 03:14:34 +11:00
JT
9b128b7a03
Add rest to get, bump reedline (#760) 2022-01-17 02:40:11 +11:00
Jakub Žádník
bfe3c50dce
Fix empty entry in ls (#759) 2022-01-17 02:40:00 +11:00
Jakub Žádník
3b4baa31b6
Fix ls relative path & command argument path expansion (#757)
* Switch to short-names when the path is a relative_path (a dir) and exit with an error if the path does not exist

* Remove debugging print line

* Show relative filenames... It does not work yet for ls ../

* Try something else to fix relative paths... it works, but the ../ code part is not very pretty

* Add canonicalize check and remove code clones

* Fix the canonicalize_with issue pointed out by kubouch. Not sure the prefix_str is what kubouch suggested

* Fix the canonicalize_with issue pointed out by kubouch. Not sure the prefix_str is what kubouch suggested

* Add single-dot expansion to nu-path

* Move value path expansion from parser to eval

Fixes #745

* Remove single dot expansion from parser

It is not necessary since it will get expanded anyway in the eval.

* Fix ls to display globs with relative paths

* Use pathdiff crate to get relative paths for ls

Co-authored-by: Stefan Stanciulescu <contact@stefanstanciulescu.com>
2022-01-17 00:55:56 +11:00
nibon7
746641edae
Port seq command (#755)
Signed-off-by: nibon7 <nibon7@163.com>
2022-01-17 00:52:41 +11:00
JT
fa5aab8170
Add simple stdin input command (#754)
* Add simple stdin input command

* Add binary input

* Tweak binary view
2022-01-16 15:28:28 +11:00
JT
b78924c777
Add support for load-env (#752) 2022-01-15 18:50:11 -05:00
JT
75db4a75bc
Save (#750)
* Add support for save

* Add support for binary filetypes
2022-01-16 07:44:20 +11:00
JT
8f4ee14d85
Hide Windows ps status, bump reedline (#749) 2022-01-16 06:44:24 +11:00
Jakub Žádník
21a7278259
Revert "Fix ls relative path and erroring on fake dir (#697)" (#744)
This reverts commit bee5ba3deb.
2022-01-15 12:58:24 +02:00
Stefan Stanciulescu
bee5ba3deb
Fix ls relative path and erroring on fake dir (#697)
* Switch to short-names when the path is a relative_path (a dir) and exit with an error if the path does not exist

* Remove debugging print line

* Show relative filenames... It does not work yet for ls ../

* Try something else to fix relative paths... it works, but the ../ code part is not very pretty

* Add canonicalize check and remove code clones

* Fix the canonicalize_with issue pointed out by kubouch. Not sure the prefix_str is what kubouch suggested

* Fix the canonicalize_with issue pointed out by kubouch. Not sure the prefix_str is what kubouch suggested
2022-01-15 12:30:39 +02:00
Darren Schroeder
a7241f9899
add seq_date command (#743)
* add `seq_date` command

* fixed a reedline type-o

* copy-n-paste error
2022-01-14 16:07:28 -06:00
Jakub Žádník
40484966c3
Make env var eval order during "use" deterministic (#742)
* Make env var eval order during "use" deterministic

Fixes #726.

* Merge delta after getting config

To make sure env vars are all in the engine state and not in the stack.
2022-01-15 08:06:32 +11:00
JT
ca215c1152
Add nu-system and rewrite ps command (#734)
* Add nu-system and rewrite ps command

* Add more deps

* Add more deps

* clippy

* clippy

* clippy

* clippy

* clippy

* clippy
2022-01-14 17:20:53 +11:00
JT
bc1e1aa944
Clippy fixes for Rust 1.58 (#733)
* Clippy fixes for Rust 1.58

* Try different message
2022-01-14 06:40:25 +11:00
JT
82d90f4930
Add support for var/string interp for external names (#729) 2022-01-13 19:17:45 +11:00
JT
186da4d725
Fixing captures (#723)
* WIP fixing captures

* small fix

* WIP

* Rewrite to proof-of-concept better parse_def

* Add missing file

* Finish capture refactor

* Fix tests

* Add more tests
2022-01-12 15:06:56 +11:00
Michael Angerman
160339bd1f
add in a new select test that exercises a different match arm of the select command (#718) 2022-01-10 13:29:52 -08:00
Jakub Žádník
733b2836f1
Cleanup parsing of use and hide commands (#705) 2022-01-10 12:39:25 +11:00
Darren Schroeder
3a17b60862
new command fmt to format numbers (#707)
* new command `fmt` to format numbers

* remove comments
2022-01-09 19:19:41 -06:00
Darren Schroeder
b49885bb85
Revert "added a better default for ls_colors (#703)" (#711)
This reverts commit d63eac69e5.
2022-01-09 16:48:29 -06:00
Michel Alexandre Salim
476d543dee
Update descriptions for crates split out from nu-cli (#4247)
`nu-command` and `nu-data` were split out, but the descriptions still
say 'CLI'.

Signed-off-by: Michel Alexandre Salim <salimma@fedoraproject.org>
2022-01-09 06:05:50 -06:00
Darren Schroeder
d63eac69e5
added a better default for ls_colors (#703) 2022-01-08 08:30:48 -06:00
Darren Schroeder
38e0527083
add more chars (#701)
* add more chars

* group nerdfonts with nf- prefix

* labeled unicode weather symbols
2022-01-08 07:19:51 -06:00
Jakub Žádník
3b467bedd9
Add reduce command (#700)
* Add reduce command

* Fix example and missing test commands

* Add forgotten file
2022-01-08 02:40:40 +02:00
Jakub Žádník
eab6b322bb
Add CR, LF and CRLF to char command (#691) 2022-01-06 20:52:43 +02:00
Ștefan
47544ad219
Move fetch to extra and clean up some code (#664)
* Move fetch to extra

* Move byte stream code to a function instead of copying it twice

* Fix formatting issues

* Make fetch a default command

* Fix formatting
2022-01-06 10:06:16 +11:00
Jakub Žádník
d0c280f6cc
Fixes how environment is cloned inside tight loops (#678)
* Improve cd IO error

* Fix environment cloning in loops

* Remove debug print

* Fmt
2022-01-06 09:21:26 +11:00
JT
14cd798f00
Make ls more forgiving (#681) 2022-01-06 09:21:15 +11:00
JT
3c2a336ef9
Each much clone its env (#675) 2022-01-05 23:08:03 +11:00
JT
058738c48c
More shell fixes (#673) 2022-01-05 17:36:42 +11:00
JT
affb9696c7
Fix directory change lag (#672) 2022-01-05 16:50:27 +11:00
JT
c158d29577
Add shells support (#671) 2022-01-05 15:35:50 +11:00
JT
b4c72e85e1
Limit when we expand external args (#668) 2022-01-05 12:09:53 +11:00
JT
41dbc641cc
Some cleanups for cd/PWD (#667)
* Some cleanups for cd/PWD

* Some cleanups for cd/PWD
2022-01-05 11:26:01 +11:00
Jakub Žádník
74dcd91cc3
Use only $nu.env.PWD for getting the current directory (#587)
* Use only $nu.env.PWD for getting current directory

Because setting and reading to/from std::env changes the global state
shich is problematic if we call `cd` from multiple threads (e.g., in a
`par-each` block).

With this change, when engine-q starts, it will either inherit existing
PWD env var, or create a new one from `std::env::current_dir()`.
Otherwise, everything that needs the current directory will get it from
`$nu.env.PWD`. Each spawned external command will get its current
directory per-process which should be thread-safe.

One thing left to do is to patch nu-path for this as well since it uses
`std::env::current_dir()` in its expansions.

* Rename nu-path functions

*_with is not *_relative which should be more descriptive and frees
"with" for use in a followup commit.

* Clone stack every each iter; Fix some commands

Cloning the stack each iteration of `each` makes sure we're not reusing
PWD between iterations.

Some fixes in commands to make them use the new PWD.

* Post-rebase cleanup, fmt, clippy

* Change back _relative to _with in nu-path funcs

Didn't use the idea I had for the new "_with".

* Remove leftover current_dir from rebase

* Add cwd sync at merge_delta()

This makes sure the parser and completer always have up-to-date cwd.

* Always pass absolute path to glob in ls

* Do not allow PWD a relative path; Allow recovery

Makes it possible to recover PWD by proceeding with the REPL cycle.

* Clone stack in each also for byte/string stream

* (WIP) Start moving env variables to engine state

* (WIP) Move env vars to engine state (ugly)

Quick and dirty code.

* (WIP) Remove unused mut and args; Fmt

* (WIP) Fix dataframe tests

* (WIP) Fix missing args after rebase

* (WIP) Clone only env vars, not the whole stack

* (WIP) Add env var clone to `for` loop as well

* Minor edits

* Refactor merge_delta() to include stack merging.

Less error-prone than doing it manually.

* Clone env for each `update` command iteration

* Mark env var hidden only when found in eng. state

* Fix clippt warnings

* Add TODO about env var reading

* Do not clone empty environment in loops

* Remove extra cwd collection

* Split current_dir() into str and path; Fix autocd

* Make completions respect PWD env var
2022-01-05 09:30:34 +11:00
JT
8f6843c600
Move $nu.env to $env (#665)
* Move env from nu builtin to its own

* update samples/tests
2022-01-05 08:34:42 +11:00
JT
857ecda050
Let describe know about binary (#662) 2022-01-04 14:05:24 +11:00
JT
36079f1a3d
Port fetch (with fixes) (#660)
* Port fetch to engine-q

* Fix check for path as a string

* Add a timeout flag and fix some span issues

* Add a temporary fetch command that returns byte streams. Got rid of async stuff as we're using the blocking feature of tokio

* More tweaks for the bytestream

* Rewrite fetch using ByteStreams

* buffer read on bytes directly

Co-authored-by: Stefan Stanciulescu <contact@stefanstanciulescu.com>
2022-01-04 13:01:18 +11:00
JT
850f66aa9d
Fix build breakage - bump ansi term (#651)
* Fix build breakage - bump ansi term

* Remove e-q ansi term
2022-01-03 09:36:32 +11:00
JT
f7e3d4de24
Add fuzzy/ignore flag to get (#641) 2022-01-02 13:18:39 +11:00
Michael Angerman
5d58f68c59
port over from nushell the column flag for the length command (#617)
* port over from nushell the column flag for the length command

* fix clippy error

* refactor with the get_columns now centrally located
2022-01-01 15:27:20 +11:00
Michael Angerman
f734995170
move get_columns from the table_viewer to a central location (#628)
* get_columns is working in the columns command

* the new location of the get_columns method is nu-protocol/src/column.rs

* reference the new location of the get_columns method

* move get_columns to nu-engine
2021-12-31 17:39:58 -08:00
Darren Schroeder
18ddcdcb97
type-o in signature (#633) 2021-12-31 09:54:30 -06:00
Tom Panton
822309be8e
Port the every command (#626) 2021-12-31 10:41:18 +11:00
Justin
56ae07adb9
Ported ignore command to engine-q (#621)
* Ported `ignore` command to engine-q

* Format ignore command
2021-12-30 15:54:33 +11:00
Darren Schroeder
7faa4fbff4
revert file_types to lowercase (#623)
* revert file_types to lowercase

* fix test
2021-12-29 21:16:50 -06:00
JT
832a801c11
Preserve metatdata in where (#618) 2021-12-29 22:17:20 +11:00
JT
62011b6bcc
Bump to 0.42 (#4234) 2021-12-28 20:56:59 +11:00
Darren Schroeder
1837acfc70
add ability to specify an ansi style (#595)
* add ability to specify an ansi style

* remove comments

* remove more debug code

* some cleanup and refactoring
2021-12-27 08:59:55 -06:00
JT
3706bef0a1
Require let to be a statement (#594) 2021-12-27 14:04:22 +11:00
JT
de30236f38
Fix ls listing (#593) 2021-12-27 12:46:32 +11:00
JT
e1c92e90ca
Add line ending autodetect to 'lines' (#589) 2021-12-27 10:11:18 +11:00
Stefan Holderbach
39f03bf5e4
Decode escaped newlines in history command (#592)
Reedline currently encodes newlines as `<\n>`
2021-12-27 10:11:08 +11:00
JT
89a000a572
Fix some 'open' signature stuff (#583) 2021-12-26 09:13:43 +11:00
JT
a811eee6b8
Add support for 'open' (#573) 2021-12-25 06:24:55 +11:00
JT
1efae6876d
Wire hex viewing into a few more places (#572) 2021-12-25 05:15:01 +11:00
JT
3522bead97
Add string stream and binary stream, add text decoding (#570)
* WIP

* Add binary/string streams and text decoding

* Make string collection fallible

* Oops, forgot pretty hex

* Oops, forgot pretty hex

* clippy
2021-12-24 18:22:11 +11:00
JT
7f0921a14b
Add metadata command (#569)
* Add metadata command

* Add string interpolation to testing
2021-12-24 11:16:50 +11:00
JT
b719f8d4eb
Add missing flags to existing commands (#565)
* Add missing flags to existing commands

* fmt
2021-12-24 08:41:29 +11:00
Matthew Auld
c33104c4ae
Ported compact command to engine-q (#558)
* :Interm work porting compact to engine-q

* Port 'compact' command from nushell to engine-q

* Fixed example
2021-12-23 14:08:39 +11:00