2
0
Fork 0
mirror of https://github.com/nushell/nushell synced 2025-02-13 12:43:48 +00:00
Commit graph

706 commits

Author SHA1 Message Date
Fernando Herrera
69954a362d
history-menu () 2022-01-25 09:39:22 +00:00
JT
6e44012a2f
Fix bug in date comparison () 2022-01-24 16:55:45 -05:00
JT
988a873466
Allow open to read its filename from input ()
* Allow `open` to read its filename from input

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

* Fix merge not retaining LS_COLORS

* Add move command

* Add checking for non-existent columns

* Add move command examples; Disallow flag shorthand
2022-01-24 21:43:38 +02:00
Darren Schroeder
d4fb95a98c
allow find to respect ls_colors () 2022-01-24 12:23:03 +11:00
Arthur Targaryen
f82e2fbac6
Port find command ()
* Add `Find` command

* Complete rustdoc for test `Value` constructors

* Use `Option::unwrap_or` instead of match

* Add `Value::test_filesize` constructor

* Handle searching for terms in `find`

* Fix `find` command signature

* Return multiple elements when `find`ing by predicate

* Do not accept rest parameter with predicate

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

* Use `PipelineData::filter`
2022-01-23 16:32:02 -06:00
Stefan Stanciulescu
4e171203cc
Fix cd-ing into a file ()
* Add custom error for path not being a directory

* Fix cd issue with cd-ing into a file

* Keep formatting style as before

* Check if path is not a directory and return error if that's the case
2022-01-23 15:02:12 +02:00
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
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
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
JT
49e8af8ea5
Bump to 0.43 () 2022-01-18 12:06:12 -05: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
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
JT
b78924c777
Add support for load-env () 2022-01-15 18:50:11 -05:00
Fernando Herrera
89d99db94f
menu options () 2022-01-15 17:01:44 +00: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
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
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
Jakub Žádník
733b2836f1
Cleanup parsing of use and hide commands () 2022-01-10 12:39:25 +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
affb9696c7
Fix directory change lag () 2022-01-05 16:50:27 +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
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
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
ac487dfcbc
Add parser tracing, fix 629 () 2022-01-02 08:42:50 +11:00
JT
15b979b06e
Bump reedline () 2022-01-01 09:41:29 +11:00
JT
832a801c11
Preserve metatdata in where () 2021-12-29 22:17:20 +11:00
JT
62011b6bcc
Bump to 0.42 () 2021-12-28 20:56:59 +11:00
JT
e94b8007c1
Allow update to also insert () 2021-12-28 10:11:20 +11:00
Fernando Herrera
53330c5676
def argument check ()
* def argument check

* corrected test

* clippy error
2021-12-28 06:13:52 +11:00
JT
ca6baf7a46
Add single tick string interpolation ()
* Add single tick string interpolation

* give string interpolation its own highlighting
2021-12-26 07:50:02 +11:00
JT
a811eee6b8
Add support for 'open' () 2021-12-25 06:24:55 +11:00
JT
3522bead97
Add string stream and binary stream, add text decoding ()
* WIP

* Add binary/string streams and text decoding

* Make string collection fallible

* Oops, forgot pretty hex

* Oops, forgot pretty hex

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

* Add string interpolation to testing
2021-12-24 11:16:50 +11:00
Darren Schroeder
ba1ff4cf6c
add configuration of maximum history size () 2021-12-23 13:59:00 -06:00
Fernando Herrera
f3c175562d
vi mode () 2021-12-23 09:31:16 +00:00
Jakub Žádník
deeb1da359
Allow having only one env conversion ()
Allows setting only `from_string` or `to_string` in `env_conversions`
config. Previously, both were required.
2021-12-22 00:32:38 +02:00
JT
266fac910a
Signature improves, sorted completions () 2021-12-22 07:50:18 +11:00
Fernando Herrera
6a35e6b7b6
Dataframe commands ()
* groupby object

* aggregate command

* eager commands

* rest of dataframe commands
2021-12-22 05:32:09 +11:00
Braulio Valdivielso Martínez
d32aec5906
Don't panic if the other end of std{out,err} is closed ()
* fix 

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

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

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

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

* Fix capturing env vars containing ' or "; Rustfmt
2021-12-20 23:19:43 +02:00