Commit Graph

2440 Commits

Author SHA1 Message Date
Antonio Natilla
806cd4851f Format implementation, fix on Echo
Now, Echo converts multiple values in a ValueStream, but it simply
forwards a single Value; if no PipelineData is detected as an input, an
empty string is returned as a single Value.
2021-11-03 19:57:30 +01:00
JT
ea27300ca0
Merge pull request #278 from onthebridgetonowhere/port_into_string
Port into string command
2021-11-04 05:59:56 +13:00
Luccas Mateus de Medeiros Gomes
d3e5c5a342 Fix tests 2021-11-03 09:19:28 -03:00
Luccas Mateus de Medeiros Gomes
5ae823612f MathCeil, MathFloor and MathMode 2021-11-03 08:59:08 -03:00
Stefan Stanciulescu
20f3b8b274 Remove unnecessary crate imports 2021-11-03 10:41:01 +01:00
Stefan Stanciulescu
6906de7c48 Ooops fix the wrong naming 2021-11-03 08:48:13 +01:00
Stefan Stanciulescu
bf6c3e53a0 Remove BigDecimal and use i64/f64 instead 2021-11-03 08:38:31 +01:00
Antonio Natilla
af5799c702 Merge remote-tracking branch 'origin/main' into porting-format 2021-11-03 08:02:51 +01:00
Luccas Mateus de Medeiros Gomes
756773a6ed MathFloor done and MathMode still left work
Math mode final form currently

MathMode and MathFloor
2021-11-02 22:33:45 -03:00
JT
86e1092785 Add more api docs 2021-11-03 13:26:09 +13:00
Fernando Herrera
e193bf43fb multiple functions in plugin 2021-11-02 21:51:11 +00:00
Fernando Herrera
12eed1f98a plugin feature flag 2021-11-02 20:56:00 +00:00
Antonio Natilla
d134774f4b Merge remote-tracking branch 'origin' into porting-format 2021-11-02 21:23:50 +01:00
JT
5e42b14026 Documenting some code and doing cleanups 2021-11-03 08:53:48 +13:00
Stefan Stanciulescu
78cc3452df Fix clippy warnings for into string command 2021-11-02 20:51:03 +01:00
Stefan Stanciulescu
070067b75e Add into string command 2021-11-02 20:39:16 +01:00
Antonio Natilla
52cb50b937 Base Command implementation for Format
Note that run is not implemented yet
2021-11-02 18:13:06 +01:00
Stefan Stanciulescu
ce54764bea Fix test case for first command 2021-11-02 09:06:51 +01:00
Stefan Stanciulescu
6e49d0f84b Fix first command to display the first item not as a table 2021-11-02 09:05:03 +01:00
Stefan Stanciulescu
e1ea0d42a9 Merge branch 'main' of https://github.com/nushell/engine-q into port_first_command 2021-11-02 08:32:38 +01:00
JT
19301751ee Fix some machine epsilon warnings 2021-11-02 19:37:53 +13:00
JT
7b2116dc29
Merge pull request #270 from elferherrera/plugins
Plugins for engine q
2021-11-02 19:07:45 +13:00
JT
25846d3c1e Add zip command 2021-11-02 18:28:28 +13:00
JT
d856cebebd Add a simple scope variable 2021-11-02 16:08:05 +13:00
JT
3c1b3473ae
Merge pull request #273 from luccasmmg/engine-q-math
New math commands(product, round, sqrt and sum)
2021-11-02 11:20:35 +13:00
JT
89b8ee6ad8
Merge pull request #268 from onthebridgetonowhere/date_enqine_q
Port date commands to enqine-q
2021-11-02 11:18:46 +13:00
Stefan Stanciulescu
4a68c989e4 Fix test for date to-table 2021-11-01 23:05:53 +01:00
Luccas Mateus de Medeiros Gomes
e16b0e7b01 New math commands(product, round, sqrt and sum) 2021-11-01 18:29:34 -03:00
Antonio Natilla
1c2741c598 Fixing run implementation for Echo
Values to echo need to be extracted from the call, and then converted
into PipelineData.

I also updated the first example so that its result is a List,
as in the reference implementation.
2021-11-01 15:43:16 +01:00
Antonio Natilla
89225cf55c Adding examples and test for Echo 2021-11-01 09:37:07 +01:00
Fernando Herrera
1f4c34fa04 adding span to value encoding 2021-11-01 08:16:56 +00:00
Antonio Natilla
f4ed4fa7e3 Implementing Command for Echo, no examples
Referring to:

https://github.com/nushell/nushell/blob/main/crates/nu-command/src/commands/core_commands/echo.rs

as the original implementation.
2021-11-01 09:12:48 +01:00
Fernando Herrera
c56a233808 formating schema file 2021-11-01 07:56:10 +00:00
Fernando Herrera
468b9affde move run_plugin command location 2021-11-01 07:40:05 +00:00
Fernando Herrera
ef94c71866 Merge branch 'main' of https://github.com/nushell/engine-q into plugins 2021-11-01 07:24:33 +00:00
Fernando Herrera
43c3cfecf7 plugin call function 2021-11-01 07:20:33 +00:00
JT
3176f60b5b
Merge pull request #243 from kubouch/module-files
Loading modules from files
2021-11-01 11:08:03 +13:00
Stefan Stanciulescu
ef56d482b2 Port first command to engine-q 2021-10-31 22:53:37 +01:00
Stefan Stanciulescu
304c7a0c92 Remove old code before fixing clippy's warning 2021-10-31 21:08:40 +01:00
Stefan Stanciulescu
8707fbee33 Address clippy's warnings when porting date to engine-q 2021-10-31 21:06:58 +01:00
Stefan Stanciulescu
032356bfb7 Address clippy's warnings when porting date to engine-q 2021-10-31 21:06:44 +01:00
Stefan Stanciulescu
3437dacf0b Change output of date to-table to be a one-row table 2021-10-31 20:53:23 +01:00
JT
80a4a5eb28
Merge pull request #266 from luccasmmg/engine-q-math-2
Added math and min commands
2021-11-01 06:45:16 +13:00
Jakub Žádník
73ae3daf85 Add invalid UTF-8 error to use and source
Also changed the error message to be more universal.
2021-10-31 17:53:53 +02:00
Jakub Žádník
f182524298 Add TODO notes 2021-10-31 17:46:37 +02:00
Jakub Žádník
b7c0ba104f Fix hiding module; Fmt
This fixes the case when you call `hide spam`. It will now hide all
commands you'd call like `spam foo` etc.
2021-10-31 17:38:00 +02:00
Jakub Žádník
7112664b3f Fix wrong spans of multiple files
The introduction of `use <file.nu>` added the possibility of calling
`working_set.add_file()` more than once per parse pass. Some of the
logic handling the file contents offsets prevented it from working and
hopefully, this commit fixes it.
2021-10-31 17:22:10 +02:00
Luccas Mateus de Medeiros Gomes
5add6035a4 Added math and min commands
typo

Added op span
2021-10-31 08:06:32 -03:00
Fernando Herrera
a390f66dbf call and response serializers 2021-10-31 08:17:01 +00:00
Stefan Stanciulescu
fa8a0958e4 Merge branch 'main' of https://github.com/nushell/engine-q into date_enqine_q 2021-10-31 07:56:32 +01:00
Stefan Stanciulescu
20c770370b Port date commands to engine-q 2021-10-31 07:54:51 +01:00
Oscar Dominguez
f94a3e15f5
Get rid of header bold option (#4076)
* refactor(options): get rid of 'header_bold' option

* docs(config): remove 'header_bold' from docs

* fix(options): replicate logic to apply true/false in bold

* style(options): apply lint fixes
2021-10-31 06:59:19 +13:00
Michael Angerman
da515b1c9d port the filter command range from nushell 2021-10-30 10:51:20 -07:00
Fernando Herrera
37f7a36123 syntax serializers 2021-10-30 14:21:59 +01:00
Fernando Herrera
9838154ad1 round trip call info 2021-10-30 11:19:16 +01:00
Fernando Herrera
f301f686b5 Merge branch 'main' of https://github.com/nushell/engine-q into plugins 2021-10-30 11:01:49 +01:00
Jakub Žádník
751595e72e Add multi-word name calling support 2021-10-29 23:50:28 +03:00
JT
cf3f3fde92 Add some support for 2021-10-30 07:15:17 +13:00
JT
624edce4f7 Add 'to json' 2021-10-29 19:26:29 +13:00
Yogi
75782f0f50
Fix #4070: Inconsistent file matching rule for ls and rm (#4099) 2021-10-28 15:05:07 +03:00
Fernando Herrera
51e48bee53 Merge branch 'main' of https://github.com/nushell/engine-q into plugins 2021-10-28 07:12:40 +01:00
JT
520d9e1fb6
Merge pull request #262 from nushell/ctrlc
Add initial ctrl-c support
2021-10-28 17:22:48 +13:00
JT
37150af970
Merge pull request #260 from luccasmmg/engine-q-math-2
Added math avg
2021-10-28 17:14:49 +13:00
JT
bac8b8a450 Add initial ctrl-c support 2021-10-28 17:13:10 +13:00
Luccas Mateus de Medeiros Gomes
40ad9acbc3 Added math avg
Linting

Fix clippy warning

Fix list of records
2021-10-27 22:13:55 -03:00
Jakub Žádník
4fc533340b Add function that searches for multi-word commands
It doesn't do anything right now.
2021-10-28 00:53:28 +03:00
Michael Angerman
c114f41545 clippy fix 2021-10-27 08:35:42 -07:00
Michael Angerman
9baf720156 add in an example 2021-10-27 08:07:37 -07:00
Michael Angerman
4b31fe1924 code cleanup 2021-10-27 07:25:30 -07:00
Michael Angerman
656e86a7ca got it working by turning it into a vec 2021-10-27 07:19:33 -07:00
Michael Angerman
5d62f1a9c1 compile error to show issue 2021-10-26 21:04:48 -07:00
Michael Angerman
6d6b850911 switched to a working function called rows_to_skip 2021-10-26 20:48:31 -07:00
Jakub Žádník
b5329fe4ec Cleanup; Remove redundant UTF-8 check 2021-10-27 00:34:39 +03:00
Jakub Žádník
78256b4923 Fix syntax highlighting for new import patterns 2021-10-27 00:30:39 +03:00
Jakub Žádník
bd6c550470 Change import pattern delimiter to space
Subcommands and module imports will have the same syntax now.
2021-10-27 00:13:39 +03:00
Michael Angerman
95628bef16 sending off for JT to review 2021-10-26 13:45:10 -07:00
Michael Angerman
ca7ff37697 add in dbg info so I can see what is being matched on 2021-10-26 13:06:26 -07:00
Fernando Herrera
af02c8f6ea call info encoder 2021-10-26 20:50:39 +01:00
Michael Angerman
0f27249319 Merge branch 'main' into last2 2021-10-26 12:49:08 -07:00
JT
2b06ce27d3
Bump to 0.39 (#4097) 2021-10-27 08:36:41 +13:00
Michael Angerman
3625324bad last is working also with the hard coded length, need to figure out how to get the length of the input 2021-10-26 11:46:03 -07:00
Michael Angerman
7e66aca18e going to have to figure out how to clone input or some other solution 2021-10-26 11:29:00 -07:00
Jakub Žádník
a240aead8c Add loading module from file
Currently, `use spam.nu` creates a module `spam`. Therefore, after the
first `use`, it is possible to call both `use spam.nu` and `use spam`
with the same effect.
2021-10-26 21:03:12 +03:00
Jakub Žádník
75b3b3e090 Add comments 2021-10-26 21:03:12 +03:00
Jakub Žádník
5163dbb7a1 Add tests and cover edge cases of the :: delim. 2021-10-26 21:03:12 +03:00
Jakub Žádník
cbda1b1650 Change import pattern delimiter to :: 2021-10-26 21:03:12 +03:00
Jakub Žádník
e66fd91045 Move module block parsing into its own function 2021-10-26 21:03:12 +03:00
Gabriel Borges Gutierrez
a29c333cb1 ls type lowercase 2021-10-26 15:02:45 -03:00
JT
6b14f9d6b0 Fix par-each signature 2021-10-26 21:16:15 +13:00
JT
29dde84394
Merge pull request #254 from nushell/iter_perf
Some iter perf improvements
2021-10-26 16:28:42 +13:00
JT
543c566ccc Some iter perf improvements 2021-10-26 16:22:37 +13:00
JT
abb6d9f10f Fix par-each example 2021-10-26 14:49:25 +13:00
JT
e039e5f6a4
Merge pull request #252 from nushell/par_each
Add a simple parallel each
2021-10-26 14:37:56 +13:00
JT
9b67899f8d
Merge pull request #248 from luccasmmg/engine-q-math
Engine q math(just one command)
2021-10-26 14:32:03 +13:00
JT
5455270446 Add a simple parallel each 2021-10-26 14:30:53 +13:00
Luccas Mateus de Medeiros Gomes
11d8e6c71f Just removed a few comments 2021-10-25 21:11:20 -03:00
Luccas Mateus de Medeiros Gomes
2ce034d0f0 linting 2021-10-25 20:57:45 -03:00
Luccas Mateus de Medeiros Gomes
017b1d8996 Updated to new PipeLineData and made the tests run 2021-10-25 20:56:22 -03:00
Luccas Mateus
3a5b943d11
Merge branch 'nushell:main' into engine-q-math 2021-10-25 20:40:41 -03:00
JT
766726d0fa Use different helper functions for split column 2021-10-26 12:35:51 +13:00
JT
df07ed5bf6 Remove debug message 2021-10-26 12:12:27 +13:00
JT
962adf5a12 add threading 2021-10-26 11:56:29 +13:00
JT
c18f0dcc84 range display touchup 2021-10-26 11:24:10 +13:00
JT
85a69c0a45 WIP 2021-10-26 10:14:21 +13:00
JT
d29208dd9e WIP 2021-10-26 09:04:23 +13:00
JT
f84582ca2b WIP 2021-10-26 06:46:26 +13:00
JT
5d19017603 WIP 2021-10-26 05:58:58 +13:00
Luccas Mateus de Medeiros Gomes
3f313da4c3 Fix test 2021-10-25 08:10:17 -03:00
JT
baac60a5a7 WIP 2021-10-25 19:42:38 +13:00
JT
b5965ee8ef WIP 2021-10-25 19:31:39 +13:00
JT
397a31e69c WIP 2021-10-25 17:24:10 +13:00
JT
b6d269e90a WIP 2021-10-25 17:01:02 +13:00
Luccas Mateus de Medeiros Gomes
aa5ab8a666 final math abs 2021-10-24 20:58:18 -03:00
Fernando Herrera
36a834c1e3 encode list 2021-10-24 13:20:01 +01:00
Michael Angerman
4bb2406772 Merge branch 'main' into interactive_helper 2021-10-23 18:09:20 -07:00
JT
1296100d31 Clippy fixes 2021-10-24 12:40:27 +13:00
Fernando Herrera
5a1d99cefb plugin command 2021-10-23 21:11:19 +01:00
Fernando Herrera
232790f488 plugin command 2021-10-23 21:08:54 +01:00
Michael Angerman
297f3ba575 clean up filesystem by moving get_interactive_confirmation into util.rs 2021-10-23 10:57:45 -07:00
Luccas Mateus
72c241348b
Remove dependencies (#4087)
* fix regression

* Removed the nipper dependency

* fix linting

* fix clippy
2021-10-22 06:58:40 +13:00
JT
ab2d2db987
Fix clippy warnings (#4088)
* Fix clippy warnings

* Fix clippy warnings
2021-10-22 06:57:51 +13:00
Luccas Mateus
51bea2e884 still not working 2021-10-21 12:29:57 -03:00
Luccas Mateus
b1d7e3aa49 starting to build this 2021-10-21 11:52:26 -03:00
JT
b322a12f58 Add more helper functions 2021-10-20 18:58:25 +13:00
Luccas Mateus
07e05ef183
fix regression (#4086) 2021-10-19 13:39:23 -05:00
JT
1b745015c3 little cleanup 2021-10-16 07:51:25 +13:00
JT
68601629c0 Fix warning 2021-10-16 07:39:36 +13:00
JT
82b0415d92 Try out select completions from dialoguer 2021-10-16 07:37:58 +13:00
JT
bd5009a865
Merge pull request #235 from GabrielBG0/interactive-flag
cp, mv, and rm commands need to support -i flag
2021-10-16 07:17:03 +13:00
Gabriel B Gutierrez
5bd20e4d36 fix clippy warnings 2021-10-15 12:12:17 -03:00
Gabriel B Gutierrez
28b26ca44d supress warnings 2021-10-14 18:14:59 -03:00
Gabriel B Gutierrez
b3192ddc97 fix operating more than 2 file at the same time 2021-10-14 17:03:39 -03:00
Gabriel B Gutierrez
8c2ae1eed1 -i flag finished, lacking tests 2021-10-14 14:54:51 -03:00
Darren Schroeder
fdf6bbb6fc clean up some todo comments in grid 2021-10-14 08:03:20 -05:00
JT
0d7b10fd0b Remove bad fixmes 2021-10-14 17:43:49 +13:00
Gabriel B Gutierrez
9ea7cdfc33 -i flag on signaure 2021-10-13 19:29:08 -03:00
JT
dcda7a4e50 Touchups to help 2021-10-14 06:58:39 +13:00
JT
fdd2c35fd9 Add the default help flag 2021-10-14 06:53:27 +13:00
JT
5c46138563 Some touchups to size 2021-10-13 17:15:37 +13:00
JT
ef58348ea2 Merge branch 'main' into load_config 2021-10-13 16:59:09 +13:00
JT
a760e46c1c Add config file loading 2021-10-13 16:57:05 +13:00
Justin
f5ce63ad55
Merge branch 'nushell:main' into main 2021-10-12 14:56:45 -07:00
xiuxiu62
151bdc8910 drop unused imports 2021-10-12 14:56:29 -07:00
xiuxiu62
2b99e49792 add strings/size command 2021-10-12 14:55:29 -07:00
xiuxiu62
94d00b28b7 add unicode-segmentation crate 2021-10-12 14:55:07 -07:00
xiuxiu62
8fee0b32e7 impl Value::Record from HashMap<String, Value> 2021-10-12 14:54:28 -07:00
Darren Schroeder
ffd922f393 add ability to parse strings like "100kib" and "100 kib" 2021-10-12 15:22:12 -05:00
JT
6024a001b4 Clarify todo/fixmes 2021-10-13 06:44:23 +13:00
JT
aea8627c30 Prevent invalid var names 2021-10-12 18:08:55 +13:00
JT
5f14faf4b4 Custom switch support 2021-10-12 17:49:17 +13:00
JT
c8277a3da9 Do rest args 2021-10-12 16:28:39 +13:00
JT
96419f168b Also fix the flag params 2021-10-12 10:17:45 +13:00
JT
1f45304cf9 Fix parser when def has missing params 2021-10-12 09:58:38 +13:00
JT
63e3552eef Add the remaining missing operators 2021-10-12 09:35:12 +13:00
JT
1a15f30eb8 Error on missing column during cell path 2021-10-12 08:51:54 +13:00
JT
0676f32509 Merge branch 'main' into earlier_errors 2021-10-12 08:33:19 +13:00
Darren Schroeder
ea9aad9b5d fix to allow windows to compile 2021-10-11 13:58:10 -05:00
JT
38bc394a12 Expose errors early when possible 2021-10-12 07:45:31 +13:00
JT
d33a9549b5 Add serialize/deserialize for streams 2021-10-12 07:12:47 +13:00
JT
c4fe190cee
Merge pull request #119 from nushell/error_improvement
Error improvement
2021-10-12 07:08:16 +13:00
JT
ba73e0eb06 Another early emit 2021-10-12 06:37:22 +13:00
JT
0504a7a776 Make errors emit first 2021-10-12 06:35:40 +13:00
Darren Schroeder
0e36b4b1bd
type-o
changes seperator to separator
2021-10-11 09:32:06 -05:00
JT
4d0a253924 Merge main 2021-10-11 14:57:39 +13:00
JT
c3a032950d Add initial batch of into conversions 2021-10-11 14:56:19 +13:00
xiuxiu62
491efab09b remove open and save 2021-10-10 13:24:54 -07:00
Justin
7cafdc9675
Merge branch 'nushell:main' into main 2021-10-10 13:15:54 -07:00
JT
ecee5a9845
Update chars.rs 2021-10-11 07:28:33 +13:00
Jakub Žádník
77c520e10b Make predeclarations scoped; Add hiding tests
In some rare cases, the global predeclarations would clash, for example:

  > module spam { export def foo [] { "foo" } }; def foo [] { "bar" }

In the example, the `foo [] { "bar" }` would get predeclared first, then
the predeclaration would be overwritten and consumed by `foo [] {"foo"}`
inside the module, then when parsing the actual `foo [] { "bar" }`, it
would not find its predeclaration.
2021-10-10 14:31:13 +03:00
Jakub Žádník
40741254f6 Rewrite hiding system
Hiding definitions now should work correctly with repeated use of 'use',
'def' and 'hide' keywords.

The key change is that 'hide foo' will hide all definitions of foo
that were defined/used within the scope (those from other scopes are
still available). This makes the logic simpler and I found it leads to a
simpler mental map: you don't need to remember the order of defined/used
commands withing the scope -- it just hides all.
2021-10-10 13:18:47 +03:00
jacremer
0b35905ce9 revert temp val 2021-10-09 22:43:50 -07:00
xiuxiu62
beb15dcc77 cleanup + clippy suggestions 2021-10-09 21:17:08 -07:00
xiuxiu62
97ca242634 add rm command + stubs for open and save 2021-10-09 21:13:15 -07:00
Arthur Targaryen
a0a63c966f Add inline attribute and address warning 2021-10-09 19:44:03 +02:00
Arthur Targaryen
75de7f7e61 Implement PartialOrd for Value::Stream 2021-10-09 19:40:47 +02:00
Arthur Targaryen
4e443b2088 Change helper method visibility 2021-10-09 19:40:47 +02:00
Arthur Targaryen
9e7e8ed48f Handle not-in operator 2021-10-09 19:40:47 +02:00
Arthur Targaryen
5f9ad0947d Fix Range::contains 2021-10-09 19:40:47 +02:00
Arthur Targaryen
4235cf1191 Implement and use PartialOrd for Value 2021-10-09 19:40:45 +02:00
Arthur Targaryen
357b9ccaa9 Remove unused import 2021-10-09 19:27:54 +02:00
Arthur Targaryen
d1f0740765 Refactor in operator for Range 2021-10-09 19:27:54 +02:00
Arthur Targaryen
29cbcb8459 Implement RangeIterator::contains 2021-10-09 19:27:54 +02:00
Arthur Targaryen
7f06d6144f Support in operator for record and value stream 2021-10-09 19:27:54 +02:00
Arthur Targaryen
7db6b876ab Simplify Result<Value, _> comparaison using matches! 2021-10-09 19:27:54 +02:00
Arthur Targaryen
d3bc096d47 Handle reverse ranges
This is really ugly and should be refactored.
2021-10-09 19:27:54 +02:00
Arthur Targaryen
8783cf0138 Add basic in operator support 2021-10-09 19:27:54 +02:00
JT
8df9ea6c68 Add a couple more tests to for 2021-10-10 05:58:33 +13:00
JT
5d36d37d20 Merge branch 'main' into fix_for 2021-10-10 05:20:50 +13:00
JT
789fc30bf9 oops forgot file 2021-10-10 05:14:02 +13:00
JT
e4ce41ba15 Fix the for loop to create vars 2021-10-10 05:10:46 +13:00
Fernando Herrera
8756e88e3c command split 2021-10-09 14:28:09 +01:00
Fernando Herrera
41366f6cc4 Merge branch 'main' of https://github.com/nushell/engine-q into unit-test 2021-10-09 14:17:07 +01:00
Fernando Herrera
e3e4ae0591 example unit test 2021-10-09 14:10:10 +01:00
JT
2cd1f634d0 Add map and flat_map to value 2021-10-09 19:20:32 +13:00
JT
5c29a83a7a Add tests 2021-10-09 15:45:25 +13:00
JT
60f9fe1aa4 Port split column and split row 2021-10-09 15:41:39 +13:00
JT
44fbf0fce3
Merge pull request #108 from nushell/help_and_start_split
Port help and start porting split
2021-10-09 14:07:13 +13:00
JT
4ddc953e38 Port help and start porting split 2021-10-09 14:02:01 +13:00
JT
64d83142c3 More external cleanup 2021-10-09 11:30:10 +13:00
JT
dea9c1482b Allow vars and subexprs in extern args 2021-10-09 10:51:47 +13:00
JT
1b977c658c Improve the alias expansion 2021-10-09 08:38:42 +13:00
Darren Schroeder
42113a767a allow one to specify a custom separator 2021-10-08 10:15:07 -05:00
Darren Schroeder
c636c30a19 added a switch to enable coloring 2021-10-08 09:53:26 -05:00
Darren Schroeder
5ddf0d209d respect lscolors env var; measure width minus ansi 2021-10-08 09:40:20 -05:00
Darren Schroeder
1a3a837f3e
Merge pull request #96 from fdncred/ls_grid_output
output `ls` as a grid vs table
2021-10-08 08:23:15 -05:00
Darren Schroeder
c4dabe8327 some cleanup, extra_usage 2021-10-08 08:14:32 -05:00
xiuxiu62
bdfe8c0888 add mkdir command 2021-10-07 15:20:23 -07:00
Darren Schroeder
c4977ae143 clippy 2021-10-07 16:59:01 -05:00
Darren Schroeder
54a41c535b only print items with name column 2021-10-07 16:50:27 -05:00
xiuxiu62
8550f50522 substitute idiomatic call flag check 2021-10-07 14:36:47 -07:00
xiuxiu62
e8e1ead99d change diagnostic code on CreateNotPossible 2021-10-07 14:20:03 -07:00
xiuxiu62
adabc839bf add touch command 2021-10-07 14:18:03 -07:00
Darren Schroeder
698f768a06 Merge branch 'main' into ls_grid_output 2021-10-07 11:07:21 -05:00
Darren Schroeder
ae8b315e76 added list output 2021-10-07 11:00:49 -05:00
Darren Schroeder
58d73d4c23 moved grid to it's own crate named nu-term-grid 2021-10-07 10:32:39 -05:00
Darren Schroeder
22cfe4391e
remove history file after clearing it (#4069) 2021-10-07 10:09:31 -05:00
JT
7eb022b58c Adapt tk's work for a source command 2021-10-06 15:29:05 +13:00
Tanishq Kancharla
d481d5ca96 Merge branch 'main' of https://github.com/nushell/engine-q into source-command 2021-10-05 22:16:07 -04:00
Tanishq Kancharla
996ee363b7 comments 2021-10-05 22:03:18 -04:00
Tanishq Kancharla
011ad2e4e6 Merge branch 'source-command' of https://github.com/moonrise-tk/engine-q into source-command 2021-10-05 21:59:26 -04:00
Tanishq Kancharla
d6d0bad7aa reverted 2021-10-05 21:59:16 -04:00
JT
b35d47c500
Merge pull request #98 from xiuxiu62/main
port `cp` to fs commands
2021-10-06 11:20:18 +13:00
jacremer
b3b51a2ed6 drop redundant iter -> vec -> iter 2021-10-05 15:09:51 -07:00
xiuxiu62
cc8a470668 clean up unused imports 2021-10-05 14:13:23 -07:00
xiuxiu62
74d4c501a8 add move, recursive fill, and recursive create procedures 2021-10-05 14:08:39 -07:00
Michael Angerman
5cc7fbcde7 jntrnr to nushell 2021-10-05 13:03:43 -07:00
Michael Angerman
8536c12bd9 change signature name to get, it was (I believe) incorrectly named wrap 2021-10-05 12:59:17 -07:00
xiuxiu62
8dc3ebd6e2 start cp command 2021-10-05 12:55:46 -07:00
xiuxiu62
5da1310696 add fs utils 2021-10-05 12:55:33 -07:00
xiuxiu62
9d49618e87 add impl From io::Error and dyn Error for ShellError 2021-10-05 12:54:30 -07:00
Darren Schroeder
7697f7bdce fix doc-test 2021-10-05 12:58:48 -05:00
JT
e1ebd461d2
Bump to 0.28 (#4064) 2021-10-06 06:35:25 +13:00
JT
f000d5d0a1
Remove the broken scrolling support (#4063)
* Remove the broken scrolling support

* Remove the broken scrolling support
2021-10-06 05:57:14 +13:00
Darren Schroeder
51a43f5617 mayve fix ci 2021-10-05 11:14:31 -05:00
Darren Schroeder
11b40a6c31 clippy 2021-10-05 10:30:49 -05:00
Darren Schroeder
3c843f7f61 renamed nu_grid to grid 2021-10-05 10:22:57 -05:00
Darren Schroeder
e402adbba0 WIP: output ls as a grid vs table 2021-10-05 08:43:20 -05:00
jacremer
27dcbe5c8a fix SyntaxShape::Filepath build error 2021-10-04 22:08:15 -07:00
Justin
4eb43adef2
Merge branch 'nushell:main' into main 2021-10-04 22:02:43 -07:00
jacremer
0ef0588e29 mv clippy suggestions 2021-10-04 21:40:26 -07:00
JT
80e7a8d594
Update mv.rs 2021-10-05 16:58:49 +13:00
xiuxiu62
1b96da5e5b add custom filesystem shell errors 2021-10-04 20:43:07 -07:00
JT
31ce8c1e33 Variable completions and better ls 2021-10-05 15:46:24 +13:00
JT
535ece4e76 Add unit parsing and eval support 2021-10-05 15:27:39 +13:00
Josh Cheek
574c5961c8
Add -c flag to select command (#4062)
See cc3653cfd9 for more on the `-c` flag.

Co-authored-by: Andrés N. Robalino <andres@androbtech.com>

Co-authored-by: Andrés N. Robalino <andres@androbtech.com>
2021-10-05 13:23:37 +13:00
JT
c884d5ca31 Better completions for external args 2021-10-05 10:50:46 +13:00
JT
f80e9d4b60
Merge pull request #91 from nushell/list_completions
Use list completions and better expansion
2021-10-05 10:44:26 +13:00
JT
26166192e5
Merge pull request #89 from kubouch/hide-import-patterns
Add import patterns to 'hide'
2021-10-05 10:44:13 +13:00
JT
7c2bf68d45 Use list completions and better expansion 2021-10-05 10:37:32 +13:00
Jakub Žádník
6f5f1fa43a Clippy 2021-10-04 22:37:43 +03:00
JT
a88058006a Add path completions 2021-10-05 08:21:31 +13:00
Jakub Žádník
9737d4a614 Change comments 2021-10-04 20:33:27 +03:00
Jakub Žádník
4dacfaa44a Add import pattern support to 'hide' 2021-10-04 20:08:24 +03:00
xiuxiu62
b2148e32b8 make mv parameters required 2021-10-04 05:13:47 -07:00
xiuxiu62
e325fd114d port the mv command 2021-10-04 04:32:08 -07:00
Tanishq Kancharla
dfd321a679
Merge branch 'main' into source-command 2021-10-03 14:25:00 -04:00
Tanishq Kancharla
909b7d2160 no-op 2021-10-03 14:23:23 -04:00
JT
75e323ee35 Lines shouldn't trim 2021-10-03 10:56:11 +13:00
JT
758fce8ae3
Merge pull request #86 from nushell/add_cd
Add simple cd
2021-10-03 09:20:28 +13:00
JT
91090e1db1 Add simple cd 2021-10-03 09:16:37 +13:00
JT
1d7ab28a0f
Merge pull request #74 from kubouch/module-export
Modules: export & hide
2021-10-03 06:25:43 +13:00
JT
b5ec9e0360
Update mod.rs 2021-10-03 06:16:02 +13:00
JT
e4e1b7a11e
Merge pull request #85 from stormasm/cargo-serde-derive
add serde derive to Cargo.toml so nu-protocol compiles standalone
2021-10-03 06:09:11 +13:00
Michael Angerman
be68b84473 add serde derive feature to Cargo.toml so nu-protocol compiles stand alone 2021-10-02 10:02:11 -07:00
Jakub Žádník
81cd03626d
Merge branch 'main' into module-export 2021-10-02 18:53:35 +03:00
Fernando Herrera
6f4df31927 removed comments 2021-10-02 14:16:37 +01:00
Fernando Herrera
03339beae1 prompt with env variable 2021-10-02 14:10:28 +01:00
hedonihilist
62c5df5fc6
expand tilde when reading plugin_dirs (#4052) 2021-10-02 21:38:21 +13:00
Hojjat
92c855a412
Fixed two typos in the tutor. (#4051) 2021-10-02 21:37:59 +13:00
JT
63a0aa6088 Let strings be cell paths 2021-10-02 18:43:43 +13:00
JT
6b76dd7cd7 Add select 2021-10-02 17:55:05 +13:00
JT
5843acec02 Add wrap and get and cell_path parsing 2021-10-02 15:59:11 +13:00
Tanishq Kancharla
8ef16c6da6 add source command 2021-10-01 22:25:35 -04:00
Tanishq Kancharla
e1a0ad2987 fix more merge conflicts 2021-10-01 22:24:43 -04:00
Tanishq Kancharla
2d4e471052 fix more merge conflicts 2021-10-01 22:17:32 -04:00
Tanishq Kancharla
16c60f44d5 merge w/ upstream 2021-10-01 22:09:16 -04:00
Tanishq Kancharla
adb92b970e nothing 2021-10-01 22:07:17 -04:00
Jakub Žádník
6595c06598 Relax panic into error
Convert the panic when declaration cannot find predeclaration into an
error. This error is already covered and reported in the predeclaration
phase.
2021-10-02 03:42:35 +03:00
JT
c5e9ff5f14 add ps and early help 2021-10-02 10:53:13 +13:00
Jakub Žádník
fb0f83e574 Disallow hiding the same def twice; Add tests
Tests got removed after rebase.
2021-10-02 00:12:30 +03:00
Jakub Žádník
891d79d2aa Fmt and misc fixes after rebase 2021-10-01 23:30:56 +03:00
Jakub Žádník
25b05dec9e Fix panic on double def; Tests; Double def error
* Fixes a panic with defining two commands with the same name caused by
  declaration not found after predeclaration.
* Adds a new error if a custom command is defined more than once in one
  block.
* Add some tests
2021-10-01 23:25:24 +03:00
Jakub Žádník
2af8116f50 Fix hiding logic; Fix hiding with predecls
* Hiding logic is simplified and fixed so you can hide and unhide the
  same def repeatedly.
* Separates predeclared ids into its own data structure to protect them
  from hiding. Otherwise, you could hide the predeclared variable and
  the actual def would panic.
2021-10-01 23:24:57 +03:00
Jakub Žádník
aa06a71e1f Move new commands to the new structure 2021-10-01 23:24:57 +03:00
Jakub Žádník
244289c901 Add missing file 2021-10-01 23:24:57 +03:00
Jakub Žádník
7488254cca Implement a rough version of 'hide'
'hide' command is used to undefine custom commands
2021-10-01 23:24:54 +03:00
Jakub Žádník
3cbf99053f Throw an error if using export outside of module 2021-10-01 23:21:30 +03:00
Jakub Žádník
93521da9d8 Add 'export def' command 2021-10-01 23:21:28 +03:00
Jakub Žádník
561feff365 Introduce 'export' keyword 2021-10-01 23:19:39 +03:00
Jakub Žádník
1b89ccf25b Add comment 2021-10-01 23:19:39 +03:00
Darren Schroeder
d395816929
remove ansi colors if this is not a tty (#4058) 2021-10-01 09:00:08 -05:00
JT
503939dcbe add sys command 2021-10-01 19:53:47 +13:00
JT
d6e24cceb4 add a vertical record view 2021-10-01 19:01:22 +13:00
JT
db3e9efc4b fix warnings 2021-10-01 18:20:25 +13:00
JT
3e232a5db8 Add 'from json' 2021-10-01 18:11:49 +13:00
Tanishq Kancharla
e00755a2e9 fix compile errors 2021-09-30 23:04:56 -04:00
JT
8250b44ce5 moved commands 2021-09-30 07:25:05 +13:00
JT
f0d5e2dcf1 Prepare nu_commands for porting 2021-09-30 07:17:51 +13:00
Darren Schroeder
5e34ef6dff
new command: into column_path (#4048) 2021-09-29 07:23:34 -05:00
ArtoLord
d567c58cc1
Add -c flag to update cells subcommand (#4039)
* Add `-c` flag to `update cells` subcommand

* Fix lints
2021-09-27 21:18:50 -05:00
Squirrel
4e0d7bc77c
Less deps (#4038)
* compiles on nightly now. (breaking change)

* less deps

* Switch over to new resolver

(it's been stable for a while.)

* let's leave num-format for another PR
2021-09-28 07:17:00 +13:00
Tanishq Kancharla
2b5ef1b2d7 Removed extra file 2021-09-27 08:10:45 -04:00
Tanishq Kancharla
719920fa37 tried to move source command into parser (still doesn't compile) 2021-09-27 08:10:18 -04:00
JT
84d0e0a059 More forgiving def parse 2021-09-27 14:03:50 +13:00
JT
0a48bc973d
Merge pull request #72 from nushell/import_patterns
Add import lists
2021-09-27 13:32:36 +13:00
JT
0108a935ed add import lists 2021-09-27 13:23:22 +13:00
Jakub Žádník
9ee4dc49ee Fix wrong error span 2021-09-27 00:02:20 +03:00
JT
abb0d7bd22 Add support for module imports 2021-09-27 07:39:19 +13:00
JT
47421e9ca7
Merge pull request #69 from kubouch/simple-module
Primitive module implementation
2021-09-27 05:14:23 +13:00
Jakub Žádník
3f8f3ecf9a Fmt 2021-09-26 14:12:39 +03:00
Jakub Žádník
f57f7b2def Allow adding definitions from module into scope 2021-09-26 13:53:52 +03:00
Jakub Žádník
9e176674a5 Start parsing 'use'; Add Use command 2021-09-26 13:25:52 +03:00
Jakub Žádník
57a07385ac Add leftover Module command file 2021-09-26 13:25:37 +03:00
Jakub Žádník
12cf1a8f83 Allow adding module blocks to engine state 2021-09-26 12:12:32 +03:00
Jakub Žádník
e9f1575924 Add a module command 2021-09-26 01:59:18 +03:00
Luccas Mateus
32581497ef
Fix 90 degrees tables problem (#4043)
* fix 90 degrees tables problem

* linting

* clippy

* linting
2021-09-25 14:05:45 -05:00
JT
abac7e3795 improve table for lists 2021-09-26 07:07:37 +13:00
Fernando Herrera
d9c42eb194 contents declaration 2021-09-25 17:28:15 +01:00
Fernando Herrera
25a776c36b trim lines in command 2021-09-25 16:45:02 +01:00
Fernando Herrera
cf60f72452 table as string output 2021-09-25 15:47:23 +01:00
Jakub Žádník
a176f12c9e Start simple module parsing 2021-09-25 17:14:20 +03:00
Programming is fun
d6df367c6b
Corrected typo (#4040)
It is not BSON but SQLite
2021-09-25 04:25:00 -05:00
Patrick More
4e6327de1d
Added BigInt handling to the delimited file format for the 'to' command (#4034)
Co-authored-by: patrick <patrick@spol42069.hitronhub.home>
2021-09-25 09:47:16 +12:00
Luccas Mateus
1de7c3d033
Scraping multiple tables (#4036)
* Output error when ls into a file without permission

* math sqrt

* added test to check fails when ls into prohibited dir

* fix lint

* math sqrt with tests and doc

* trigger wasm build

* Update filesystem_shell.rs

* Fix Running echo .. starts printing integers forever

* Allow for multiple table scraping

* linting

* Fix clippy

* linting

Co-authored-by: Jonathan Turner <jonathandturner@users.noreply.github.com>
2021-09-24 08:08:13 -05:00
Fernando Herrera
767d822cbf change line format for test 2021-09-24 13:20:50 +01:00
Fernando Herrera
b4977f1515 better print out for stream output 2021-09-24 13:03:39 +01:00
JT
6c589affe7
Merge pull request #61 from elferherrera/externals
Externals with redirection
2021-09-24 10:26:38 +12:00
Fernando Herrera
cb9db792a6 filtering empty lines 2021-09-23 20:44:50 +01:00
Fernando Herrera
04990eeba4 allow collect warning 2021-09-23 20:39:42 +01:00
Fernando Herrera
772f8598dd lines command 2021-09-23 20:03:08 +01:00
Fernando Herrera
36c32e9832 input from ValueStream 2021-09-23 18:01:20 +01:00
Fernando Herrera
660e8b5b73 external with redirection 2021-09-23 17:42:03 +01:00
Kat Marchán
5d442a287f
deps: bump to miette 3.0 mainline 2021-09-22 16:50:57 -07:00
Fernando Herrera
962b258cc6
merge span (#4031) 2021-09-23 07:48:05 +12:00
JT
0ccbebee7a multiline validation 2021-09-22 17:29:53 +12:00
Kat Marchán
2553da3dc4
bump miette to fix multi-file rendering bug 2021-09-21 17:57:16 -07:00
Kat Marchán
a7ecf7af90
add magical debugging code to SourceCode impl for future debugging 2021-09-21 17:54:20 -07:00
Kat Marchán
32f39c2fb8
use miette's new panic hook 2021-09-21 12:47:52 -07:00
Kat Marchán
c87414e462
Fix issue with unexpected EOF rendering in miette 2021-09-21 09:30:43 -07:00
JT
3c18cac134 use the fancy 2021-09-21 16:10:29 +12:00
JT
4841d62d76 Add some improvements to errors 2021-09-21 16:03:06 +12:00
JT
e5aa8b9d3f
Merge pull request #52 from zkat/main
replace codespan-reporting with miette 3.0
2021-09-21 12:58:14 +12:00
Kat Marchán
a1d6cefdf8
replace codespan-reporting with miette 3.0 2021-09-20 17:14:20 -07:00
Jakub Žádník
349af05da8
Do not throw error for files not found in lib_dirs (#4029) 2021-09-20 13:44:47 -05:00
Fernando Herrera
29771c7d23 clippy errors 2021-09-20 10:42:03 +01:00
Fernando Herrera
cb0914ecb0 remove enter scope 2021-09-20 10:32:55 +01:00
Fernando Herrera
672dd5a868 external with input 2021-09-19 22:48:33 +01:00
Fernando Herrera
6731e3542d clippy errors 2021-09-19 22:05:24 +01:00
Andrés N. Robalino
5d59234f8d
Flexibility updating table's cells. (#4027)
Very often we need to work with tables (say extracted from unstructured data or some
kind of final report, timeseries, and the like).

It's inevitable we will be having columns that we can't know beforehand what their names
will be, or how many.

Also, we may end up with certain cells having values we may want to remove as we explore.

Here, `update cells` fundamentally goes over every cell in the table coming in and updates
the cell's contents with the output of the block passed. Basic example here:

```
> [

    [   ty1,       t2,       ty];

    [     1,        a, $nothing]
    [(wrap), (0..<10),      1Mb]
    [    1s,     ({}),  1000000]
    [ $true,   $false,   ([[]])]

] | update cells { describe }

───┬───────────────────────┬───────────────────────────┬──────────
 # │          ty1          │            t2             │    ty
───┼───────────────────────┼───────────────────────────┼──────────
 0 │ integer               │ string                    │ nothing
 1 │ row Column(table of ) │ range[[integer, integer)] │ filesize
 2 │ string                │ nothing                   │ integer
 3 │ boolean               │ boolean                   │ table of
───┴───────────────────────┴───────────────────────────┴──────────
```

and another one (in the examples) for cases, say we have a timeseries table generated and
we want to remove the zeros and have empty strings and save it out to something like CSV.

```
> [
    [2021-04-16, 2021-06-10, 2021-09-18, 2021-10-15, 2021-11-16, 2021-11-17, 2021-11-18];
    [        37,          0,          0,          0,         37,          0,          0]
] | update cells {|value| i
  if ($value | into int) == 0 {
    ""
  } {
    $value
  }
}

───┬────────────┬────────────┬────────────┬────────────┬────────────┬────────────┬────────────
 # │ 2021-04-16 │ 2021-06-10 │ 2021-09-18 │ 2021-10-15 │ 2021-11-16 │ 2021-11-17 │ 2021-11-18
───┼────────────┼────────────┼────────────┼────────────┼────────────┼────────────┼────────────
 0 │         37 │            │            │            │         37 │            │
───┴────────────┴────────────┴────────────┴────────────┴────────────┴────────────┴────────────
```
2021-09-19 15:37:54 -05:00
Fernando Herrera
5a6aebfcb2 clippy errors 2021-09-19 21:09:11 +01:00
Fernando Herrera
96af23f370 clippy errors 2021-09-19 20:41:35 +01:00
Fernando Herrera
bafc50fd5c external command 2021-09-19 20:29:58 +01:00
Tw
4f7b423f36
Support completion when cursor inside an argument (#4023)
* Support completion when cursor inside an argument

Bash supports completion even when cursor is in an argument, this is very useful for some fixup after the initial completion.
Let add this feature as well.

Signed-off-by: Tw <wei.tan@intel.com>

* Add test for when cursor inside an argument

To support test this case, let's also take the position into account.

Signed-off-by: Tw <wei.tan@intel.com>
2021-09-19 17:23:05 +12:00
Tom Panton
f7043bf690
Fix #3090: let binding in command leaks when error occurs (#4022) 2021-09-19 14:57:20 +12:00
Tw
1297499d7a
add command g to switch shell quickly (#4014)
Signed-off-by: Tw <tw19881113@gmail.com>
2021-09-17 10:39:14 +01:00
Darren Schroeder
bd0baa961c
add table selector for downloading web tables (#4004)
* add table selector for downloading web tables

* type-o

* updated debug mode to inspect mode
2021-09-16 09:02:30 -05:00
JT
8581bec891
bump 0.37.1 (#4019) 2021-09-16 13:32:22 +12:00
Jakub Žádník
8bcbc8eeb3
Move nu-path tests to integration tests (#4015)
* Move nu-path tests to integration tests

To prevent circular dependency between nu-path and nu-test-support crates.

* Fmt
2021-09-16 07:11:28 +12:00
Fernando Herrera
c164ef5489
Update to polars 0.16 (#4013)
* update to polars 0.16

* enabled features for polars
2021-09-16 07:10:12 +12:00
Jakub Žádník
cc3653cfd9
Path commands: Put column path args behid flag; Allow path join appending without flag (#4008)
* Change path join signature

* Appending now works without flag
* Column path operation is behind a -c flag

* Move column path arg retrieval to a function

Also improves errors

* Fix path join tests

* Propagate column path changes to all path commands

* Update path command examples with columns paths

* Modernize path command examples by removing "echo"

* Improve structured path error message

* Fix typo
2021-09-15 21:03:51 +03:00
JT
7fc65067cf
Temporarily remove the circular dep (#4009) 2021-09-15 09:17:31 +12:00
JT
1d80a68f4c
bump to 0.37 (#4006) 2021-09-15 06:44:24 +12:00
Fernando Herrera
1a9247b77f Merge branch 'main' of https://github.com/nushell/engine-q into externals 2021-09-14 07:19:31 +01:00
JT
b4f918b889 Very early proof-of-concept git branch completion 2021-09-14 16:59:46 +12:00
Fernando Herrera
fda69354db
change name to command_prompt (#4003) 2021-09-14 08:02:10 +12:00
Fernando Herrera
7aa1d8ac2a error check on def and alias 2021-09-13 20:59:11 +01:00
JT
d7a3c7522b Fix test 2021-09-13 20:19:05 +12:00
JT
4dfde7393b Merge branch 'main' into block_param_types 2021-09-13 19:59:18 +12:00
JT
32c1f0c8d4 better it detection and block params in shapes 2021-09-13 19:54:13 +12:00
JT
eb67eab122 WIP 2021-09-13 19:31:11 +12:00
JT
d88e46d2d1
Merge pull request #45 from kubouch/left-unbounded-ranges
Allow parsing left-unbounded range (..10)
2021-09-13 05:01:07 +12:00
JT
caa6236f1f
Merge pull request #44 from kubouch/float-ranges
Floating point ranges
2021-09-13 04:59:51 +12:00
JT
f459f77335
Merge pull request #40 from elferherrera/parse-error
Parse errors for def, let and alias
2021-09-13 04:58:25 +12:00
Fernando Herrera
66c58217af change message 2021-09-12 16:36:16 +01:00
Fernando Herrera
8f07f40f22 external call 2021-09-12 16:34:43 +01:00
Jakub Žádník
e6a2e27e33 Fix failing compilation after rebase 2021-09-12 15:57:49 +03:00
Jakub Žádník
8577d3ff41 Check for left-unbounded range before external cmd 2021-09-12 15:56:58 +03:00
Jakub Žádník
78054a5352 Allow parsing left-unbounded range (..10)
It is implemented as a preliminary check when parsing a call and relies
on a fact that a token that successfully parses as a range is unlikely
to be a valid path or command name.
2021-09-12 15:56:58 +03:00
Jakub Žádník
ce0b5bf4ab Add test for float ranges 2021-09-12 15:36:54 +03:00
Jakub Žádník
9936946eb5 Fmt 2021-09-12 14:58:32 +03:00
Jakub Žádník
013b12a864 Do not allow precision interval to rach < epsilon 2021-09-12 14:55:11 +03:00
Jakub Žádník
2f04c172fe Add floating point support for ranges 2021-09-12 14:12:53 +03:00
Jakub Žádník
cc5c4d38bb
Small fixes and refactors to paths & source command (#3998)
* Expand path when converting value -> PathBuf

Also includes Tagged<PathBuf>.

Fixes #3605

* Expand path for PATH env. variable

Fixes #1834

* Remove leftover Cows after nu-path refactor

There were some unnecessary Cow conversions leftover from the old
nu-path implementation.

* Use canonicalize in source command; Improve errors

Previously, `source` used `expand_path()` which does not follow
symlinks.

As a follow up, I improved the source error messages so they now tell
why the source file could not be canonicalized or read into string.
2021-09-12 02:36:14 +03:00
JT
648fe052db Merge branch 'main' into wip 2021-09-12 09:26:47 +12:00
JT
55aa70c88a WIP 2021-09-12 09:26:35 +12:00
Fernando Herrera
9c98783917 clippy correcgtions 2021-09-11 13:16:40 +01:00
Fernando Herrera
4b8ba29cdb check for = before internal parsing 2021-09-11 13:07:19 +01:00
Jakub Žádník
4749776984 Add stepping to ranges & enable reverse ranges
Follows the following syntax: <start>..<next-value>..<end>
2021-09-11 14:28:46 +03:00
Fernando Herrera
47ee50072e Merge branch 'main' of https://github.com/nushell/engine-q into parse-error 2021-09-11 08:26:29 +01:00
Fernando Herrera
198c884158 change name in error 2021-09-11 08:22:41 +01:00
Tanishq Kancharla
1d945d8ce3 added source command 2021-09-11 00:54:24 -04:00
JT
bfd05772ef Improve completions inside of a pipeline 2021-09-10 20:07:18 +12:00
Fernando Herrera
9a16a8fd06 corrected error check 2021-09-10 08:44:31 +01:00
Fernando Herrera
2ea19aeac0 Merge branch 'main' of https://github.com/nushell/engine-q into parse-error 2021-09-10 08:28:58 +01:00
Fernando Herrera
0794ebf5fa error parsing for def, alias and let 2021-09-10 08:28:43 +01:00
JT
26d50ebcd5 Add a very silly table 2021-09-10 14:27:12 +12:00
JT
0fa0c25fb3
Fix clippy warnings (#3997) 2021-09-10 13:13:11 +12:00
JT
c1194b3d1e Add a very silly ls 2021-09-10 13:09:54 +12:00
JT
16baf5e16a Add a very silly ls 2021-09-10 13:06:44 +12:00
Tom Panton
55eafadf02
Improve error message when bash-style alias syntax is mistakenly used (#3995) 2021-09-10 10:44:55 +12:00
Marcin Puc
51c74eebd0
Add general refactorings (#3996) 2021-09-10 10:44:22 +12:00
JT
abda6f148c Finish up completions 2021-09-10 10:09:40 +12:00
JT
bb6781a3b1 Add row conditions 2021-09-10 09:47:20 +12:00
JT
2d7192e390 Add parser README, some parser fixups 2021-09-09 06:54:27 +12:00
Tanishq Kancharla
d35a58e05c Remove unused imports 2021-09-07 22:32:28 -04:00
Tanishq Kancharla
ecbe7bf8d7 move value into its own folder 2021-09-07 22:26:57 -04:00
JT
6dd9f05ea1 Add an experimental record iteration 2021-09-08 10:00:20 +12:00
JT
a8646f94ab Add cell paths for streams 2021-09-07 19:35:59 +12:00
JT
b0ab78a767 Switch tables to list/streams of records 2021-09-07 19:07:11 +12:00
JT
e00da070fd Fail more gently for bad list/table parses 2021-09-07 15:56:30 +12:00
JT
bdce34676a Allow rest vars to have a custom name 2021-09-07 15:37:02 +12:00
JT
3b7d7861e3 Add cell paths 2021-09-07 10:02:24 +12:00
Fernando Herrera
f7a19d37c6 one parser function 2021-09-06 21:41:30 +01:00
JT
4ce9a5c894 Make variable assignment convert streams to full values 2021-09-07 06:05:46 +12:00
JT
a1f7a3c17b improve int division to be more nushell-like 2021-09-06 17:35:58 +12:00
JT
3b99ce71a0 add simple value iteration 2021-09-06 16:16:32 +12:00
JT
96b0edf9b0 range iteration 2021-09-06 16:07:48 +12:00
JT
979faf853a Block params 2021-09-06 14:20:02 +12:00
JT
aaee3a8b61 WIP 2021-09-06 11:16:27 +12:00
Fernando Herrera
b3d287815d updated dependencies 2021-09-05 20:06:57 +01:00
JT
57677a50b5 Fix #15 2021-09-06 06:44:18 +12:00
JT
6ebc97dec2
Update parser.rs 2021-09-06 06:09:36 +12:00
Jakub Žádník
56c8987e0f Add '.' and '-' to restricted characters
This means that commands cannot start with these characters.
However, we get the following benefits:
* Negative numbers               > -10
* Ranges with negative numbers   > -10..-1
* Left-unbounded ranges          > ..10
2021-09-05 20:33:53 +03:00
Jakub Žádník
7ae4ca88b6 "Fix" failing CI 2021-09-05 11:03:04 +03:00
Jakub Žádník
f0d469f1d4 Fix clippy warnings 2021-09-05 01:40:15 +03:00
Jakub Žádník
6b4fee88c9 Fmt 2021-09-05 01:35:08 +03:00
Jakub Žádník
672fa852b3 Add some tests to range parsing 2021-09-05 01:25:31 +03:00
Jakub Žádník
0b412cd6b3 Add support for positive integer ranges
Including support for variables and subexpressions as range bounds.
2021-09-05 00:52:57 +03:00
Tw
ae9f4135c0
support appending when saving file (#3992)
This patch implements `>>` operation in bash.

Signed-off-by: Tw <tw19881113@gmail.com>
2021-09-05 06:12:08 +12:00
Fernando Herrera
d6b1ff932a Merge branch 'main' of https://github.com/jonathandturner/engine-q into similar-name 2021-09-04 09:20:35 +01:00
JT
26b1f022b7 fixup 2021-09-04 20:19:07 +12:00
Fernando Herrera
ab307c8d38 Merge branch 'main' of https://github.com/jonathandturner/engine-q into similar-name 2021-09-04 09:10:38 +01:00
Fernando Herrera
a3d4794341 moved test to protocol 2021-09-04 09:10:31 +01:00
JT
25c7d8ead6
Merge pull request #13 from jntrnr/ci
Add CI
2021-09-04 20:09:05 +12:00
JT
d9cff4238d clippy 2021-09-04 19:59:38 +12:00
Fernando Herrera
ca8d311c78 Merge branch 'main' of https://github.com/jonathandturner/engine-q into similar-name 2021-09-04 08:45:55 +01:00
Fernando Herrera
acc035dbef signature check for similar name 2021-09-04 08:45:49 +01:00
JT
5e33b8536b Add discrete list/table 2021-09-04 18:52:28 +12:00
JT
74bb2af3e1 Fix up block parse recovery 2021-09-04 08:58:44 +12:00
JT
b20c4047d4 Some cleanup, better subexpressions 2021-09-03 19:35:29 +12:00
Andrés N. Robalino
4e2d3ceaaf
Allow knowing the command name tag given no input. (#3988)
```
tags
```
2021-09-03 01:46:15 -05:00
JT
82cf6caba4 Add do 2021-09-03 16:01:45 +12:00
JT
bc3f820227
Merge pull request #10 from jntrnr/value_streams_in_value
Value streams in value
2021-09-03 15:49:27 +12:00
JT
12d80c2732 Fix test 2021-09-03 15:49:14 +12:00
JT
6c0ce95d0f Add simple each 2021-09-03 15:45:34 +12:00
JT
750502c870 Fix up for_in 2021-09-03 14:57:18 +12:00
JT
df63490266 Fix up calls and pipelines 2021-09-03 14:15:01 +12:00
Andrés N. Robalino
c9c6bd4836
Create errors from tables. (#3986)
```
> [
  [          msg,                 labels,                      span];
  ["The message", "Helpful message here", ([[start, end]; [0, 141]])]
] | error make

error: The message
  ┌─ shell:1:1
  │
1 │ ╭ [
2 │ │   [          msg,                 labels,                      span];
3 │ │   ["The message", "Helpful message here", ([[start, end]; [0, 141]])]
  │ ╰─────────────────────────────────────────────────────────────────────^ Helpful message here
```

Adding a more flexible approach for creating error values. One use case, for instance is the
idea of a test framework. A failed assertion instead of printing to the screen it could create
tables with more details of the failed assertion and pass it to this command for making a full
fledge error that Nu can show. This can (and should) be extended for capturing error values as well
in the pipeline. One could also use it for inspection.

For example: `.... | error inspect { # inspection here }`

or "error handling" as well, like so: `.... | error capture { fix here }`

However, we start here only with `error make` that creates an error value for you with limited support for the time being.
2021-09-02 21:07:26 -05:00
Lily Mara
d90420ac4c
Add subcommand into filesize (#3987)
* Add subcommand `into filesize`

It's currently not possible to convert a number or a string containing a number
into a filesize. The only way to create an instance of filesize type today is
with a literal in nushell syntax. This commit adds the `into filesize`
subcommand so that file sizes can be created from the outputs of programs
producing numbers or strings, like standard unix tools.

There is a limitation with this - it doesn't currently parse values like `10 MB`
or `10 MiB`, it can only look at the number itself. If the desire is there, more
flexible parsing can be added.

* fixup! Add subcommand `into filesize`

* fixup! Add subcommand `into filesize`
2021-09-02 18:19:54 -05:00
JT
7c8504ea24 Add commands 2021-09-03 10:58:15 +12:00
JT
94687a7603 Back to working state 2021-09-03 06:21:37 +12:00
JT
e1be8f61fc WIP 2021-09-02 20:25:22 +12:00
JT
3d252a9797 Add nu-protocol 2021-09-02 13:29:43 +12:00
JT
c4c4d82bf4 Try putting streams in Value 2021-09-02 09:20:53 +12:00
Fernando Herrera
4ed79614ac removed unused empty function 2021-09-01 21:34:16 +01:00
Fernando Herrera
73f6a57b12 upper comments get attached to command 2021-09-01 21:05:37 +01:00
Amin Yahyaabadi
260ff99710
feat: spawn the executables directly if possible (#3974)
* feat: spawn the executables directly if possible

This pull request changes nu-command so that it spawns the process directly if:
- They are a `.exe` on Windows
- They are not a `.sh` or `.bash` on not windows.

Benefits:
- As I explained in [this comment](https://github.com/nushell/nushell/issues/3898#issuecomment-894000812), this is another step towards making Nushell a standalone shell, that doesn't need to shell out unless it is running a script for a particular shell (cmd, sh, ps1, etc.).
- Fixes the bug with multiline strings
- Better performance due to direct spawning.

For example, this script shows ~20 ms less latency.
After:
```nu
C:\> benchmark { node -e 'console.log("sssss")' }
───┬──────────────────
 # │    real time
───┼──────────────────
 0 │ 63ms 921us 600ns
───┴──────────────────
```
Before
```nu
C:\> benchmark { node -e 'console.log("sssss")' }
───┬──────────────────
 # │    real time
───┼──────────────────
 0 │ 79ms 136us 800ns
───┴──────────────────
```

Fixes #3898

* fix: make which dependency optional

Also fixes clippy warnings

* refactor: refactor spawn_exe, spawn_cmd, spawn_sh, and spawn_any

* fix: use which feature instead of which-support

* fix: use which_in to use the cwd of nu

* fix: use case insensitive comparison of the extensions

Sometimes the case of the extension is uppercased by the "which_in" function

Also use unix instead of not windows. Some os might not have sh support
2021-09-01 09:38:52 -05:00
JT
08014c6a98
Move sys, ps, fetch, post to internal commands (#3983)
* Move sys, ps, fetch, post to internal commands

* Remove old plugins

* clippy

Co-authored-by: JT <jonatha.d.turner@gmail.com>
2021-09-01 14:29:09 +12:00
Fernando Herrera
5da2ab1b7d comments with a newline dont get together 2021-08-31 20:33:41 +01:00
JT
d0be193307
Merge pull request #7 from elferherrera/tests
Tests for lex and lite parser
2021-08-31 12:07:46 +12:00
Fernando Herrera
b3fb106cce tests for lex and lite parser 2021-08-30 19:36:07 +01:00
Darren Schroeder
66cedf0b3a
Update char_.rs (#3975)
added a few more chars and abbreviations
2021-08-29 08:40:28 -05:00
Darren Schroeder
707a4ebc15
added more escapes to support ansi art (#3973)
* added more escapes to support ansi art

* fixed some bugs
2021-08-28 14:58:59 -05:00
JT
46d2efca13 Fix table parsing 2021-08-29 07:17:30 +12:00
Jakub Žádník
d95375d494
nu-path crate refactor (#3730)
* Resolve rebase artifacts

* Remove leftover dependencies on removed feature

* Remove unnecessary 'pub'

* Start taking notes and fooling around

* Split canonicalize to two versions; Add TODOs

One that takes `relative_to` and one that doesn't.
More TODO notes.

* Merge absolutize to and rename resolve_dots

* Add custom absolutize fn and use it in path expand

* Convert a couple of dunce::canonicalize to ours

* Update nu-path description

* Replace all canonicalize with nu-path version

* Remove leftover dunce dependencies

* Fix broken autocd with trailing slash

Trailing slash is preserved *only* in paths that do not contain "." or
"..". This should be fixed in the future to cover all paths but for now
it at least covers basic cases.

* Use dunce::canonicalize for canonicalizing

* Alow cd recovery from non-existent cwd

* Disable removed canonicalize functionality tests

Remove unused import

* Break down nu-path into separate modules

* Remove unused public imports

* Remove abundant cow mapping

* Fix clippy warning

* Reformulate old canonicalize tests to expand_path

They wouldn't work with the new canonicalize.

* Canonicalize also ~ and ndots; Unify path joining

Also, add doc comments in nu_path::expansions.

* Add comment

* Avoid expanding ndots if path is not valid UTF-8

With this change, no lossy path->string conversion should happen in the
nu-path crate.

* Fmt

* Slight expand_tilde refactor; Add doc comments

* Start nu-path integration tests

* Add tests TODO

* Fix docstring typo

* Fix some doc strings

* Add README for nu-path crate

* Add a couple of canonicalize tests

* Add nu-path integration tests

* Add trim trailing slashes tests

* Update nu-path dependency

* Remove unused import

* Regenerate lockfile
2021-08-28 15:59:09 +03:00
Markus Westerlind
1c1c58e802
Remove duplicate dependencies (#3961)
* chore: Replace surf with reqwest

Removes a lot of older, duplication versions of some dependencies
(roughtly 90 dependencies removed in total)

* chore: Remove syn 0.11

* chore: Remove unnecessary features from ptree

Removes some more duplicate dependencies

* cargo update

* Ensure we run the fetch and post plugins on the tokio runtime

* Fix clippy warning

* fix: Github requires a user agent on requests

Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
2021-08-28 15:34:11 +12:00
JT
7fe05b8296
bump to 0.36.1 (#3972) 2021-08-27 20:48:58 +12:00
Darren Schroeder
17ef531905
introducing the find command (#3971)
* introducing the `find` command

* added tests

* merged main to accomodate "rest" changes

* test fix
2021-08-27 20:48:41 +12:00
JT
24cd1b591c Update todo 2021-08-27 14:30:10 +12:00
JT
bb9e6731ea More parsing fixes with tests 2021-08-27 11:44:08 +12:00
JT
5dd5a89775 Fix condition parsing for if 2021-08-27 09:48:27 +12:00
Hristo Filaretov
b8e2bdd6b1
Allow different names for ...rest (#3954)
* Allow different names for ...rest

* Resolves #3945

* This change requires an explicit name for the rest argument in `WholeStreamCommand`,
  which is why there are so many changed files.

* Remove redundant clone

* Add tests
2021-08-27 05:58:53 +12:00
Hristo Filaretov
88817a8f10
Allow environment variables to be hidden (#3950)
* Allow environment variables to be hidden

This change allows environment variables in Nushell to have a value of
`Nothing`, which can be set by the user by passing `$nothing` to
`let-env` and friends.

Environment variables with a value of Nothing behave as if they are not
set at all. This allows a user to shadow the value of an environment
variable in a parent scope, effectively removing it from their current
scope. This was not possible before, because a scope can not affect its
parent scopes.

This is a workaround for issues like #3920.

Additionally, this allows a user to simultaneously set, change and
remove multiple environment variables via `load-env`. Any environment
variables set to $nothing will be hidden and thus act as if they are
removed. This simplifies working with virtual environments, which rely
on setting multiple environment variables, including PATH, to specific
values, and remove/change them on deactivation.

One surprising behavior is that an environment variable set to $nothing
will act as if it is not set when querying it (via $nu.env.X), but it is
still possible to remove it entirely via `unlet-env`. If the same
environment variable is present in the parent scope, the value in the
parent scope will be visible to the user. This might be surprising
behavior to users who are not familiar with the implementation details.

An additional corner case is the the shorthand form of `with-env` does
not work with this feature. Using `X=$nothing` will set $nu.env.X to the
string "$nothing". The long-form works as expected: `with-env [X
$nothing] {...}`.

* Remove unused import

* Allow all primitives to be convert to strings
2021-08-26 08:15:58 -05:00
Fernando Herrera
3e8ce43dcb
rename command and rename for melt (#3968) 2021-08-26 08:13:54 -05:00
Andrés N. Robalino
9d8845d7ad
Allow custom lib dir path for sourcing nu script libraries. (#3940)
Given we can write nu scripts. As the codebase grows, splitting into many smaller nu scripts is necessary.

In general, when we work with paths and files we seem to face quite a few difficulties. Here we just tackle one of them and it involves sourcing
files that also source other nu files and so forth. The current working directory becomes important here and being on a different directory
when sourcing scripts will not work. Mostly because we expand the path on the current working directory and parse the files when a source command
call is done.

For the moment, we introduce a `lib_dirs` configuration value and, unfortunately, introduce a new dependency in `nu-parser` (`nu-data`) to get
a handle of the configuration file to retrieve it. This should give clues and ideas as the new parser engine continues (introduce a way to also know paths)

With this PR we can do the following:

Let's assume we want to write a nu library called `my_library`. We will have the code in a directory called `project`: The file structure will looks like this:

```
project/my_library.nu
project/my_library/hello.nu
project/my_library/name.nu
```

This "pattern" works well, that is, when creating a library have a directory named `my_library` and next to it a `my_library.nu` file. Filling them like this:

```

source my_library/hello.nu
source my_library/name.nu
```

```

def hello [] {
  "hello world"
}
```

```

def name [] {
  "Nu"
end
```

Assuming this `project` directory is stored at `/path/to/lib/project`, we can do:

```
config set lib_dirs ['path/to/lib/project']
```

Given we have this `lib_dirs` configuration value, we can be anywhere while using Nu and do the following:

```
source my_library.nu

echo (hello) (name)

```
2021-08-26 02:04:04 -05:00
JT
35c3622405 Add a few operators. Needs parser work 2021-08-26 07:29:36 +12:00
JT
991a4801b1
Bump to 0.36 (#3963) 2021-08-25 06:01:17 +12:00
Fernando Herrera
02b2c55146
Rolling and cumulative commands (#3960)
* rolling and cumulative operations

* update polars to 0.15.1

* change reference in function
2021-08-24 09:10:29 -05:00
JT
487fafbca3
Add a 'tutor' command (#3949)
* Add a 'tutor' command

* clippy
2021-08-21 19:41:54 +12:00
Darren Schroeder
188a352c6f
added help --find to search usage and extra_usage text for strings (#3948)
* added help --find to search usage and extra_usage text for strings

* changed my mind
2021-08-20 17:55:56 -05:00
Jakub Žádník
e11b400a75
Allow source to accept paths with emojis (#3939)
* Allow sourcing paths with emojis

* Add source command tests for emoji paths

* Fmt

* Disable source tests on Windows with illegal paths

* Test sourcing also ASCII and single-quoted paths
2021-08-19 19:06:18 +12:00
Hristo Filaretov
6db5692be4
Only allow unaliasing in current scope, add tests (#3936)
* unalias only removes aliases in the current scope

* Add a test and fix previous ones which did not function as expected
2021-08-19 19:05:36 +12:00
JT
ead4029d49
Bump rustyline and add unalias test (#3935) 2021-08-18 05:55:34 +12:00
soumil-07
9bd408449e
Add the ability to remove and list aliases (#3879)
* Add the ability to remove and list aliases

* Fix failing unit tests

* Add a test to check unalias shadowing blocks
2021-08-17 08:56:35 -05:00
JT
739425431a improve type inference 2021-08-17 12:26:05 +12:00
JT
dda6554990 Fix up subcommand alias colours 2021-08-17 11:04:45 +12:00
JT
2f43cc353b Fix some expects, add subcommand alias 2021-08-17 11:00:00 +12:00
Nathan
ab961a78cb
Add trailing slash in completion of symlinked dir (#3921) 2021-08-17 07:13:59 +12:00
Darren Schroeder
65c639cf13
allow fetch to follow redirects (#3923) 2021-08-16 12:31:02 -05:00
Erik Post
0cf5dc11e3
Fix 'Inimplemented' typo. (#3922) 2021-08-16 09:17:31 -05:00
JT
ceea7e5aeb Remove lifetime from eval state 2021-08-16 14:30:31 +12:00
JT
579814895d Fix up eval params and refactor 2021-08-16 10:33:34 +12:00
Andrés N. Robalino
b873fa7a5f
The zip command. (#3919)
We introduce it here and allow it to work with regular lists (tables with no columns) as well as symmetric tables. Say we have two lists and wish to zip them, like so:

```
[0 2 4 6 8] | zip {
  [1 3 5 7 9]
} | flatten

───┬───
 0 │ 0
 1 │ 1
 2 │ 2
 3 │ 3
 4 │ 4
 5 │ 5
 6 │ 6
 7 │ 7
 8 │ 8
 9 │ 9
───┴───
```

In the case for two tables instead:

```
[[symbol]; ['('] ['['] ['{']] | zip {
  [[symbol]; [')'] [']'] ['}']]
} | each {
  get symbol | $'($in.0)nushell($in.1)'
}

───┬───────────
 0 │ (nushell)
 1 │ [nushell]
 2 │ {nushell}
───┴───────────
```
2021-08-14 23:36:08 -05:00
Fernando Herrera
ee563ecf4e
PROMPT_STRING env variable (#3918)
* prompt string env variable

* cargo clippy
2021-08-15 06:14:14 +12:00
Lily Mara
183b35d683
Rustyline bug fixes (#3916)
* Mitigate history file bug in Rustyline

Rustyline's duplicate ignoring code has a bug that can cause data loss and
history file corruption. Testing seems to indicate that disabling this behavior
and allowing duplicates will prevent the bug from showing up. Many people have
complained about this issue, I think it is worthwhile to fix the bug at the cost
of permitting duplicate history entries.

Upstream bug: https://github.com/kkawakam/rustyline/issues/559

* Increase Rustyline historyfile limit

Rustyline will only store 100 history items by default. This is quite a small
limit for a shell that people use as a daily driver. Especially when the
deduplication code is removed, we will hit that limit quickly and start to lose
history. This commit bumps the limit up to 10k. We can discuss if this is an
inappropriate limit or if we should allow users to specify this setting in their
nushell config file instead.
2021-08-14 06:56:28 +12:00
Andrés N. Robalino
463dd48180
Flexible dropping of rows (by desired row number) (#3917)
We very well support `nth 0 2 3 --skip 1 4` to select particular rows and skip some using a flag. However, in practice we deal with tables (whether they come from parsing or loading files and whatnot) where we don't know the size of the table up front (and everytime we have these, they may have different sizes). There are also other use cases when we use intermediate tables during processing and wish to always drop certain rows and **keep the rest**.

Usage:

```
... | drop nth 0
... | drop nth 3 8
```
2021-08-13 12:48:05 -05:00
JT
1355a5dd33 refactor to subcrates 2021-08-11 06:51:08 +12:00
hedonihilist
c9b87c4c03
Count the size of the directories when calculating the size in DirInfo (#3902)
* take dir entry size into consideration when calculting the size of a directory in DirInfo

* fmt check
2021-08-08 05:50:02 +12:00
Fernando Herrera
38848082ae
describe command (#3907) 2021-08-08 05:48:54 +12:00
JT
b6728efcd4
in/not-in for strings (#3906) 2021-08-07 09:49:37 +12:00
soumil-07
cd814851da
Use bigdecimal-rs patch (#3905)
* Use bigdecimal-rs patch

* fix nu-serde's bigdecimal dependency
2021-08-07 09:27:19 +12:00
soumil-07
6646daab45
source config from $NU_CONFIG_DIR if it exists (#3883) 2021-08-06 11:47:11 -05:00
Lily Mara
ba483155d7
Reimplement parsers with nu-serde (#3880)
The nu-serde crate allows us to become much more generic with respect to how we
convert output to `nu-protocol::Value`s. This allows us to remove a lot of the
special-case code that we wrote for deserializing JSON values.

Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
2021-08-06 11:46:19 -05:00
Fernando Herrera
63abe1cb3e
Datetime commands (#3894)
* date and duration from nu

* date commands

* Import to feature flag

* corrected to-csv example

* corrected sample example
2021-08-05 17:18:53 -05:00
Peter Cunderlik
7dcc08985c
Implement PartialEq for ReturnSuccess (#3888)
This makes ReturnValue and ReturnSuccess usable in assert_eq!.
2021-08-05 14:55:41 +12:00
Waldir Pimenta
325f45fa66
Fix typo: patter → pattern (#3890) 2021-08-03 18:48:23 -05:00
JT
bc682066d8
Bump to 0.35 (#3884) 2021-08-03 20:01:09 +12:00
Lily Mara
0a1cdc5107
Add the nu-serde crate (#3878)
* Add the nu-serde crate

nu-serde is a crate that can be used to turn a value implementing
`serde::Serialize` into a `nu-protocol::Value`. This has the potential to
significantly simplify plugin authorship.

This crate was the previously independent
[serde-nu](https://github.com/lily-mara/serde-nu) but the nushell maintainers
expressed an interest in having it added to the mainline nushell repository.

* fixup! Add the nu-serde crate
2021-07-31 22:03:13 -05:00
Fernando Herrera
6984185e61
Better representation in nested dataframes (#3875)
* better dataframe representation in nested df

* Error message correction
2021-07-31 09:02:32 -05:00
Fernando Herrera
5826126284
simple contains arguments (#3874) 2021-07-31 09:01:05 -05:00
Lily Mara
762e528ec5
Support equals sign in shorthand environment variable values (#3869)
Some environment variables, such as `RUST_LOG` include equals signs. Nushell
should support this in the shorthand environment variable syntax so that
developers using these variables can control them easily. We accomplish this by
swapping `std::str::split` for `std::str::splitn`, which ensures that we only
consider the first equals sign in the string instead of all of them, which we
did previously.

Closes #3867
2021-07-31 09:10:28 +12:00
JT
c3de9848b4
Revert "Unify use of the surf crate (#3855)" (#3871)
This reverts commit 7f7af2bbaa.
2021-07-31 09:04:01 +12:00
Peter Cunderlik
370ae8c20c
Add support for mult-doc YAML files (#3870)
Single doc YAML files are returned as before. Multi-doc YAML files are
wrapped in an outer Table. Empty YAML files return Nothing.
2021-07-30 15:45:19 -05:00
Joel Afriyie
69083bfca0
Adding parse fix for power operator error on negative integers and de… (#3821)
* Adding parse fix for power operator error on negative integers and decimal

* Adding correct formatting

* Changed is negative check to follow conventions

* Adding tests

* Added fix for the negatives and added tests

* Removed comments
2021-07-30 07:08:57 -05:00
Darren Schroeder
1e15f26e98
fix interpolated strings when using unicode (#3866)
* fix interpolated strings when using unicode

* added test case
2021-07-29 19:07:34 -05:00
Darren Schroeder
23ba01d89c
add performance metrics for measuring startup time (#3854)
* add performance metrics for measureing startup time

* removed some comments

* update so tests pass

* update default.toml for tests, merged main

* fix clippy lints

* wording changes
2021-07-29 18:52:40 -05:00
Fernando Herrera
653cbe651f
Going deeper (#3864)
* nuframe in its own type in UntaggedValue

* Removed eager dataframe from enum

* Dataframe created from list of values

* Corrected order in dataframe columns

* Returned tag from stream collection

* Removed series from dataframe commands

* Arithmetic operators

* forced push

* forced push

* Replace all command

* String commands

* appending operations with dfs

* Testing suite for dataframes

* Unit test for dataframe commands

* improved equality for dataframes

* moving all dataframe operations to protocol

* objects in dataframes

* Removed cloning when converting to row
2021-07-30 09:16:30 +12:00
JT
f3e487e829
Add named positionals to all (#3863) 2021-07-30 09:12:24 +12:00
JT
e602647d4d
Fix clippy lint and disable broken lint (#3865) 2021-07-30 08:11:47 +12:00
Peter Cunderlik
9696e4d315
Improve md5 and sha256 code (#3841)
* Refactor Hash code to simplify md5 and sha256 implementations

Md5 and Sha256 (and other future digests) require less boilerplate code
now. Error reporting includues the name of the hash again.

* Add missing hash sha256 test
2021-07-29 10:22:16 -05:00
Daniel Egger
7f7af2bbaa
Unify use of the surf crate (#3855)
This brings the features used by the `nu_plugin_fetch` and
`nu_plugin_post` in line and drops the default-features, reducing
the number of pulled-in dependencies and avoiding a second round of
compilations.

Retry of #3777 but with different features, post and fetch plugin tested

Signed-off-by: Daniel Egger <daniel@eggers-club.de>
2021-07-29 19:26:38 +12:00
Peter Cunderlik
b190051e15
Fix select to insert nulls in sparse tables instead of ignoring absent values (#3857)
Select used to ignore absent values resulting in "squashing" where
columns for multiple rows could be squashed into a single row.

This fixes the problem by inserting null/nothing into absent value, thus
preserving the structure of rows. This makes sure that all selected
columns are present in each row.
2021-07-28 16:39:42 -05:00
Fernando Herrera
83b28cad8d
Remove dependencies (#3853)
* nuframe in its own type in UntaggedValue

* Removed eager dataframe from enum

* Dataframe created from list of values

* Corrected order in dataframe columns

* Returned tag from stream collection

* Removed series from dataframe commands

* Arithmetic operators

* forced push

* forced push

* Replace all command

* String commands

* appending operations with dfs

* Testing suite for dataframes

* Unit test for dataframe commands

* improved equality for dataframes

* moving all dataframe operations to protocol
2021-07-27 14:20:06 -05:00
Darren Schroeder
e4c282f0a6
added the ability to compare time units like 1hr < 2hr (#3845) 2021-07-26 15:19:32 -05:00
Fernando Herrera
d54d7cc431
append dataframes (#3839) 2021-07-26 08:36:09 +12:00
Peter Cunderlik
111477aa74
Add sha256 to the hash command (#3836)
Hashers now uses on Rust Crypto Digest trait which makes it trivial to
implement additional hash functions.

The original `md5` crate does not implement the Digest trait and was
replaced by `md-5` crate which does. Sha256 uses already included `sha2`
crate.
2021-07-25 14:08:08 -05:00
JT
226739d13f
Bump to 0.34.1 (#3835) 2021-07-25 22:58:33 +12:00
Fernando Herrera
f1ee9113ac
All is a DataFrame (#3812)
* nuframe in its own type in UntaggedValue

* Removed eager dataframe from enum

* Dataframe created from list of values

* Corrected order in dataframe columns

* Returned tag from stream collection

* Removed series from dataframe commands

* Arithmetic operators

* forced push

* forced push

* Replace all command

* String commands

* appending operations with dfs

* Testing suite for dataframes

* Unit test for dataframe commands

* improved equality for dataframes
2021-07-25 22:01:54 +12:00
Kat Marchán
9120a64cfb
use chrono_humanize for datetime formatting (#3834)
* use chrono_humanize for datetime formatting

* fix tests
2021-07-25 20:38:45 +12:00
Kat Marchán
fcd624a722
add date humanize command (#3833)
* add `date humanize` command

* add docs
2021-07-25 17:33:31 +12:00
soumil-07
e6af7f75a1
Read from standard input in rm (#3763)
* Read from standard input in `rm`

With this change, rm falls back to reading from the standard input if no
arguments are supplied. This leads to more intuitive pipes as seen in
https://github.com/nushell/nushell/issues/2824

 ls | get name | sort-by | first 20 | each {rm $it} becomes
 ls | get name | sort-by | first 20 | rm

* [Fix] Run cargo fmt, make files a rest parameter, and fix cargo build warnings

* [Fix] Fix clippy suggestions
2021-07-25 15:01:53 +12:00
Darren Schroeder
27f1e7b60c
change describe so it doesn't output colored strings (#3832) 2021-07-25 06:34:11 +12:00
Jakub Žádník
2e24de7f47
Support other variables than PATH in pathvar (2nd attempt) (#3828)
* Fix swapped PATH env var separators

* Support pathvar to manipulate other vars than PATH

* Add tests for pathvar and its subcommands

* Adjust pathvar tests to comply with env quirks

* Make pathvar tests work on non-Windows as well

* Compact the comments in pathvar tests

* Fix last failing test

Co-authored-by: Jakub Žádník <jakub.zadnik@tuni.fi>
2021-07-24 11:44:36 -05:00
Nathan Thomas
e514204db0
Fix wrong path separator (#3829) 2021-07-24 08:42:50 -05:00
Darren Schroeder
0f9e55dac6
Revert "Support other variables than PATH in pathvar (#3791)" (#3827)
This reverts commit f9f39c0a1c.
2021-07-23 09:03:28 -05:00
Peter Cunderlik
5d7677dd07
Implement into path conversion (#3811)
This allows converting strings to filepaths without having to use
`path expand` roundtrip.

Filepaths are taken as-is without any validation/conversion.
2021-07-23 19:14:02 +12:00
Sam Bordo
57073cc6cf
port capitalize to engine-p (#3794)
Part of #3390.
2021-07-23 19:13:11 +12:00
Jakub Žádník
f9f39c0a1c
Support other variables than PATH in pathvar (#3791)
* Fix swapped PATH env var separators

* Support pathvar to manipulate other vars than PATH

* Add tests for pathvar and its subcommands

* Fix PATH env name for Windows

Seems like Windows uses PATH as well.

Co-authored-by: Jakub Žádník <jakub.zadnik@tuni.fi>
2021-07-23 19:11:56 +12:00
Fernando Herrera
9b5db297a6
Replace command (#3823)
* replace command

* cargo fmt

* Signature correction
2021-07-22 08:45:46 -05:00
Jakub Žádník
b7215b5dde
Fix expected age of mockup files in example tests (#3808) 2021-07-20 18:05:58 -05:00
Fernando Herrera
411435d68f
Dataframe Shape command (#3805)
* size command to get dataframe info

* change command name to shape

* apply lint to file
2021-07-20 07:07:42 -05:00
Darren Schroeder
d0a7363e64
bat theme wasn't getting set properly (#3807) 2021-07-19 14:54:36 -05:00
Darren Schroeder
181ee1dade
Revert "Unify use of the surf crate (#3777)" (#3783)
This reverts commit 37612345f2.
2021-07-14 20:21:18 -05:00
Fernando Herrera
3645a0f0e4
Updated polars version for faster CSV reader (#3781) 2021-07-14 15:33:21 -05:00
Darren Schroeder
2864eaebae
fixed show_hints option to allow hints to be turned off (#3780) 2021-07-14 09:47:33 -05:00
Daniel Egger
37612345f2
Unify use of the surf crate (#3777)
This brings the features used by the `nu_plugin_fetch` and
`nu_plugin_post` in line and drops the default-features, reducing
the number of pulled-in dependencies and avoiding a second round of
compilations.

Signed-off-by: Daniel Egger <daniel@eggers-club.de>
2021-07-14 08:47:49 -05:00
Fernando Herrera
bb218b824e
corrected position of dataframes (#3776) 2021-07-14 08:46:32 -05:00
JT
71f4ea9d76
Bump to 0.34.0 (#3766) 2021-07-14 05:57:41 +12:00
Bruce Mitchener
1881a297c9
Use shadow-rs 0.6 in nu-cli. (#3759)
`nu-command` was already using `shadow-rs` 0.6, so there were two
copies being built and used. This makes them match up.
2021-07-10 16:11:08 +12:00
Darren Schroeder
56c7a99eb4
Into binary changes (#3758)
* kind of works but not what we really want

* updated `into binary` and `first` to work better together

* attempt to fix wasm build problem

* attempt #2 to fix wasm stuff
2021-07-09 16:43:18 -05:00
Bruce Mitchener
3262ffc1a6
Update s3handler to 0.7 (really 0.7.3). (#3757)
This brings with it a reduction in the number of duplicated
dependencies that it has and the overhead it imposes on our
build.

The number of crates that need to be built for
`cargo build --features extra` drops by roughly 50.
2021-07-10 07:28:07 +12:00
Matheus
5bc7a1f435
#3385: Add unique option for uniq command (#3754)
* Added -u arg for command uniq.

* Update uniq.rs

Co-authored-by: JT <jonathandturner@users.noreply.github.com>
2021-07-10 07:27:35 +12:00
Eli Flanagan
11cb5ed10e
port strings size engine-p (#3690) (#3753)
migrate `size` command to engine-p.

I also tweaked the signature of the primary logic (`size`) to mimic `keep`.

Part of #3390.
2021-07-10 06:45:19 +12:00
Darren Schroeder
70215fe480
a few things that make it easier to debug keybindings (#3752) 2021-07-08 08:56:54 -05:00
JT
69fa040361
Fix nothing string comparison (#3750) 2021-07-08 07:21:02 +12:00
Darren Schroeder
1911aad57f
add a couple more features (#3749) 2021-07-07 12:03:59 -05:00
Bruce Mitchener
1943071d12
Simplify is_executable in nu-completion. (#3742)
On Windows, we used the `is-exeuctable` crate but on Unix, we
duplicated the check that it did, with one difference: We also
looked at whether or not it was a symlink.

The `is-executable` crate uses `std::fs::metadata` which follows
symlinks, so this scenario should never occur here, as it will
return the metadata for the target file.

Using the `is-executable` crate on both Unix and Windows lets us
make it non-optional. This lets us remove the `executable-support`
feature. (It is worth noting that this code didn't compile on
Windows when the `executable-support` feature was not specified.)

Right now, there is an alternate code path for `target_arch` being
`wasm32`. This isn't exactly correct as it should probably handle
something different for when the `target_os` is `wasi`.
2021-07-07 07:53:07 -05:00
Darren Schroeder
08c624576c
try to use regular trim commands as much as possible (#3743) 2021-07-07 07:51:52 -05:00
Jakub Žádník
56855f9791
Downgrade crossterm to fix pager compilation (#3740)
* Downgrade crossterm to fix pager compilation

With 0.20.0, the `table-pager` feature wouldn't compile.
Closes #3738

* Update Cargo.lock
2021-07-07 15:24:42 +12:00
Bruce Mitchener
651d425046
Remove ptree dep from nu-command, remove associated feature. (#3741)
Nothing used the `ptree` feature or optional dependency within
`nu-command` except to include it within the `version` output. This
may be related to when `nu-cli` also had a `ptree` feature, but
I'm not sure.

That leaves the code within `nu_plugin_tree` as the sole remaining
user of `ptree`, which is already covered by the feature `tree`
and included in the `version` output.
2021-07-06 10:33:24 -05:00
Bruce Mitchener
d1df9b9e38
Update minus, tui to remove crossterm 0.18 dep. (#3739)
We already depend on crossterm 0.19 (and 0.20), so we can at least
remove the usage of 0.18 by updating minus and tui.
2021-07-06 20:44:07 +12:00
Bruce Mitchener
f603b7ef8b
Remove empty trace feature. (#3732)
In `nu-parser`, this was a relic of when nom was used by the parser
and it would enable using `nom-tracable`.
2021-07-06 07:21:28 +12:00
Daniel Egger
b8c3a10e5b
Bump a few source compatible nu-command dependencies (#3724)
Signed-off-by: Daniel Egger <daniel@eggers-club.de>
2021-07-05 19:16:34 +12:00
Daniel Egger
cab181832f
Bump rand version used by nu-command to 0.8 (#3723)
Signed-off-by: Daniel Egger <daniel@eggers-club.de>
2021-07-05 16:12:44 +12:00
Fernando Herrera
af2b2c668d
New take command (#3722)
* Type in command description

* filter name change

* Clean column name

* Clippy error and updated polars version

* Lint correction in file

* CSV Infer schema optional

* Correct float operations

* changes in series castings to allow other types

* Clippy error correction

* Removed lists from command signatures

* Added not command for series

* take command with args

* set with idx command
2021-07-05 11:46:53 +12:00
Darren Schroeder
9a1e1d5b1e
move lang command to $nu (#3720) 2021-07-01 13:09:50 -05:00
Fernando Herrera
17008bb648
Removed list from dataframe command signatures (#3713)
* Type in command description

* filter name change

* Clean column name

* Clippy error and updated polars version

* Lint correction in file

* CSV Infer schema optional

* Correct float operations

* changes in series castings to allow other types

* Clippy error correction

* Removed lists from command signatures

* Added not command for series
2021-07-01 16:33:52 +12:00
Andrés N. Robalino
bb5ab5d16c
nu-cli ctrl-c feature support. (#3718)
Seems we do `ctrl` feature checks in `nu-cli` and `nu-command`. We should find a better way to report the enabled features un the `version` command without using the conditionals (or somewhere else)
2021-06-30 19:45:27 -05:00
Andrés N. Robalino
c36d356f4e
nu-cli: Remove crates not needed. (#3716) 2021-06-30 17:47:56 -05:00
Darren Schroeder
333335c366
add ansi osc string terminator (#3712) 2021-06-30 12:01:23 -05:00
Bruce Mitchener
08306f0db8
Remove unused dep on nu-cli from nu_plugin_chart. (#3709) 2021-06-30 17:47:28 +12:00
Darren Schroeder
008bdfa43f
a new command to query the nushell internals (#3704)
* a new command to query the nushell internals

* added signature

* a little cleanup
2021-06-29 09:27:16 -05:00
Fernando Herrera
1d0483c946
Casting operations for Series with differents types (#3702)
* Type in command description

* filter name change

* Clean column name

* Clippy error and updated polars version

* Lint correction in file

* CSV Infer schema optional

* Correct float operations

* changes in series castings to allow other types

* Clippy error correction
2021-06-28 22:17:37 +12:00
Fernando Herrera
989062d2f8
Removed bug occurring with f64 (#3697)
* Type in command description

* filter name change

* Clean column name

* Clippy error and updated polars version

* Lint correction in file

* CSV Infer schema optional

* Correct float operations
2021-06-28 05:42:37 +12:00
Palash Ahuja
c2f78aaf88
Adding all-trim option (with format and all-flag) (#3696)
* adding changes for all-trim option

* adding changes for the all-flag and format flag

* renaming modules - clippy warning
2021-06-28 05:42:15 +12:00
Elton Leander Pinto
8f39f4580a
Add paste command (#3694)
* Add paste command

* fix build and format failures

* Add examples

* Make tests pass

* Format

* add cfg annotation for Clip

* format code

* remove additional import for clip

* Remove test
2021-06-27 08:42:17 +12:00
JT
6202c67fe8
Fix #3430 (#3693) 2021-06-26 17:38:36 +12:00
JT
0c82c1920e
Support multiple shorthand env vars (#3692) 2021-06-26 14:15:57 +12:00
Eli Flanagan
a2dc4199d0
port network url to engine-p (#3690)
migrate network URL related commands to engine-p.

Part of #3390.
2021-06-26 13:19:10 +12:00
JT
b1970f79ee
Add support for arbitrarily nested subcommands (#3688) 2021-06-26 09:09:06 +12:00
Võ Anh Duy
6cdd8a2b07
Fix string interpolation is not working with external command (#3686) 2021-06-26 08:14:54 +12:00
Eli Flanagan
4ed615cfcc
documentation: consistent abbreviation for URL (#3684)
I noticed `fetch`'s documentation used "URL" so wanted to do so here as
well.
2021-06-25 09:14:20 -05:00
Fernando Herrera
91da4e3168
No infer schema (#3683)
* Type in command description

* filter name change

* Clean column name

* Clippy error and updated polars version

* Lint correction in file

* CSV Infer schema optional
2021-06-25 20:35:07 +12:00
Fernando Herrera
596062ccab
Clean column names (#3678)
* Type in command description

* filter name change

* Clean column name

* Clippy error and updated polars version

* Lint correction in file
2021-06-25 19:09:41 +12:00
JT
93b5f3f421
Make lexing configurable wrt newlines (#3682) 2021-06-25 17:50:24 +12:00
JT
cac2875c96
Improve def parse errors (#3681) 2021-06-25 17:18:38 +12:00
Nathan Thomas
a3f119e0bd
Add pathvar command (#3670)
* Add pathvar command

Signed-off-by: nathom <nathanthomas707@gmail.com>

* Add pathvar command to context

Signed-off-by: nathom <nathanthomas707@gmail.com>

* Add pathvar reset command

Signed-off-by: nathom <nathanthomas707@gmail.com>

* Update help message

Signed-off-by: nathom <nathanthomas707@gmail.com>

* Remove insert command

Signed-off-by: nathom <nathanthomas707@gmail.com>

* Remove unused import

Signed-off-by: nathom <nathanthomas707@gmail.com>

* Remove insert mod

Signed-off-by: nathom <nathanthomas707@gmail.com>

* Support for windows path separator

Signed-off-by: nathom <nathanthomas707@gmail.com>

* Clear clippy errors

Signed-off-by: nathom <nathanthomas707@gmail.com>

* Remove empty file

Signed-off-by: nathom <nathanthomas707@gmail.com>

* Formatting

Signed-off-by: nathom <nathanthomas707@gmail.com>
2021-06-25 15:58:37 +12:00
JT
6ba40773bb
Always read textview input from stream (#3680) 2021-06-25 14:17:58 +12:00
Darren Schroeder
a1aae8ca38
update filesize -> filesize math to fix coercion errors (#3675)
* update filesize -> filesize math to fix coercion errors

* maybe shouldn't do some operations with filesize and int?
2021-06-23 15:37:20 -05:00
Michael Angerman
104cf5b51b
make nu-cli mod app public (#3673) 2021-06-24 06:05:59 +12:00
JT
4fe9d8a007
Enable dataframe command by default (#3672)
* Enable dataframe command by default

* Fix unwrap
2021-06-23 21:04:09 +12:00
JT
edbc828fc3
Bump to 0.33.1 (#3671) 2021-06-23 19:57:41 +12:00
Andrés N. Robalino
03c9eaf005
Variable completions. (#3666)
In Nu we have variables (E.g. $var-name) and these contain `Value` types.
This means we can bind to variables any structured data and column path syntax
(E.g. `$variable.path.to`) allows flexibility for "querying" said structures.

Here we offer completions for these. For example, in a Nushell session the
variable `$nu` contains environment values among other things. If we wanted to
see in the screen some environment variable (say the var `SHELL`) we do:

```
> echo $nu.env.SHELL
```

with completions we can now do: `echo $nu.env.S[\TAB]` and we get suggestions
that start at the column path `$nu.env` with vars starting with the letter `S`
in this case `SHELL` appears in the suggestions.
2021-06-23 19:21:39 +12:00
Luccas Mateus
2b021472d6
Fixed panic on math with large durations (#3669)
* Output error when ls into a file without permission

* math sqrt

* added test to check fails when ls into prohibited dir

* fix lint

* math sqrt with tests and doc

* trigger wasm build

* Update filesystem_shell.rs

* Fix Running echo .. starts printing integers forever

* Fixed panic on operations with very large durations

Co-authored-by: Jonathan Turner <jonathandturner@users.noreply.github.com>
2021-06-23 15:44:14 +12:00
JT
55cab9eb4f
Bump to 0.33 (#3667) 2021-06-22 17:22:33 +12:00
Darren Schroeder
b39dda0550
speed up windows completions (#3665)
* speed up windows completions

* fix CI failures

* make crate optional

* one more fix for CI

* allow unused
2021-06-21 16:39:21 -05:00
Darren Schroeder
7c0a52a81e
updated main in table so that it outputs again (#3662) 2021-06-21 14:14:20 -05:00
JT
318d13ed58
Add built-in var to refer to pipeline values (#3661) 2021-06-21 12:31:01 +12:00
Darren Schroeder
21a3ceee92
update/add path separators and environment separators to char (#3660) 2021-06-21 05:55:34 +12:00
Niklas Jonsson
a8f6a13239
Move path handling to nu-path (#3653)
* fixes #3616
2021-06-20 11:07:26 +12:00
Fernando Herrera
b9f1371994
Series commands (#3652)
* new series commands

* clippy corrections
2021-06-20 10:59:39 +12:00
Eli Flanagan
51c685aa99
port string case commands to engine-p (#3649)
Port snake_case and friends to engine-p syntax.

Part of #3390.
2021-06-19 15:01:18 +12:00
Nathan Thomas
9e39284de9
Add unlet_env command (#3629)
* Add ability to remove env variables

Signed-off-by: nathom <nathanthomas707@gmail.com>

* Implement unlet_env command

Signed-off-by: nathom <nathanthomas707@gmail.com>

* Update parameter description

Signed-off-by: nathom <nathanthomas707@gmail.com>

* Migrate to new filestructure

Signed-off-by: nathom <nathanthomas707@gmail.com>

* Added tests for unlet-env

Signed-off-by: nathom <nathanthomas707@gmail.com>

* Formatting

Signed-off-by: nathom <nathanthomas707@gmail.com>
2021-06-19 15:00:07 +12:00
JT
26899bc0f0
Update README.md 2021-06-19 12:08:44 +12:00
JT
a74d05061d
Begin directory contrib docs and split commands (#3650)
* Begin directory contrib docs and split commands

* Fix unused import warning
2021-06-19 12:06:44 +12:00
Jakub Žádník
4140834e4c
Remove dir-s/ectories/ectories-support features (#3647) 2021-06-19 11:29:29 +12:00
Andrés N. Robalino
bd44bcee32
Clean up nu-completion dependencies. (#3645) 2021-06-18 00:54:04 -05:00
JT
1e4678f929
Fix the ignore example (#3644) 2021-06-18 00:07:31 -05:00
JT
fe5055cf29
Relax groups and blocks to output at pipeline level (#3643)
* Relax groups and blocks to output at pipeline level

* Fix up tests and add ignore command
2021-06-18 13:04:51 +12:00
JT
d9d956e54f
Fix issue in external subexpression paths (#3642)
* Fix issue in external subexpression paths

* new clippy dropped

* clippy
2021-06-18 07:59:58 +12:00
JT
6c2c16a971
Add back disks and net to sys (#3639) 2021-06-17 19:57:40 +12:00
Reagan McFarland
955a5ed8fb
Plugin: from_mp4 and UntaggedValue::duration fix (#3618)
* plugin: basic from_mp4 implementation

This patch introduces a very basic implementation of from_mp4, with only
a few bits of meta-data available. The rest of the available meta-data
(which is more than half left), will be included in a later patch

* Mp4: Almost all track metadata is implemented

Only meta-data that is not implemented is duration, facing some weird
issue I am going to check on later

* Mp4: All meta-data fields implemented

All meta-data fields that can be retrieved are now retrieved, with the
exception of duration for both tracks and the entire file itself because
there is still an issue. However, that will be fixed in the upcoming
patches

* fix: UntaggedValue::duration() serializes correctly now

Previous to this patch, there was an issue where when you would use
UntaggedValue::duration() it would result in an invalid JSONRPC
resulting string when using the protocol. This patch fixes this issue

* Mp4: Duration fixed for file and tracks

* plugins: Add plugin extra to src/plugins

* Mp4: Replace unwrap() with expect()

* Fix: Remove test mp4 file
2021-06-17 14:18:31 +12:00
Niklas Jonsson
a59414203f
Only discard command comment if prev token was comment (#3628)
This fixes issues where a file with multiple def commands with their own
doc comments, some of the comments would be discarded.
2021-06-17 14:11:05 +12:00
Darren Schroeder
02bac0a326
fix FlatShape::Garbage's default foreground color (#3634) 2021-06-16 15:43:15 -05:00
Andrés N. Robalino
7c8fb060f1
Extract completions into subcrate. (#3631) 2021-06-16 15:20:01 -05:00
Andrés N. Robalino
2a946af81e
Support version option in Nu bin. (#3632)
Additionally we remove the little pieces that we relied on `clap` (for version number in this case).
2021-06-16 14:53:28 -05:00
JT
7a4d6d64fd
Add file not found error for nu cmd args (#3627) 2021-06-16 14:57:14 +12:00
Andrés N. Robalino
0eae9c49b0
Nu's rest arguments are source(s) files scripts to run. (#3624) 2021-06-15 20:38:56 -05:00
Andrés N. Robalino
d0bca1fb0f
Remove 'help' Nu bin positional support. (#3621)
Mostly to keep parity with the rest of Nu internal commands (`-h` and `--help`) instead.
2021-06-15 18:26:04 -05:00
Andrés N. Robalino
7c7e5112ea
Make Nu bootstrap itself from main. (#3619)
We've relied on `clap` for building our cli app bootstrapping that figures out the positionals, flags, and other convenient facilities. Nu has been capable of solving this problem for quite some time. Given this and much more reasons (including the build time caused by `clap`) we start here working with our own.
2021-06-15 17:43:25 -05:00
Fernando Herrera
ec96e85d04
Dataframe commands (#3608)
* Change name from pls to dataframe

* filter and rename commands

* filter example

* Filter example with bool mask
2021-06-15 14:34:08 +12:00
Sam Bordo
d60d71a697
Begin porting mkdir (#3607)
* Begin porting mkdir

* Addressed comments
2021-06-15 06:57:21 +12:00
JT
de99e35106
Refactor rarely changing engine state into its own struct (#3612)
* WIP

* Finish up EngineState refactor

* Fix Windows calls

* Fix Windows calls

* Fix Windows calls
2021-06-14 15:19:12 +12:00
Võ Anh Duy
774be79321
Fix syntax hightlight when using Circumflex-Operator (#3613) 2021-06-14 14:21:36 +12:00
Võ Anh Duy
721f704260
Add support to run external command with string evaluation (#3611) 2021-06-14 12:20:07 +12:00
Darren Schroeder
2846e3f5d9
enable theming of the command line syntax (#3606)
* enable theming of the command line syntax

* added missing flatshape, sorted flatshapes for easier reading.

* sorted flat shapes again and saved it this time

* added sample rwb.json syntax them file to docs
2021-06-11 14:17:43 -05:00
JT
b9ca3b2039
Remove EvaluationContext::from_args (#3604) 2021-06-11 18:35:21 +12:00
JT
8ac572ed27
Make arg eval lazy, remove old arg evaluation code (#3603)
* Remove old argument eval

* Merge main

* fmt

* clippy

* clippy

* clippy
2021-06-11 13:57:01 +12:00
Fernando Herrera
c4163c3621
Series arithmetic (#3602)
* operations with series

* contains operations with series

* Checked division and masked operations
2021-06-11 09:39:51 +12:00
Darren Schroeder
1d7c909080
add single quote and double quote to char command (#3601) 2021-06-10 08:20:17 -05:00
Christian Menges
500683831c
from xlsx/ods: Add parameter --sheets (#3600)
* from xlsx: Add parameter --sheets

* from ods: Add parameter --sheets
2021-06-10 07:44:24 -05:00
Christian Menges
9a2fe7ec0c
from sqlite: Add test for table selection (#3599) 2021-06-10 07:41:43 -05:00
JT
3ae3e3d23d
Further improve arg errors (#3598)
* Further improve arg errors

* Fix note

* Fix note
2021-06-10 20:33:06 +12:00
JT
fc07e849fe
Improve the errors for arg types (#3597) 2021-06-10 18:47:06 +12:00
JT
fadcdde7f8
Add help flag support to alias (#3595) 2021-06-10 16:28:33 +12:00
JT
d056bf070f
Improve alias highlighting/completions (#3594)
* Improve alias highlighting/completions

* Add example
2021-06-10 13:13:08 +12:00
Jakub Žádník
2591050fbe
Clarify exec help message; Update to engine-p (#3588)
* Fix and clarify description of 'exec'

Most importantly, I added the information that it replaces the current
process.

* Convert exec to OutputStream; Remove unused trait

* Remove dead code & unused imports on non-unix
2021-06-10 10:43:40 +12:00
JT
e8dfd4ba39
Enable syntax/completions for source (#3589) 2021-06-10 09:01:40 +12:00
JT
383e874166
Fix a bunch of future clippy warnings (#3586)
* Fix a bunch of future clippy warnings

* Fix a bunch of future clippy warnings
2021-06-10 07:08:12 +12:00
JT
e8a2250ef8
Improve expr parse (#3584)
* Require '-' to be a number for math

* Add test

* improve parse logic, add test
2021-06-10 05:17:45 +12:00
JT
440e12abc4
Fix #3582 (#3583)
* Fix #3582

* Fix empty?

* Fix parsing types
2021-06-09 18:07:54 +12:00
Jakub Žádník
25ba6ea459
Def cleanup (#3580)
* Remove impossible condition

* Improve def error

* Fmt
2021-06-09 10:06:44 +12:00
Darren Schroeder
5ec226a416
change command duration env var to emit duration in milliseconds and also change var name to CMD_DURATION_MS (#3581) 2021-06-08 16:14:38 -05:00
JT
a021b99614
Improve external quoting logic (#3579)
* Add tests and improve quoting logic

* fmt

* Fix clippy ling

* Fix clippy ling
2021-06-09 08:59:53 +12:00
JT
e9de4c08b0
Improve quoted completions (#3577) 2021-06-09 06:47:29 +12:00
JT
2e968d2557
Improve completions inside of a pipeline (#3575)
* Fix completion crash

* Improve inner completions
2021-06-08 19:48:02 +12:00
JT
bc6fa85a4b
Fix completion crash (#3574) 2021-06-08 18:56:36 +12:00
Fernando Herrera
4e6c2c0fa1
Column selector using FullColumnPath (#3572)
* Column selector using FullColumnPath

* column name with as

* standar group by name
2021-06-08 14:34:37 +12:00
JT
7eadbd938d
Add support for subcommand completions (#3571)
* Add support for subcommand completions

* Update test

* WIP

* Fix prepend for completions

* Fix test
2021-06-08 14:31:39 +12:00
Darren Schroeder
94fc8a1334
added ansi gradient in the spirit of fun (#3570) 2021-06-07 13:20:05 -05:00