2
0
Fork 0
mirror of https://github.com/nushell/nushell synced 2025-02-15 21:48:29 +00:00
Commit graph

315 commits

Author SHA1 Message Date
JT
3ae3e3d23d
Further improve arg errors ()
* Further improve arg errors

* Fix note

* Fix note
2021-06-10 20:33:06 +12:00
JT
fc07e849fe
Improve the errors for arg types () 2021-06-10 18:47:06 +12:00
JT
383e874166
Fix a bunch of future clippy warnings ()
* Fix a bunch of future clippy warnings

* Fix a bunch of future clippy warnings
2021-06-10 07:08:12 +12:00
JT
16faafb7a8
Rename the use of invocation to subexpression ()
* Rename the use of invocation to subexpression

* Fix test name
2021-06-07 20:08:35 +12:00
Jakub Žádník
82d69305b6
Path expand fixes ()
* Throw an error if path failed to expand

Previously, it just repeated the non-expanded path.

* Allow expanding non-existent paths

This commit has a strange error in examples.

* Specify span manually in examples; Add an example

* Expand relative path without requiring cwd

* Remove redundant tilde expansion

This makes the tilde expansion in relative paths dependant on "dirs"
feature.

* Add missing example result

* Adjust path expand description

* Fix import error with missing feature
2021-06-07 05:28:55 +12:00
JT
1d0d0425d4
More fixes for bigint duration () 2021-06-05 04:54:18 +12:00
JT
4bca36f479
Switch duration back to bigint () 2021-06-04 19:39:12 +12:00
JT
7d78f40bf6
Bump to 0.32.1 () 2021-06-04 19:07:50 +12:00
JT
131b5b56d7
Finish removing arg deserialization ()
* WIP remove process

* WIP

* WIP

* Finish removing arg deserialization
2021-06-04 18:23:57 +12:00
JT
290c712cde
Retain tag when accessing a var () 2021-06-02 19:49:14 +12:00
JT
df526f73be
Bump to 0.32 ()
* Bump to 0.32

* Bump to 0.32
2021-06-01 08:14:50 +12:00
Lily Mara
4b11b283ac
Resolve issues with rm * globbing ()
Using the `*` wildcard should not attempt to delete files with a leading dot
unless the more explicit `.*` is used. `rm *` should also not attempt to delete
the current directory or its parent directory (`.` and `..`). I have resolved
this bug as well in a less satisfactory way. I think it may be the case that we
can only disambiguate the `.` and `..` path segments by using `Path::display`.
Here is a short list of alternatives that I tried:

- `Path::ends_with()` can detect `/..` but not `/.`.
- `Path::iter()` and `Path::components()` leave out `/.`.
- `Path::file_name()` normalizes `/.` to the parent component's file name.

Fixes 
2021-05-30 15:36:36 +12:00
JT
41834d16d6
Allow aliases to expand and ignore painting outside of lines () 2021-05-26 17:58:32 +12:00
JT
5fcc7f2328
Fix bad operator () 2021-05-24 17:27:10 +12:00
JT
20f6114617
Improve block params () 2021-05-20 16:26:54 +12:00
Jakub Žádník
3075e2cfbf
Remove rest_args() from evaluated CommandArgs ()
It was too error prone when positional arguments were used with the rest
arguments. Now, you need to explicitly state from which position you
want to count the rest args (e.g., `rest(0)`).
2021-05-20 10:26:23 +12:00
JT
e2973d2176
Add explicit block params ()
* Add explicit block params

* Add explicit block params
2021-05-19 20:23:45 +12:00
JT
d79a3130b8
Make the default int an i64 ()
* Make the default int an i64

* fmt

* Fix random integer

* Treat pids as i64 for now
2021-05-14 20:35:09 +12:00
Darren Schroeder
440a589f9e changed comment slightly 2021-05-13 14:21:16 -05:00
JT
9b8b1bad57
Don't insert PATH variable on Windows ()
* Don't insert PATH variable on Windows

* Simplify fix

* Just centralize the var

* Add a message about why we have to workaround the issue
2021-05-13 15:03:49 +12:00
JT
3aa00b78f9
Improve missing var in var-path error () 2021-05-12 20:53:34 +12:00
JT
2bb23c57df
Bump to 0.31.1 () 2021-05-12 15:06:50 +12:00
JT
25a8caa9b0
Simplify expressions ()
* WIP: experiment with simpler expressions

* fix simple invoke

* update tests

* fix a few tests

* Make paren parsing more robust

* fix external args

* Remove old invocation

* Update tests

* Update tests
2021-05-12 13:01:48 +12:00
JT
48128c9db6
Bump to 0.31.0 () 2021-05-11 16:44:52 +12:00
Jakub Žádník
7a583083b8
Convert the rest of "random" subcommands to engine-p ()
* Convert "random bool" to engine-p

Also implements FromValue for Tagged<BigDecimal> and Tagged<f64>.

* Convert "random dice" to engine-p

* Convert "random uuid" to engine-p

* Covert "random chars" to engine-p

* Convert "random" command to engine-p
2021-05-10 19:07:57 +12:00
Jakub Žádník
9fd6923821
Port random integer & decimal to engine-p + related refactoring ()
* Implement minmax for Range; Simplify range command

* Port random integer to enginep; New FromValue impl

Now, FromValue is implemented for Tagged<Range> to allow extracting args
into this type.

* Make sure range value extraction fails properly

The range endpoint extraction methods now return error instead of
silently clipping the value. This now makes `random integer ..-4` fail
properly since -4 can't be cast as u64.

* Port random decimal to enginep & Refactor

This added a way to interpret Range limits as f64 and a Primitive helper
to get its value as f64.

A side effect of this commit is that it is now possible to specify the
command bounds as true decimals. E.g., `random decimal 0.0..3.14` does
not clip 3.14 to 3.
2021-05-08 07:58:12 +12:00
JT
91a929b2a9
Clippy fixes for new Rust version () 2021-05-07 07:58:21 +12:00
JT
fc59291191
Simplify down to one type of context ()
* Simplify down to one type of context

* More simplification
2021-05-03 11:45:55 +12:00
Jakub Žádník
4fc05cac56
Port range to engine-p ()
* Removes arg serialization
* action stream -> output stream
* uses nu_protocol::Range instead of NumericRange
* random missing newline I found in the code
2021-05-03 07:47:59 +12:00
Leonhard Kipp
d05c48a1d7
Fix : Pick up nu-env if cd with shortcuts ()
* Fix autoenv not set when using implied cd

* Fix wrong return value

* Fix windows no value returned err
2021-04-28 17:31:22 +12:00
JT
599c43ce04
bump to 0.30.1 () 2021-04-22 21:07:54 +12:00
JT
3ad4e0348f
Fix external redirect ()
* Fix external redirection

* Fix external redirection
2021-04-22 08:54:34 +12:00
JT
02d5729941
Properly evaluate dynamic blocks () 2021-04-21 14:31:54 +12:00
JT
ce35689d2e
Make finding the path variable more robust ()
* Make finding the path variable more robust

* Update reload_config also
2021-04-21 11:37:10 +12:00
JT
da81e21bf2
Add a sync from the known path to the env () 2021-04-21 08:22:53 +12:00
Leonhard Kipp
1a46e70dfb
Use new functions in which ()
* Use new functions in which

* Impl rest_with_minimum and use it

* Use has_flag instead of get_switch
2021-04-20 18:38:36 +12:00
JT
0fc9b6cfa2
Bump to 0.30 ()
* Bump to 0.30

* fix test
2021-04-20 18:34:10 +12:00
Darren Schroeder
528c1c5fd8
change $scope.variables output to a table () 2021-04-15 14:02:08 -05:00
JT
f73732bf1e
Move to* and from* to engine-p ()
* WIP

* Finish last batch
2021-04-15 19:43:33 +12:00
Darren Schroeder
fd7875e572
sort scope.aliases, commands, variables () 2021-04-14 18:57:47 -05:00
Darren Schroeder
a148c640b2
add variables to $scope () 2021-04-14 09:48:14 -05:00
Darren Schroeder
ea0205f2ff
remote --help/-h from $scope.commands display ()
* remote --help/-h from $scope.commands

* change a test
2021-04-14 07:55:58 -05:00
Darren Schroeder
005649b6fc
remove dupes in get_commands/get_command_names () 2021-04-13 09:21:44 -05:00
Jonathan Turner
e09e3b01d6
Fix the auto-conversion regression () 2021-04-13 14:25:18 +12:00
Steven Barragán
b2fe5fabb1
Add commands to scope variable ()
* Add commands to scope variable

* List commands with signature on scope variables

Usage:

```shell
echo $scope.commands | pivot
```

* Run rust formater

* Update variables.rs

Co-authored-by: Jonathan Turner <jonathandturner@users.noreply.github.com>
2021-04-12 14:38:47 +12:00
Leonhard Kipp
52d69bb021
Fix Rest arg is not optional () 2021-04-12 14:37:36 +12:00
Jonathan Turner
5f550a355b
Split OutputStream into ActionStream/OutputStream ()
* Split OutputStream into ActionStream/OutputStream

* Fmt

* Missed update

* Cleanup helper names

* Fmt
2021-04-12 14:35:01 +12:00
Jonathan Turner
734877338d
Remove take_while from internal iterator () 2021-04-11 18:29:01 +12:00
Jonathan Turner
2e439ca77f
Improve range and internal iteration () 2021-04-11 13:31:08 +12:00
Andrés N. Robalino
a131eddf54
move out call info deserializing from str () 2021-04-09 22:58:18 -05:00