Commit Graph

4911 Commits

Author SHA1 Message Date
JT
9c7d2ab8f2
Create TODO.md
Todo:
- [x] Env shorthand
- [x] String interpolation
- [x] Aliases
- [x] Env vars
- [x] Sub commands
- [x] Floats
- [x] Tests
- [x] Decl requires $
- [x] alias highlighting at call site
- [x] refactor into subcrates
- [x] subcommand alias
- [x] type inference from successful parse (eg not List<unknown> but List<int>)
- [x] variable type mismatch 
- [ ] finish operator type-checking
- [ ] Column path
- [ ] Ranges
- [ ] Source
- [ ] Autoenv
- [ ] Block params

# Maybe
- [ ] default param values?
- [ ] Unary not?
2021-08-18 05:34:08 +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
JT
2b7390c2a1
Switch back to building for size (#3924) 2021-08-17 08:45:39 +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
baoyachi. Aka Rust Hairy crabs
1bd3fdd912
upgrade shadow-rs 0.6.8 (#3914) 2021-08-13 06:03:50 +12:00
JT
7655b070df fix tests 2021-08-11 06:57:08 +12:00
JT
1355a5dd33 refactor to subcrates 2021-08-11 06:51:08 +12:00
Jonathan Turner
f62e3119c4 a little more progress on errors 2021-08-10 18:31:34 +12:00
Jonathan Turner
828585a312 add more type helpers and span fixes 2021-08-10 17:55:25 +12:00
Jonathan Turner
ef4af443a5 parser fixes for windows and pretty errors 2021-08-10 17:08:10 +12:00
JT
1a3e1e0959 touchup alias highlight 2021-08-09 20:00:16 +12:00
JT
40004e64a6 Merge branch 'main' of github.com:jonathandturner/engine-q 2021-08-09 19:55:22 +12:00
JT
50dc0ad207 aliases 2021-08-09 19:55:06 +12:00
JT
3da4f02ffa aliases 2021-08-09 19:53:06 +12:00
Jonathan Turner
8a2bba4efb use storm's fix 2021-08-09 18:02:51 +12:00
Jonathan Turner
1ba80224ad More gracefully handle reedline errors 2021-08-09 17:29:25 +12:00
JT
bf19918e3c begin aliases 2021-08-09 12:19:07 +12:00
JT
38fef28c84 Add subcommand test 2021-08-09 09:55:18 +12:00
JT
273f964293 slight improvement 2021-08-09 09:34:21 +12:00
JT
d2577acccd env vars 2021-08-09 09:02:47 +12:00
JT
d92e661253 Adding floating point 2021-08-09 08:21:21 +12:00
Eli Flanagan
de71cbdd43
document engine-p porting (#3868)
* document engine-p porting

See #3390 for all the details.

* use static numbering
2021-08-08 05:57:32 +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
Darren Schroeder
28db8022fe
Update README.md
added integrations and mentions in supported section
2021-08-05 07:35:22 -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
Darren Schroeder
55acdaaf8c
add officially supported by section (#3895) 2021-08-04 15:57:57 -05:00
Waldir Pimenta
575c07c9c4
Normalize capitalization in issue templates (#3891)
* Normalize capitalization in feature_request.yml

* Normalize capitalization in bug_report.yml
2021-08-03 18:49:03 -05: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
JT
cb11f042ab Start env shorthand 2021-07-31 17:20:40 +12:00