Commit Graph

811 Commits

Author SHA1 Message Date
JT
b58aad5eb0
Make external app error uniform () 2022-01-23 01:12:34 +11:00
Jakub Žádník
564c2dd7d1
Port merge command from Nushell ()
* Add example test to zip

* Port merge command from Nushell

On top of the original merge, this one should not collect a stream
returned from the merged block and allows merging records.
2022-01-22 01:50:26 +02:00
Eli Flanagan
e1272f3b73
lint: remove trailing whitespace () 2022-01-22 10:29:10 +11:00
JT
6fa022b0a8 Add group-by and transpose (aka pivot) () 2022-01-21 15:28:21 -05:00
Darren Schroeder
0ef0277882
allow use to parse quoted paths () 2022-01-21 13:20:13 -06:00
JT
939745ad67
Support recursive functions in capture () 2022-01-21 11:39:55 -05:00
Fernando Herrera
846a048bba
menu-performance () 2022-01-21 08:59:29 +00:00
Darren Schroeder
057bfff0cb
add term size command ()
* add `term-size` command

* Update term_size.rs

Co-authored-by: JT <547158+jntrnr@users.noreply.github.com>
2022-01-21 14:31:33 +11:00
JT
91883bd572
Better help search () 2022-01-20 18:58:58 -05:00
JT
b4e61a056c
add cd - support () 2022-01-21 07:51:44 +11:00
Darren Schroeder
65ef7b630b
PATH for completions for each os () 2022-01-20 13:46:52 -05:00
JT
45b3592739
add some more division for units () 2022-01-21 05:23:26 +11:00
JT
33ffb2c39a
Add which command, add external completions, and builtin var completions ()
* Add which and external completions

* WIP

* Finish up external and var completions

* fix windows
2022-01-21 05:02:53 +11:00
Michael Angerman
d4b6b4b09a
update all cargo crates to edition 2021 () 2022-01-21 00:13:45 +11:00
JT
be8c905ca7
Show error on bad config, but keep going () 2022-01-20 03:42:12 +11:00
JT
d2d22815fb
Improve env shorthand parse () 2022-01-20 01:58:12 +11:00
Fernando Herrera
6514a30b5d
general keybindings ()
* general keybindings

* get value function

* check error for keybinding

* cmd and send for keybingins

* better error message
2022-01-19 07:28:08 -06:00
Fernando Herrera
ff9d88887b
simple event keybinding () 2022-01-18 19:32:45 +00:00
Fernando Herrera
20eb348896
simple keybinding parsing () 2022-01-18 08:48:28 +00:00
Darren Schroeder
2c75aabbfc
allow size and other to count bytes from binary with as_string() () 2022-01-17 17:41:59 -06:00
Stefan Holderbach
01e691c5ba
Fix unicode word wrapping with ansi-cut ()
Ansi-cut expects ranges of character numbers (of the non-ansi control
sequence characters) instead of byte indices.
This fixes the panics when wrapping of non-unicode lines (which exceed
the demanded number of characters as byte indices).
Also rectifies some wrong wrapping of unicdoe containing lines that
don't panic
2022-01-17 15:31:21 -05:00
Darren Schroeder
085a7c18cb
fix signature () 2022-01-17 09:14:33 -06:00
JT
0f85646d8e
Let 'to toml' output block source () 2022-01-17 19:25:12 +11:00
Darren Schroeder
c55b6c5ed5
fix list formatting () 2022-01-16 16:40:40 -06:00
JT
283a615ecc
Enter now requires a directory () 2022-01-17 03:14:34 +11:00
JT
9b128b7a03
Add rest to get, bump reedline () 2022-01-17 02:40:11 +11:00
Jakub Žádník
bfe3c50dce
Fix empty entry in ls () 2022-01-17 02:40:00 +11:00
Onur Şahin
5fae96a6b1
Fix not equal returning error when same things are compared in some cases ()
* Fix not equal returning error when same things are compared in some cases

* Equality operators supports all type combinations
2022-01-17 01:34:20 +11:00
Jakub Žádník
3b4baa31b6
Fix ls relative path & command argument path expansion ()
* Switch to short-names when the path is a relative_path (a dir) and exit with an error if the path does not exist

* Remove debugging print line

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

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

* Add canonicalize check and remove code clones

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

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

* Add single-dot expansion to nu-path

* Move value path expansion from parser to eval

Fixes 

* Remove single dot expansion from parser

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

* Fix ls to display globs with relative paths

* Use pathdiff crate to get relative paths for ls

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

* Add binary input

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

* Add support for binary filetypes
2022-01-16 07:44:20 +11:00
JT
8f4ee14d85
Hide Windows ps status, bump reedline () 2022-01-16 06:44:24 +11:00
Fernando Herrera
89d99db94f
menu options () 2022-01-15 17:01:44 +00:00
JT
f9c0d223c1
Improve keyword parsing, including for ()
* Improve keyword parsing, including for

* touchup
2022-01-16 02:26:52 +11:00
Jakub Žádník
21a7278259
Revert "Fix ls relative path and erroring on fake dir ()" ()
This reverts commit bee5ba3deb.
2022-01-15 12:58:24 +02:00
Stefan Stanciulescu
bee5ba3deb
Fix ls relative path and erroring on fake dir ()
* Switch to short-names when the path is a relative_path (a dir) and exit with an error if the path does not exist

* Remove debugging print line

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

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

* Add canonicalize check and remove code clones

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

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

* fixed a reedline type-o

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

Fixes .

* Merge delta after getting config

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

* Add more deps

* Add more deps

* clippy

* clippy

* clippy

* clippy

* clippy

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

* Try different message
2022-01-14 06:40:25 +11:00
JT
82d90f4930
Add support for var/string interp for external names () 2022-01-13 19:17:45 +11:00
Darren Schroeder
d0f9943709
expose a few more types to custom commands (def) () 2022-01-12 09:59:07 -06:00
JT
186da4d725
Fixing captures ()
* WIP fixing captures

* small fix

* WIP

* Rewrite to proof-of-concept better parse_def

* Add missing file

* Finish capture refactor

* Fix tests

* Add more tests
2022-01-12 15:06:56 +11:00
Fernando Herrera
47495715a6
context menu with nucompleter () 2022-01-11 21:53:42 +00:00
Darren Schroeder
ffb086d56f
a little better table alignment () 2022-01-11 08:49:15 -06:00
Michael Angerman
160339bd1f
add in a new select test that exercises a different match arm of the select command () 2022-01-10 13:29:52 -08:00
JT
d3bfc61524
Don't panic on alias errors () 2022-01-10 13:52:01 +11:00
Jakub Žádník
733b2836f1
Cleanup parsing of use and hide commands () 2022-01-10 12:39:25 +11:00
Darren Schroeder
3a17b60862
new command fmt to format numbers ()
* new command `fmt` to format numbers

* remove comments
2022-01-09 19:19:41 -06:00
Darren Schroeder
b49885bb85
Revert "added a better default for ls_colors ()" ()
This reverts commit d63eac69e5.
2022-01-09 16:48:29 -06:00
Darren Schroeder
d63eac69e5
added a better default for ls_colors () 2022-01-08 08:30:48 -06:00
Darren Schroeder
38e0527083
add more chars ()
* add more chars

* group nerdfonts with nf- prefix

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

* Fix example and missing test commands

* Add forgotten file
2022-01-08 02:40:40 +02:00
Jakub Žádník
f964ce9bc0
Add repository name and current tag to gstat ()
* Add repository name to gstat

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

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

* clippy
2022-01-06 21:20:31 +11:00
JT
d39e8c15fe
Expand external command names () 2022-01-06 10:32:56 +11:00
Ștefan
47544ad219
Move fetch to extra and clean up some code ()
* Move fetch to extra

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

* Fix formatting issues

* Make fetch a default command

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

* Fix environment cloning in loops

* Remove debug print

* Fmt
2022-01-06 09:21:26 +11:00
JT
14cd798f00
Make ls more forgiving () 2022-01-06 09:21:15 +11:00
JT
cc1ae969fe
Allow int/float to coerce in type checker () 2022-01-06 07:58:58 +11:00
JT
3c2a336ef9
Each much clone its env () 2022-01-05 23:08:03 +11:00
JT
058738c48c
More shell fixes () 2022-01-05 17:36:42 +11:00
JT
affb9696c7
Fix directory change lag () 2022-01-05 16:50:27 +11:00
JT
c158d29577
Add shells support () 2022-01-05 15:35:50 +11:00
JT
b4c72e85e1
Limit when we expand external args () 2022-01-05 12:09:53 +11:00
JT
41dbc641cc
Some cleanups for cd/PWD ()
* Some cleanups for cd/PWD

* Some cleanups for cd/PWD
2022-01-05 11:26:01 +11:00
Darren Schroeder
4584d69715
tweak source parsing to allow quotes around string () 2022-01-05 10:44:48 +11:00
Jakub Žádník
74dcd91cc3
Use only $nu.env.PWD for getting the current directory ()
* Use only $nu.env.PWD for getting current directory

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

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

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

* Rename nu-path functions

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

* Clone stack every each iter; Fix some commands

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

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

* Post-rebase cleanup, fmt, clippy

* Change back _relative to _with in nu-path funcs

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

* Remove leftover current_dir from rebase

* Add cwd sync at merge_delta()

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

* Always pass absolute path to glob in ls

* Do not allow PWD a relative path; Allow recovery

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

* Clone stack in each also for byte/string stream

* (WIP) Start moving env variables to engine state

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

Quick and dirty code.

* (WIP) Remove unused mut and args; Fmt

* (WIP) Fix dataframe tests

* (WIP) Fix missing args after rebase

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

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

* Minor edits

* Refactor merge_delta() to include stack merging.

Less error-prone than doing it manually.

* Clone env for each `update` command iteration

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

* Fix clippt warnings

* Add TODO about env var reading

* Do not clone empty environment in loops

* Remove extra cwd collection

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

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

* update samples/tests
2022-01-05 08:34:42 +11:00
JT
4d1ce6c27b
Use default prompt as fallback () 2022-01-05 06:49:04 +11:00
JT
857ecda050
Let describe know about binary () 2022-01-04 14:05:24 +11:00
JT
36079f1a3d
Port fetch (with fixes) ()
* Port fetch to engine-q

* Fix check for path as a string

* Add a timeout flag and fix some span issues

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

* More tweaks for the bytestream

* Rewrite fetch using ByteStreams

* buffer read on bytes directly

Co-authored-by: Stefan Stanciulescu <contact@stefanstanciulescu.com>
2022-01-04 13:01:18 +11:00
JT
b6fcd46075
Some error improvements () 2022-01-04 10:14:33 +11:00
JT
cb8b7e08a5
Lex comment spans correctly () 2022-01-04 08:37:45 +11:00
JT
fe5f65a247
Highlight block and record () 2022-01-03 16:21:26 +11:00
JT
9535e2c309
Fix list and table print ()
* Fix list printing

* Fix list and table highlighting
2022-01-03 14:18:23 +11:00
JT
850f66aa9d
Fix build breakage - bump ansi term ()
* Fix build breakage - bump ansi term

* Remove e-q ansi term
2022-01-03 09:36:32 +11:00
JT
354d51a3a6
Fix perf regression with stmts () 2022-01-03 07:18:48 +11:00
JT
c9dcd212ba
Allow pipelines across multiple lines if end in pipe ()
* Allow pipelines across multiple lines if end in pipe

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

* seems to be working now
2022-01-02 09:53:16 +11:00
JT
ac487dfcbc
Add parser tracing, fix 629 () 2022-01-02 08:42:50 +11:00
JT
4383b372f5
Cleanup binary stream print a little () 2022-01-01 21:42:15 +11:00
Michael Angerman
5d58f68c59
port over from nushell the column flag for the length command ()
* port over from nushell the column flag for the length command

* fix clippy error

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

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

* reference the new location of the get_columns method

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

* Format ignore command
2021-12-30 15:54:33 +11:00
JT
80649f2341
Fix flattening of in-variable () 2021-12-30 14:26:40 +11:00
Darren Schroeder
7faa4fbff4
revert file_types to lowercase ()
* revert file_types to lowercase

* fix test
2021-12-29 21:16:50 -06:00
JT
832a801c11
Preserve metatdata in where () 2021-12-29 22:17:20 +11:00
JT
c8330523c8
Don't read config in a tight loop () 2021-12-29 07:06:53 +11:00
JT
e94b8007c1
Allow update to also insert () 2021-12-28 10:11:20 +11:00