Commit Graph

2512 Commits

Author SHA1 Message Date
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
Maxim Zhiburt
fd3eec81b5
Bump ansi-cut version to 0.2.0 (#822)
Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>
2022-01-22 18:36:40 -05: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
JT
310ecb79b6
Add flag completions (#817) 2022-01-22 16:18:31 -05:00
Michael Angerman
89d852f76c
port sort_by without float (yet) (#814) 2022-01-22 12:49:50 -08:00
JT
af52def93c
Fix doc comments for custom commands (#815) 2022-01-22 13:24:47 -05: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
0ef0277882
allow use to parse quoted paths (#800) 2022-01-21 13:20:13 -06:00
JT
939745ad67
Support recursive functions in capture (#797) 2022-01-21 11:39:55 -05:00
Fernando Herrera
846a048bba
menu-performance (#793) 2022-01-21 08:59:29 +00: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
Darren Schroeder
65ef7b630b
PATH for completions for each os (#784) 2022-01-20 13:46:52 -05:00
JT
45b3592739
add some more division for units (#783) 2022-01-21 05:23:26 +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
JT
be8c905ca7
Show error on bad config, but keep going (#778) 2022-01-20 03:42:12 +11:00
JT
d2d22815fb
Improve env shorthand parse (#777) 2022-01-20 01:58:12 +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
Fernando Herrera
ff9d88887b
simple event keybinding (#773) 2022-01-18 19:32:45 +00: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
Fernando Herrera
20eb348896
simple keybinding parsing (#768) 2022-01-18 08:48:28 +00:00
Darren Schroeder
2c75aabbfc
allow size and other to count bytes from binary with as_string() (#769) 2022-01-17 17:41:59 -06:00
Stefan Holderbach
01e691c5ba
Fix unicode word wrapping with ansi-cut (#767)
Ansi-cut expects ranges of character numbers (of the non-ansi control
sequence characters) instead of byte indices.
This fixes the panics when wrapping of non-unicode lines (which exceed
the demanded number of characters as byte indices).
Also rectifies some wrong wrapping of unicdoe containing lines that
don't panic
2022-01-17 15:31:21 -05: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
Onur Şahin
5fae96a6b1
Fix not equal returning error when same things are compared in some cases (#709)
* Fix not equal returning error when same things are compared in some cases

* Equality operators supports all type combinations
2022-01-17 01:34:20 +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
Fernando Herrera
89d99db94f
menu options (#748) 2022-01-15 17:01:44 +00:00
JT
f9c0d223c1
Improve keyword parsing, including for (#747)
* Improve keyword parsing, including for

* touchup
2022-01-16 02:26:52 +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
Darren Schroeder
d0f9943709
expose a few more types to custom commands (def) (#725) 2022-01-12 09:59:07 -06: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
Fernando Herrera
47495715a6
context menu with nucompleter (#722) 2022-01-11 21:53:42 +00:00
Darren Schroeder
ffb086d56f
a little better table alignment (#720) 2022-01-11 08:49:15 -06: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
JT
d3bfc61524
Don't panic on alias errors (#713) 2022-01-10 13:52:01 +11: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
f964ce9bc0
Add repository name and current tag to gstat (#692)
* Add repository name to gstat

* Fix getting repo name; Add tag as well
2022-01-07 05:44:05 -06:00
JT
f016a5cb72
Fix short flags with extra (#696) 2022-01-07 08:06:54 +11:00
JT
3478f35330
Default the values of named params (#695) 2022-01-07 07:32:47 +11:00
Jakub Žádník
eab6b322bb
Add CR, LF and CRLF to char command (#691) 2022-01-06 20:52:43 +02:00
Fernando Herrera
8a0d2b4e32
double prompt (#686)
* double prompt

* prompt env var name
2022-01-06 12:57:55 +00:00
JT
e44789556b
Fix path external (#684)
* Fix external invocation/expansion

* clippy
2022-01-06 21:20:31 +11:00
JT
d39e8c15fe
Expand external command names (#682) 2022-01-06 10:32:56 +11: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
cc1ae969fe
Allow int/float to coerce in type checker (#679) 2022-01-06 07:58:58 +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
Darren Schroeder
4584d69715
tweak source parsing to allow quotes around string (#666) 2022-01-05 10:44:48 +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
4d1ce6c27b
Use default prompt as fallback (#663) 2022-01-05 06:49:04 +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
b6fcd46075
Some error improvements (#659) 2022-01-04 10:14:33 +11:00
JT
cb8b7e08a5
Lex comment spans correctly (#657) 2022-01-04 08:37:45 +11:00
JT
fe5f65a247
Highlight block and record (#653) 2022-01-03 16:21:26 +11:00
JT
9535e2c309
Fix list and table print (#652)
* Fix list printing

* Fix list and table highlighting
2022-01-03 14:18:23 +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
354d51a3a6
Fix perf regression with stmts (#650) 2022-01-03 07:18:48 +11:00
JT
c9dcd212ba
Allow pipelines across multiple lines if end in pipe (#643)
* Allow pipelines across multiple lines if end in pipe

* Add validation support
2022-01-02 16:27:58 +11:00
JT
f7e3d4de24
Add fuzzy/ignore flag to get (#641) 2022-01-02 13:18:39 +11:00
Darren Schroeder
a56994ccc5
make prompt indicators configurable (#639)
* make prompt indicators configurable

* seems to be working now
2022-01-02 09:53:16 +11:00
JT
ac487dfcbc
Add parser tracing, fix 629 (#638) 2022-01-02 08:42:50 +11:00
JT
4383b372f5
Cleanup binary stream print a little (#637) 2022-01-01 21:42:15 +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
JT
15b979b06e
Bump reedline (#634) 2022-01-01 09:41:29 +11: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
JT
80649f2341
Fix flattening of in-variable (#624) 2021-12-30 14:26:40 +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
c8330523c8
Don't read config in a tight loop (#614) 2021-12-29 07:06:53 +11:00
JT
62011b6bcc
Bump to 0.42 (#4234) 2021-12-28 20:56:59 +11:00
JT
e94b8007c1
Allow update to also insert (#610) 2021-12-28 10:11:20 +11:00
JT
384ea111eb
Allow for and other commands missing positionals near keywords (#606)
* Allow for and other commands missing positionals near keywords

* A bit more resilience
2021-12-28 07:04:48 +11:00
Fernando Herrera
53330c5676
def argument check (#604)
* def argument check

* corrected test

* clippy error
2021-12-28 06:13:52 +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
1dbf351425
Handle external redirects better (#598)
* Handle external redirects better

* fix warnings
2021-12-27 08:58:53 -06:00
Michael Angerman
f50f37c853
fix issue #559: to json -r serializes datetime without spaces (#596)
* fix issue #559: to json -r serializes datetime without spaces

* add in a third test which checks spaces in both keys and values

* fix clippy error
2021-12-27 21:51:38 +11: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
e62e0fb679
Flush stmts (#584)
* Flush the stmt via table to the screen

* Fix test
2021-12-27 07:21:24 +11:00
JT
89a000a572
Fix some 'open' signature stuff (#583) 2021-12-26 09:13:43 +11:00
JT
ca6baf7a46
Add single tick string interpolation (#581)
* Add single tick string interpolation

* give string interpolation its own highlighting
2021-12-26 07:50:02 +11:00
JT
d603086d2f
Fix custom call scope leak, refactor tests (#580)
* Fix custom call scope leak, refactor tests

* Actually add tests
2021-12-26 06:39:42 +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
nibon7
1214cd57e8
bat: use regex-onig instead of regex-fancy (#4226)
Fixes #4224

Signed-off-by: nibon7 <nibon7@163.com>
2021-12-24 08:34:59 -06: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
Darren Schroeder
29c8b826d4
add configuration point for hint coloring (#564) 2021-12-23 15:02:57 -06:00
Darren Schroeder
ba1ff4cf6c
add configuration of maximum history size (#563) 2021-12-23 13:59:00 -06:00
Fernando Herrera
f3c175562d
vi mode (#561) 2021-12-23 09:31:16 +00: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
Michael Angerman
5d3b63fa90
add in a raw flag in the command to json (#555)
* add in the method to_string_raw

* add in a raw flag to json

* add in a test
2021-12-23 06:56:49 +11:00
nibon7
6cd124ddb2
allow insecure server connections when using SSL (#4219)
Fixes #4211

Signed-off-by: nibon7 <nibon7@163.com>
2021-12-23 06:48:43 +11:00
Jakub Žádník
061c822c5d
Add environment variables doc page (#554)
* Fix typos

* Add environment variables doc page

* Remove Breaking Changes page
2021-12-23 06:44:14 +11:00
JT
0c920f7d05
Add history command (#553) 2021-12-22 22:19:38 +11:00
Jakub Žádník
8ba3e3570c
Interpret lists as series of args for externals (#550)
* Interpret lists as series of args for externals

* Fix clippy warnings
2021-12-22 10:13:05 +02:00
Fernando Herrera
ea6912c3f7
missing commands (#549) 2021-12-22 10:35:02 +11:00
Jakub Žádník
deeb1da359
Allow having only one env conversion (#548)
Allows setting only `from_string` or `to_string` in `env_conversions`
config. Previously, both were required.
2021-12-22 00:32:38 +02:00
Jakub Žádník
52dba91e1a
Wrap captured env var names into quotes as well (#546) 2021-12-21 23:31:30 +02:00
JT
266fac910a
Signature improves, sorted completions (#545) 2021-12-22 07:50:18 +11:00
Fernando Herrera
3ad5d4af66
sort env vars (#544) 2021-12-22 07:27:19 +11:00
Ștefan
a93a9b9029
Add skip-empty flag to lines command (#543)
* Add skip-empty flag to lines command

* Fix failing length test
2021-12-22 07:24:11 +11:00
Fernando Herrera
6a35e6b7b6
Dataframe commands (#542)
* groupby object

* aggregate command

* eager commands

* rest of dataframe commands
2021-12-22 05:32:09 +11:00
JT
c3a16902fe
Fix list printing (#540) 2021-12-21 20:05:16 +11:00
JT
fc7ed1bfe4
switch substring to bytes (#538)
* switch substring to bytes

* Add a test
2021-12-21 11:49:02 +11:00
Braulio Valdivielso Martínez
d32aec5906
Don't panic if the other end of std{out,err} is closed (#4179)
* fix #4161

println! and friends will panic on BrokenPipe. The solution is to use
writeln! instead, and ignore the error (or do we want to do something else?)

* test that nu doesn't panic in case of BrokenPipe error

* fixup! test that nu doesn't panic in case of BrokenPipe error

* make do_not_panic_if_broken_pipe only run on UNIX systems
2021-12-21 10:08:41 +11:00
Jakub Žádník
1609101e62
Fix capturing environment variables with " or ' (#537)
* Fix path expand error span

* Fix capturing env vars containing ' or "; Rustfmt
2021-12-20 23:19:43 +02:00
JT
0571a6ee34
Merged heterogeneous tables (#536)
* Merged heterogeneous tables

* switch emoji
2021-12-21 08:03:47 +11:00
JT
152467a858
Flatten should flatten embedded table (#534) 2021-12-21 06:03:18 +11:00
JT
caf73c36f2
Finish adding support for optional params (#530) 2021-12-20 17:58:09 +11:00
Fernando Herrera
e949658381
nothing variable (#527)
* nothing variable

* corrected comments

* added color to nothing like bool

* compare nothing with values

* comparison tests
2021-12-20 12:05:33 +11:00
Jae-Heon Ji
ff5b7e5ad2
feat(into): add into-bool command (#499)
* feat(into): add example of into-bool

* feat(into): add convert from int and float

* feat(into): add converting string to bool

* feat(into): add converting value in table

* fix(into): update error

* fix(into): update span for example

* chore(into): update signature description

* float comparison using epsilon

* Update bool.rs

Co-authored-by: JT <547158+jntrnr@users.noreply.github.com>
2021-12-20 07:11:28 +11:00
JT
cf5048205f
Allow empty span slice for now (#529) 2021-12-20 06:25:02 +11:00
Ștefan
c37bdcd119
port empty command (#528)
* port empty command

* Pull upstream and use test_data() function for example tests
2021-12-20 06:11:57 +11:00
Fernando Herrera
038ad951da
name change (#526) 2021-12-19 10:00:31 +00:00
JT
2883d6cd1e
Remove Span::unknown (#525) 2021-12-19 18:46:13 +11:00
JT
b54e9b6bfd
Fix completion crash (#521) 2021-12-19 07:10:40 +11:00
Fernando Herrera
ebf57c70e0
Plugin signature (#520)
* calling plugin without shell

* spelling error

* option on register to select a shell

* help in plugin example signature
2021-12-18 19:25:17 +00:00
Michael Angerman
00bb203756
add in a new command called columns (#519) 2021-12-18 12:14:28 -06:00
Fernando Herrera
8933dde324
Plugin option for shell (#517)
* calling plugin without shell

* spelling error

* option on register to select a shell
2021-12-18 12:13:56 -06:00
Darren Schroeder
b3b328d19d
add lp and rp (#518) 2021-12-18 12:13:10 -06:00
Fernando Herrera
46b86f3541
Migration of series commands (#515)
* corrected missing shellerror type

* batch dataframe commands

* removed option to find declaration with input

* ordered dataframe folders

* dataframe command name
* series commands

* date commands

* series commands

* series commands

* clippy correction

* rename commands
2021-12-18 17:45:09 +00:00
Fernando Herrera
d8847f1082
Calling plugin without shell (#516)
* calling plugin without shell

* spelling error
2021-12-18 09:52:27 -06:00
Ștefan
6f6340186a
Port flatten (#512)
* A first working version of flatten. Needs a lot of cleanup. Committing to have a working version

* Typo fix

* Flatten tests pass

* Final cleanup, ready for push

* Final cleanup, ready for push

* Final cleanup, ready for push

* Final cleanup, ready for push

* Update flatten.rs

Co-authored-by: JT <547158+jntrnr@users.noreply.github.com>
2021-12-18 07:44:51 +11:00
Matthew Auld
6ba1e6172c
Port 'ansi strip' command from nushell to engine-q (#511)
* Port 'ansi strip' command from nushell to engine-q

* added example
2021-12-18 07:32:03 +11:00
Matthew Auld
438c2df8b6
Porting 'ansi gradient' command from nushell to engine-q (#509)
* Porting  'ansi gradient' command from nushell to engine-q

* passed correct span variable
2021-12-18 04:40:47 +11:00
Jakub Žádník
6a0f404558
Treating environment variables as Values (#497)
* Proof of concept treating env vars as Values

* Refactor env var collection and method name

* Remove unnecessary pub

* Move env translations into a new file

* Fix LS_COLORS to support any Value

* Fix spans during env var translation

* Add span to env var in cd

* Improve error diagnostics

* Fix non-string env vars failing string conversion

* Make PROMPT_COMMAND a Block instead of String

* Record host env vars to a fake file

This will give spans to env vars that would otherwise be without one.
Makes errors less confusing.

* Add 'env' command to list env vars

It will list also their values translated to strings

* Sort env command by name; Add env var type

* Remove obsolete test
2021-12-17 12:04:54 +11:00
Arthur Targaryen
342584e5f8
Port keep, keep while and keep until commands (#384)
* Add `KeepUntil` sub-command

* Add `KeepWhile` sub-command

* Add `Keep` command

* Fix error type
2021-12-17 11:57:02 +11:00
Matthew Auld
a148ad8697
added a 'list' option to the ansi command (#504) 2021-12-16 12:36:07 -06:00
Darren Schroeder
9a864b5017
allow flatshape (command line syntax) theming (#502)
* allow flatshape (command line syntax) theming

* renamed crate, organized
2021-12-16 06:17:29 -06:00
JT
17a7a85c78
Bump some deps (#503) 2021-12-16 20:40:05 +11:00
Matthew Auld
89e2169521
Porting 'char' command from nushell to engine-q (#500)
* Port 'char' command from nushell to engine-q

* fixed unit tests

* Actually fixed unit tests
2021-12-16 10:08:12 +11:00
Matthew Auld
e289630920
Porting 'ansi' command from nushell to engine-q (#494)
* Porting 'ansi' command from nushell to engine-q

* Added StrCollect to example_test.rs to allow example tests to run

* Run 'cargo fmt' to fix formatting

* Update command.rs

* Update command.rs

* Update command.rs

* Added a category

Co-authored-by: JT <547158+jntrnr@users.noreply.github.com>
2021-12-16 10:06:35 +11:00
JT
1d74d9c5ae
Fix comment issue and shadowing issue (#501) 2021-12-16 09:56:12 +11:00
Michael Angerman
0450cc25e0
port over from nushell drop nth (#498) 2021-12-15 06:26:15 -06:00
JT
e9525627e6
Fix a couple crlf issues (#496) 2021-12-15 07:17:02 +11:00
Michael Angerman
1cbb785969
port over from nushell drop column (#495)
* port over from nushell drop column

* fix clippy
2021-12-15 06:54:27 +11:00
Benoît Cortier
a41ae72bc1
Fix error propagration across hash commands (#493) 2021-12-15 06:49:48 +11:00
Darren Schroeder
a5c1dd0da5
allow fg, bg, attributes to be set for all colors in color_config (#489)
* allow fg, bg, attributes to be set for all colors in color_config

* no need for comma between each key value
2021-12-14 13:34:39 -06:00
Eli Flanagan
e919f9a73b
use heck for string casing (#4081)
I removed the Inflector dependency in favor of heck for two reasons:
- to close #3674.
- heck seems simpler and actively maintained

We could probably alter the structure of the `str_` module to expose the
individual casing behaviors better.
I did not feel as confident on changing those signatures.

So I took a lazier approach of a macro in the `mod.rs` that creates the public
shimming function to heck's traits.
2021-12-14 09:43:48 -06:00
JT
04a9c8f3fd
Fix bug in chained boolean typecheck (#490) 2021-12-14 16:19:16 +11:00
Jakub Žádník
930cb26e99
Fix hiding of import patterns with globs (#487)
* Fix glob hiding

* Remove docs comment
2021-12-13 20:35:35 +02:00
Darren Schroeder
3701fd1d76
allow user to use hex colors in config (#486) 2021-12-13 09:02:54 -06:00
JT
906c0e6bca
Better filepath completions (#485) 2021-12-13 17:46:30 +11:00
JT
1336acd34a
Seems ps still needs a delay to be accurate (#484) 2021-12-13 16:28:35 +11:00
JT
2013e9300a
Make config default if broken (#482)
* Make config default if broken

* Make config default if broken
2021-12-13 14:16:51 +11:00
Hilmar Gústafsson
90ddb23492
Add Path commands (#280)
* Add Path command

* Add `path basename`

* Refactor operate into `mod`

* Add `path dirname`

* Add `path exists`

* Add `path expand`

* Remove Arc wrapper for args

* Add `path type`

* Add `path relative`

* Add `path parse`

* Add `path split`

* Add `path join`

* Fix errors after rebase

* Convert to Path in `operate`

* Fix table behavior in `path join`

* Use conditional import in `path parse`

* Fix missing cases for `path join`

* Update default_context.rs

* clippy

* Fix tests

* Fix tests

Co-authored-by: JT <547158+jntrnr@users.noreply.github.com>
Co-authored-by: JT <jonathan.d.turner@gmail.com>
2021-12-13 12:47:14 +11:00
JT
bee7ef21eb
Add in variable and sub-command completions (#480)
* WIP

* wip

* Add in variable and subcommand completions

* clippy
2021-12-13 10:18:31 +11:00
JT
d1d1402512
Add in auto-cd if you pass just a directory (#479)
* Add in auto-cd if you pass just a directory

* clippy
2021-12-13 08:41:34 +11:00
Jae-Heon Ji
6f53912655
Fix: add missing bind commands (#477)
* chore(random): update naming convention

* fix: add missing bind commands
2021-12-12 21:42:04 +02:00
Fernando Herrera
34a8a897c5
Plugin json (#475)
* json encoder

* thread to pass messages

* description for example

* check for help flag
2021-12-12 14:00:07 +00:00
Fernando Herrera
4d7dd23779
Plugin json (#474)
* json encoder

* thread to pass messages

* description for example
2021-12-12 11:50:35 +00:00
Darren Schroeder
f8e6620e48
tweak version output as a list vs table (#472) 2021-12-11 14:40:16 -06:00
Ștefan
7cbeebaac1
Port version (#467)
* First iteration of the version command

* Cleanup

* Fix the installed plugins bug

* Fix fmt check issue

* Fix clippy warning

* Fixing all clippy warnings

* Remove old code
2021-12-11 14:08:17 -06:00
Darren Schroeder
9d7685e565
add temp-path to $nu (#471) 2021-12-11 14:00:29 -06:00
Darren Schroeder
c2aa6c708d
add cwd to $nu (#469)
* add `cwd` to `$nu`

* oops
2021-12-11 13:38:36 -06:00
Darren Schroeder
626b1b99cd
add keybinding-path to $nu (#470) 2021-12-11 13:29:56 -06:00
Darren Schroeder
4103abc685
add home-path to $nu (#468) 2021-12-11 13:12:30 -06:00
Benoît Cortier
d0119ea05d
Sort default context items categorically (#465)
* Sort default context items categorically

* Separate commands in multiple statements

* Use curly braces instead of square brackets

This prevents undesired reformatting.
2021-12-10 21:07:39 -06:00
Benoît Cortier
e77c6bb284
Port hash, hash md5 and hash sha256 commands (#464)
`hash` by itself is only printing the help message.

The other two are simply using the same generic implementation.
2021-12-10 17:14:28 -06:00
Luccas Mateus
95841e3489
to xml and to yaml (#463) 2021-12-10 14:46:43 -06:00
Darren Schroeder
2e2d5ef0eb
fix 1 off table wrapping for help commands (#460) 2021-12-09 19:16:50 -06:00
Luccas Mateus
7a892ec5d7
To html and to md (#453)
* MathEval Variance and Stddev

* Fix tests and linting

* Typo

* Deal with streams when they are not tables

* First draft of these commands

* To MD

* To md and to html

* Fixed cargo and to_md

* `into_abbreviated_string` instead of `into_string`

* Changed how inner tables are displayed
2021-12-09 19:16:35 -06:00
Fernando Herrera
865906e450
Dataframe commands name (#457)
* corrected missing shellerror type

* batch dataframe commands

* removed option to find declaration with input

* ordered dataframe folders

* dataframe command name
2021-12-09 18:17:11 -06:00
Michael Angerman
7319b6b168
port over the nth command from nushell (#454)
* port over the nth command from nushell

* remove a line of redundant code

* must sort the rows or else if the rows are not from low to high this crashes engine-q
2021-12-09 18:16:04 -06:00
Jae-Heon Ji
c3b6e07de6
Port network/url command (#452)
* feat: add url command

* feat(network/url): add sub-command for url
2021-12-09 18:09:30 -06:00
Darren Schroeder
5c27ffa42e
update to latest reedline, change config point name, enable output without ansi (#458) 2021-12-09 16:06:26 -06:00
Darren Schroeder
3dc19d4179
Filesize formatting (#456)
* configure the format of filesize

* type-o

* removed some comments

* updated tests

* accomodated filesize_metric better, added test
2021-12-09 13:19:36 -06:00
Darren Schroeder
a8e5cb871e
optionally remove table output color (#455) 2021-12-09 10:00:26 -06:00
pin
15e9c11849
Fix build on NetBSD (#4192) 2021-12-09 14:23:40 +02:00
kiloson
9fd680ae2b
fix: Implicit coercion of boolean false and empty value #4094 (#4120)
Signed-off-by: closetool <c299999999@qq.com>
2021-12-09 14:19:51 +02:00
Justin
1bdcdcca70
fix: change into column_path to into column-path (breaking change) (#4185) (#4189) 2021-12-08 11:04:55 +02:00
Darren Schroeder
512dcf0988
enable cargo build --features=extra to build plugins (#448) 2021-12-07 14:06:34 -06:00
Darren Schroeder
8d027a0617
allow decimals/floats to be formatted with precision (#449)
* allow decimals/floats to be formatted with precision

* better error message
2021-12-07 14:06:14 -06:00
JT
610e3911f6
Bump to 0.41 (#4187) 2021-12-08 06:21:00 +13:00
onthebridgetonowhere
11a781fc36
Add uniq command (#447) 2021-12-07 21:47:48 +13:00
Michael Angerman
a42bbea98d
port over the prepend command from nushell (#446) 2021-12-07 21:46:21 +13:00
Darren Schroeder
c8b9913718
introducing gstat, a new command to get the git status (#443)
* wip - preliminary checking

* updated to latest pluging

* i think it's all working now, except bare words

* clippy
2021-12-06 11:28:11 -06:00
Fernando Herrera
1fd26727c5
Batch of dataframe commands (#442)
* corrected missing shellerror type

* batch dataframe commands

* removed option to find declaration with input

* ordered dataframe folders
2021-12-06 17:09:49 +13:00
Andrew Houts
ee9eddd851
avoid unnecessary allocation (#4178) 2021-12-06 07:38:58 +13:00
JT
fdde95f675
Update clippy to check all features (#441)
* Update clippy to check all features

* Fix tests

* oops
2021-12-06 07:23:43 +13:00
Jae-Heon Ji
9548e5ef5b
feat(random): add random-integer and random-uuid (#440)
* feat(randome): add random-integer

* feat(random): add random-uuid
2021-12-06 06:22:50 +13:00
Fernando Herrera
29efbee285
corrected missing shellerror type (#439) 2021-12-05 13:25:37 +00:00
Fernando Herrera
22469a9cb1
Improved labeled error from plugins (#437)
* improved labeled error from plugins

* corrected span
2021-12-05 16:11:19 +13:00
Michael Angerman
03e22b071a
port over the reject command from nushell (#419)
* port over reject

* add some tests to src/tests
2021-12-05 16:09:45 +13:00
Jakub Žádník
71a8eb6f8e
Add signature to $scope.commands (#434)
* Add signature to $scope.commands

* Change signature command column name
2021-12-04 22:01:51 +02:00
onthebridgetonowhere
c6aff972da
Cal command (#429)
* Add calendar (cal) command

* Move options into arguments to avoid clippy warnings

* Remove commented line

* Fix formatting issues

* Fix clippy warning
2021-12-05 06:15:03 +13:00
Jae-Heon Ji
82aa84706e
feat(random): add random-dice (#428) 2021-12-05 06:14:24 +13:00
Fernando Herrera
8a06ea133b
removed unwraps (#430) 2021-12-04 12:38:21 +00:00
JT
8cf4402e6c
Reset ansi more often when showing errors (#425) 2021-12-04 18:02:57 +13:00
onthebridgetonowhere
df5ac9b71c
Port str datetime to into datetime (#424)
* Port str datetime to into datetime

* Fix the span issue and some other small cleanups
2021-12-04 16:41:02 +13:00
Jakub Žádník
ee45755ea9
Add canonicalization to source & use paths (#421)
Also added file path print to FileNotFound error
2021-12-03 21:49:11 +02:00
Jakub Žádník
405a4e58c7
Fix 'help commands'; Add 'is_custom' column (#420)
* Fix fetching commands; Add is_custom column

* Remove old comment
2021-12-03 20:45:29 +02:00
Fernando Herrera
f3c8d35eb7
Plugin repeated (#417)
* not repeated decl in file and help

* implemented heashmap for repeated

* sorted scope commands
2021-12-03 14:29:55 +00:00
JT
a28d38b05f
Try some fixes for external paths (#415) 2021-12-03 20:40:31 +13:00
JT
574d7f6936
Add table streaming (#413) 2021-12-03 19:15:23 +13:00
Luccas Mateus
3d8394a909
to csv and to tsv (#412)
* MathEval Variance and Stddev

* Fix tests and linting

* Typo

* Deal with streams when they are not tables

* ToTsv and ToCsv
2021-12-03 15:02:22 +13:00
onthebridgetonowhere
349e83abd0
Port str to-decimal to into decimal command. (#408)
* Port str to-decimal to into decimal command. Add also a Value::test_float function for tests only

* Add support for handling integers into decimals and fix issues with error span
2021-12-03 15:01:19 +13:00
onthebridgetonowhere
bf82417d52
Port str upcase (#404)
* Port str upcase

* Switch to to_uppercase to support more characters than only ASCII
2021-12-03 15:00:32 +13:00
JT
c5297d2b64
First step (#411) 2021-12-03 12:11:25 +13:00
JT
d9bedaae2f
Fix plurals in abbrevations (#409) 2021-12-03 10:36:54 +13:00
JT
19766556f3
Add value abbreviations (#407) 2021-12-03 10:07:44 +13:00
onthebridgetonowhere
687fefd791
Remove Arc from Arguments (#405) 2021-12-03 10:07:36 +13:00
JT
ccd5f59314
Update external spawn (#406)
* Simplify external spawn, improve arg cleaning

* Fix tests

* Fix windows test
2021-12-03 09:55:16 +13:00
JT
c08e145501
Fix clippy warnings (#4176) 2021-12-03 07:05:38 +13:00
onthebridgetonowhere
ff673ba0ba
Add the support of str to-int to the into int command (#389) 2021-12-03 06:54:47 +13:00
JT
f57d629b55
Default prompt animations to off (#403) 2021-12-03 06:26:23 +13:00
Jae-Heon Ji
43972db131
feat(random): add random-decimal (#402) 2021-12-03 06:26:12 +13:00
Darren Schroeder
f2aa952e86
add back debug --raw switch (#401)
* add back debug --raw switch

* tweak some debug and other settings
2021-12-02 08:32:12 -06:00
JT
071066b6d9
Move prompt animation setting to config (#400) 2021-12-02 20:10:40 +13:00
Andrew Houts
79c7b20cfd
add login shell flag (#4175) 2021-12-02 20:05:04 +13:00
JT
ac2afab40b
Fix parse error metadata (#399) 2021-12-02 19:36:30 +13:00
Fernando Herrera
99de2b1d77
plugin path for $nu (#398) 2021-12-02 06:35:32 +00:00
JT
45eba8b922
Introduce metadata into the pipeline (#397) 2021-12-02 18:59:10 +13:00
Fernando Herrera
56307553ae
Plugin with evaluated call (#393)
* plugin trait

* impl of trait

* record and absolute path

* plugin example crate

* clippy error

* correcting cargo

* evaluated call for plugin
2021-12-02 05:42:56 +00:00
onthebridgetonowhere
2bbba3f5da
Port str trim (#394) 2021-12-02 17:38:44 +13:00
Luccas Mateus
34e0fd622b
to url and to toml (#396)
* MathEval Variance and Stddev

* Fix tests and linting

* Typo

* Deal with streams when they are not tables

* ToUrl and ToToml

* Linting
2021-12-02 17:38:00 +13:00
Jakub Žádník
124561ff12
Rename add_decls() to use_decls() (#395)
To reflect better what the method actually does.
2021-12-02 00:25:51 +02:00
JT
89cbfd758d
Remove 'arboard' (#4174) 2021-12-02 08:48:03 +13:00
Darren Schroeder
d8c721282b
add optional footer to table (#392)
* add optional footer to table

* missed a draw_table
2021-12-01 13:20:23 -06:00
Jae-Heon Ji
d2a1564b94
feat(random): add random-chars (#390) 2021-12-02 07:58:10 +13:00
Darren Schroeder
7cf96c6597
added row_index coloring (#391) 2021-12-01 09:17:50 -06:00
onthebridgetonowhere
b8f1fea7fe
Port str substring command (#388)
* Port str substring command

* Fix issue signaled by cargo fmt
2021-12-01 19:42:57 +13:00
Jakub Žádník
c17e1473db
Hiding of environment variables (#362)
* Remember environment variables from previous scope

* Re-introduce env var hiding

Right now, hiding decls is broken

* Re-introduce hidden field of import patterns

All tests pass now.

* Remove/Address tests TODOs

* Fix test typo; Report hiding error

* Add a few more tests

* Fix wrong expected test result
2021-11-30 19:14:05 +13:00
Jae-Heon Ji
21ddfc61f4
add random commands (#366)
* feat: add random command

* feat: add bool sub-command
2021-11-30 19:12:19 +13:00
Darren Schroeder
ce4d9dc7c6
allow icons to be used in grid -c (#378)
* add icons to grid output. still needs cleanup

* working but adds a dependency on ansi_term - need to fix that

* update styling, added lots of green code to icons

* clippy

* add config point for grid icons
2021-11-29 14:37:09 -06:00
Luccas Mateus
414ed4877a
From ssv from xml (#383)
* MathEval Variance and Stddev

* Fix tests and linting

* Typo

* Deal with streams when they are not tables

* From xml and from ssv

* linting
2021-11-30 08:22:13 +13:00
Andrew
5de12da765
Port over the kill command from nushell (#381)
* Port over the kill command from nushell

* Update formatting

* Improve error message by combining signal spans
2021-11-30 07:21:55 +13:00
Braulio Valdivielso Martínez
1794ad51bd
Sanitize arguments to external commands a bit better (#4157)
* fix #4140

We are passing commands into a shell underneath but we were not
escaping arguments correctly. This new version of the code also takes
into consideration the ";" and "&" characters, which have special
meaning in shells.

We would probably benefit from a more robust way to join arguments to
shell programs. Python's stdlib has shlex.join, and perhaps we can
take that implementation as a reference.

* clean up escaping of posix shell args

I believe the right place to do escaping of arguments was in the
spawn_sh_command function. Note that this change prevents things like:

^echo "$(ls)"

from executing the ls command. Instead, this will just print

$(ls)

The regex has been taken from the python stdlib implementation of shlex.quote

* fix non-literal parameters and single quotes

* address clippy's comments

* fixup! address clippy's comments

* test that subshell commands are sanitized properly
2021-11-29 09:46:42 -06:00
Arthur Targaryen
bab8f6bd28
Port skip, skip while and skip until commands (#380)
* Add `Skip` command

* Add `SkipUntil` sub-command

* Add `SkipWhile` sub-command

* Add and use `Expression::as_row_condition_block`
2021-11-29 19:52:23 +13:00
Fernando Herrera
ee239a0d37
testing suite for dataframes (#379) 2021-11-29 19:50:57 +13:00
Andrew
e07ce57423
Port over the sleep command from nushell (#371)
* Port over the sleep command from nushell

* Fix clippy warning

* Remove unused variable
2021-11-29 10:15:32 +13:00
Fernando Herrera
c8b16c14d5
Option to replace command same name (#374)
* option to replace command same name

* moved order of custom value declarations

* arranged dataframe folders and objects

* sort help commands by name

* added dtypes function for debugging

* corrected name for dataframe commands

* command names using function
2021-11-28 19:35:02 +00:00
Andrew
e1e7e94261
Port over the clear command from nushell (#373)
* Port over the clear command from nushell

* cargo fmt
2021-11-28 08:32:44 +00:00
Arthur Targaryen
8c0fa0d26e
Add Any command (#375) 2021-11-28 08:29:35 +00:00
JT
f7f8b0dbff
A few help cleanups (#372) 2021-11-28 07:16:20 +13:00
Arthur
63c3d19c67
Port all? command (#365)
* Implement `From<bool>` for `Value`

* Add `All` command

* Change `IntoPipelineData` and `IntoInterruptiblePipelineData` bounds

* Refactor `PipelineIterator` impls

* Add `PipelineData::into_interruptible_iter`

* Use `into_interruptible_iter` instead of `all` helper

* Merge imports

* Refactor `PipelineData::{filter, map}`

* Change comment pronoun

* Treat `RowCondition` as a block

* Remove unnecessary braces

* Address cluppy warning
2021-11-28 06:49:03 +13:00
Braulio Valdivielso Martínez
fb197f562a
save --append: create file if it doesn't exist (#4156)
* have save --append create file if not exists

Currently, doing:

echo a | save --raw --append file.txt

will fail if file.txt does not exist. This PR changes that

* test that `save --append` will create new file
2021-11-26 12:27:41 -06:00
Tshepang Lekhonkhobe
91c270c14a
fix markup (#4155) 2021-11-26 07:37:50 -06:00
JT
5d88ed6c75
Add better exit command (#369) 2021-11-26 21:00:57 +13:00
JT
f052b3313d
Move row condition to block (#368) 2021-11-26 16:49:03 +13:00
Edward Betts
3e93ae8af4
Correct spelling (#4152) 2021-11-25 11:11:20 -06:00
Luccas Mateus
8043516d75
from vcf from ics and from ini (#367)
* MathEval Variance and Stddev

* Fix tests and linting

* Typo

* Deal with streams when they are not tables

* `from toml` command

* From ods

* From XLSX

* From ics

* From ini

* From vcf

* Forgot a eprintln!
2021-11-26 06:10:56 +13:00
Fernando Herrera
76019f434e
Dataframe feature (#361)
* custom value trait

* functions for custom value trait

* custom trait behind flag

* open dataframe command

* command to-df for basic types

* follow path for dataframe

* dataframe operations

* dataframe not default feature

* custom as default feature

* corrected examples in command
2021-11-23 08:14:40 +00:00
Michael Angerman
a2aaeb38ed
port over the drop command from nushell (#358) 2021-11-22 08:04:20 +13:00
JT
143855b662
Add better comment skipping (#359) 2021-11-22 07:13:09 +13:00
Jakub Žádník
d30dfc63c4
Fix reading of LS_COLORS; ls display symlink (#357)
Also a swing-by fix removing a redundant call to 
std::fs::symlink_metadata().
2021-11-21 01:14:42 +02:00
Darren Schroeder
250743f60f
add coloring by primitive, bring in nu-ansi-term crate (#353)
* add coloring by primitive, bring in nu-ansi-term crate

* clippy
2021-11-20 07:12:35 -06:00
ahkrr
e06df124ca
upgrading dependencies (#4135)
* upgrade dependencies
num-bigint 0.3.1 -> 0.4.3
bigdecimal-rs 0.2.1 -> bigdecimal 0.3.0
s3hander 0.7 -> 0.7.5
bat 0.18 -> 0.18, default-features = false

* upgrade arboard 1.1.0 -> 2.0.1

* in polars use comfy-table instead of prettytable-rs
the last release of prettytable-rs was `0.8.0 Sep 27, 2018`
and it uses `term 0.5` as a dependency

* upgrade dependencies

* upgrade trash -> 2.0.1

Co-authored-by: ahkrr <alexhk@protonmail.com>
2021-11-20 07:11:11 -06:00
Luccas Mateus
00aac850fd
from xlsx from ods and from toml (#352)
* MathEval Variance and Stddev

* Fix tests and linting

* Typo

* Deal with streams when they are not tables

* `from toml` command

* From ods

* From XLSX
2021-11-20 08:23:35 +13:00
JT
e01e73cb67
Add debug and describe (#351)
* Add debug and describe

* Fix test
2021-11-19 18:00:29 +13:00
JT
ff43ca4d24
Better record types (#350) 2021-11-19 17:30:27 +13:00
Fernando Herrera
88988dc9f4
Plugins signature load (#349)
* saving signatures to file

* loading plugin signature from file

* is_plugin column for help command
2021-11-19 15:51:42 +13:00
JT
aa7226d5f6
Expand globs and filepaths (#348) 2021-11-19 08:32:27 +13:00
Michael Angerman
adb7eeb740
port over the append command from nushell (#345) 2021-11-19 08:16:04 +13:00
JT
96bdcc4ff7
Fix term width for the table (#346) 2021-11-18 18:48:15 +13:00
Jakub Žádník
f8f437b060
Separate Overlay into its own thing (#344)
It's no longer attached to a Block. Makes access to overlays more
streamlined by removing this one indirection. Also makes it easier to
create standalone overlays without a block which might come in handy.
2021-11-17 17:23:55 +13:00
Fernando Herrera
b35914bd17
Category option for signature (#343)
* category option for signature

* category option for signature

* column description for $scope
2021-11-17 17:22:37 +13:00
JT
2590fcbe5c
Bump to 0.40 (#4129) 2021-11-16 21:53:03 +13:00
onthebridgetonowhere
6fbe02eb21
Port str startswith (#342)
Co-authored-by: Stefan Stanciulescu <contact@stefanstanciulescu.com>
2021-11-16 12:16:56 +13:00
Jakub Žádník
5459d30a24
Add environment variable support for modules (#331)
* Add 'expor env' dummy command

* (WIP) Abstract away module exportables as Overlay

* Switch to Overlays for use/hide

Works for decls only right now.

* Fix passing import patterns of hide to eval

* Simplify use/hide of decls

* Add ImportPattern as Expr; Add use env eval

Still no parsing of "export env" so I can't test it yet.

* Refactor export parsing; Add InternalError

* Add env var export and activation; Misc changes

Now it is possible to `use` env var that was exported from a module.

This commit also adds some new errors and other small changes.

* Add env var hiding

* Fix eval not recognizing hidden decls

Without this change, calling `hide foo`, the evaluator does not know
whether a custom command named "foo" was hidden during parsing,
therefore, it is not possible to reliably throw an error about the "foo"
name not found.

* Add use/hide/export env var tests; Cleanup; Notes

* Ignore hide env related tests for now

* Fix main branch merge mess

* Fixed multi-word export def

* Fix hiding tests on Windows

* Remove env var hiding for now
2021-11-16 12:16:06 +13:00
Nico Mandery
16db368232
upgrade polars to 0.17 (#4122) 2021-11-16 12:01:02 +13:00
JT
df87d90b8c
Add 'detect columns' command (#4127)
* Add 'detect columns' command

* Fix warnings
2021-11-16 11:29:54 +13:00
Darren Schroeder
ab22619f4a
enable ls_colors for the ls command (#340)
* enable ls_colors for the `ls` command

* added wrapping with ansi-cut so the ansi sequences don't bleed over

* clippy
2021-11-15 14:09:17 -06:00
JT
42367ddf6d
Add support for crlf for line continuations (#341) 2021-11-16 07:33:33 +13:00
Benoît Cortier
e324c1a078
Port parse command (#338) 2021-11-16 07:27:15 +13:00
Michael Angerman
4fd020ab7f
delete the file row.rs in nu-protocol/value which has references to RowStream (#339) 2021-11-15 18:43:11 +13:00
onthebridgetonowhere
50cbd16ec7
Port str reverse (#337)
Co-authored-by: Stefan Stanciulescu <contact@stefanstanciulescu.com>
2021-11-15 14:43:40 +13:00
JT
be827e5628
Fix multiword imports/exports (#336) 2021-11-15 08:40:26 +13:00
onthebridgetonowhere
f1b2ab0b27
Port str lpad and str rpad (#334)
* Port str lpad and str rpad

* Remove useless comment

Co-authored-by: Stefan Stanciulescu <contact@stefanstanciulescu.com>
2021-11-15 08:36:24 +13:00
JT
0f107b2830
Add a config variable with engine support (#332)
* Add a config variable with engine support

* Add a config variable with engine support

* Oops, cleanup
2021-11-15 08:25:57 +13:00
ahkrr
74b812228c
upgrade dependencies (#4116)
* remove unused dependencies

* upgrade dependency bytes 0.5.6 -> 1.1.0

* upgrade dependency heapless 0.6.1 -> 0.7.8

* upgrade dependency image 0.22.4 -> 0.23.14

* upgrade dependency mp4 0.8.2 -> 0.9.0

* upgrade dependency bson 0.14.1 -> 2.0.1

Bson::Undefined, Bson::MaxKey, Bson::MinKey and Bson::DbPointer
weren't present in the previous version.

Co-authored-by: ahkrr <alexhk@protonmail.com>
2021-11-14 19:32:21 +13:00
JT
e76451866d
'update' command (#333) 2021-11-14 12:02:54 +13:00
onthebridgetonowhere
08d316f6a7
Port str length command (#330)
Co-authored-by: Stefan Stanciulescu <contact@stefanstanciulescu.com>
2021-11-14 10:25:55 +13:00
JT
14a2918bba
Fix some nightly clippy warnings (#329) 2021-11-13 13:42:13 +13:00
Luccas Mateus
db2bca56c9
from url and from eml (#324)
* MathEval Variance and Stddev

* Fix tests and linting

* Typo

* Deal with streams when they are not tables

* FromEml and FromUrl

Added tests for from eml
2021-11-13 09:46:39 +13:00
onthebridgetonowhere
e756a9ea04
Port str indexof (#327)
* Port str indexof

* Fix clippy warning

Co-authored-by: Stefan Stanciulescu <contact@stefanstanciulescu.com>
2021-11-12 08:45:39 +13:00
JT
568e566adf
Add record literal syntax (#326) 2021-11-11 12:14:00 +13:00
onthebridgetonowhere
586c6d9fa8
Port str find replace (#325)
* Port str find_replace command

* Add regex crate as dependency

Co-authored-by: Stefan Stanciulescu <contact@stefanstanciulescu.com>
2021-11-11 12:11:34 +13:00
Darren Schroeder
f5b20f0e3b
try to match most of nushell syntax coloring (#323) 2021-11-11 06:55:10 +13:00
Luccas Mateus
75cfee28b2
from yaml and from yml (#322)
* MathEval Variance and Stddev

* Fix tests and linting

* Typo

* Deal with streams when they are not tables

* `from yaml` and `from yml`

`from yaml` and `from yml`

from yaml and from yml

* Fix collect_string

* Fix tests and linting
2021-11-10 14:02:33 +13:00
onthebridgetonowhere
d094f654c3
Port str endswith (#321)
* Port str endswith command

* Fix clippy warnings

* Styling

Co-authored-by: Stefan Stanciulescu <contact@stefanstanciulescu.com>
2021-11-10 13:51:55 +13:00
JT
bb1740d733
Add from csv and from tsv (#320) 2021-11-10 09:17:37 +13:00
onthebridgetonowhere
0f516a0830
Port str downcase and str contains (#319)
* Port str contains command

* Add another test case / example for str contains

* Port str downcase to engine-q

Co-authored-by: Stefan Stanciulescu <contact@stefanstanciulescu.com>
2021-11-10 09:16:53 +13:00
onthebridgetonowhere
ef20b5f1ef
Port str capitalize (#317)
* Port str capitalize command

* Keep consistent naming for str commands

Co-authored-by: Stefan Stanciulescu <contact@stefanstanciulescu.com>
2021-11-09 20:40:56 +13:00
JT
e1468c0440
Add some more cell path support for fun (#316) 2021-11-09 20:13:05 +13:00
JT
0a20052799
Fix external output threading and ctrlc (#313) 2021-11-09 19:14:00 +13:00
JT
34617fabd9
Do some str collect cleanup (#312) 2021-11-09 17:46:26 +13:00
JT
47628946b6
Add str collect (#311)
* Add str collect

* Oops, missing file
2021-11-09 14:59:44 +13:00
JT
066afb059e
Add magic in variable, part 2 (#310) 2021-11-08 20:13:55 +13:00
JT
e9a7def183
Add magic $in variable (#309)
* Add magic in variable

* Oops, missing file
2021-11-08 19:21:24 +13:00
JT
e0a26cd048
Finish operator overflow checking (#308) 2021-11-08 17:44:59 +13:00
JT
b5bade6187
Let list and table exprs get indexed (#307) 2021-11-08 12:18:00 +13:00
JT
fcee3c65bd
Bump some deps (#306) 2021-11-08 11:09:30 +13:00
JT
19645575d6
Add 'did you mean' error (#305) 2021-11-08 10:48:50 +13:00
Fernando Herrera
dd6452dfaa
capnp proto change schema (#304)
* capnp proto change schema

* format schema file
2021-11-08 10:43:32 +13:00
Michael Angerman
cfd40ffaf5
Port over the reverse command from nushell (#303)
* initial commit of reverse
* reverse is working, now move on to the examples
* add in working examples for reverse
* #[allow(clippy::needless_collect)]
2021-11-07 18:18:27 +00:00
JT
00a8752c76
Move where to helper (#302) 2021-11-07 15:40:44 +13:00
Luccas Mateus
7e070e2e5b
Fix "math sum doesn't support streams" (#301)
* MathEval Variance and Stddev

* Fix tests and linting

* Typo

* Deal with streams when they are not tables
2021-11-07 14:20:58 +13:00
Michael Angerman
573cb38bab
Port over the shuffle command from nushell (#300)
* initial commit of shuffle

* port the shuffle command from nushell
2021-11-07 14:19:57 +13:00
onthebridgetonowhere
a1f141d18a
Port str case commands (#287)
* Port camel case and kebab case

* Port pascal case

* Port snake case and screaming snake case

* Cleanup before PR

* Add back cell path support for str case commands

* Add cell path tests for str case command

* Revert "Add cell path tests for str case command"

This reverts commit a0906318d95fd2b5e4f8ca42f547a7e4c5db381a.

* Add cell path test cases for str case command

* Move cell path tests from tests.rs to Examples in each of the command's file

Co-authored-by: Stefan Stanciulescu <contact@stefanstanciulescu.com>
2021-11-07 06:55:25 +13:00