Commit Graph

1343 Commits

Author SHA1 Message Date
Fernando Herrera
ffbc0b0180
Header filtering out of for loop (#5896)
* remove extra print

* dataframe with real index

* corrected dataframe tests

* clippy error

* clippy error

* moved header filter out of loop
2022-06-27 06:33:45 -05:00
Fernando Herrera
c0901ef707
Dataframe with real index (#5892)
* remove extra print

* dataframe with real index

* corrected dataframe tests

* clippy error

* clippy error
2022-06-26 17:32:18 -05:00
Fernando Herrera
d3e84daa49
remove extra print (#5891) 2022-06-26 11:48:30 -05:00
WindSoilder
c5a69271a2
make path exists work on expanded path (#5886)
* make path exists works with home

* fix test name
2022-06-26 06:55:55 -05:00
Kangaxx-0
dc9d939c83
Introduce new command - nu check (#5864)
* nu check command - 1

* Support stream

* Polish code and fix corner case
2022-06-26 06:53:06 -05:00
Benoît Cortier
32f0f94b46
feat: add --binary(-b) option to hash commands (#5885)
For instance,

```
echo 'abcdefghijklmnopqrstuvwxyz' | hash sha256 --binary
```

Will returns the hash as a binary value instead of a hexadecimaly encoded string.
2022-06-26 06:50:56 -05:00
Darren Schroeder
a142d1a192
update encode decode with new signature (#5881) 2022-06-25 19:06:39 -05:00
Benoît Cortier
173d60d59d
Deprecate hash base64, extend decode and add encode commands (#5863)
* feat: deprecate `hash base64` command

* feat: extend `decode` and `encode` command families

This commit
- Adds `encode` command family
- Backports `hash base64` features to `encode base64` and `decode base64` subcommands.
- Refactors code a bit and extends tests for encodings
- `decode base64` returns a binary `Value` (that may be decoded into a string using `decode` command)

* feat: add `--binary(-b)` flag to `decode base64`

Default output type is now string, but binary can be requested using this new flag.
2022-06-26 00:35:23 +03:00
JT
f2989bf704
Move input/output type from Command to Signature (#5880) 2022-06-26 09:23:56 +12:00
Darren Schroeder
ef9b72d360
add ability to convert timestamp_millis() (#5876)
* add ability to convert timestamp_millis()

* add example test

* add nanos too
2022-06-25 09:51:41 -05:00
Justin Ma
25349a1eac
Add an example for default command to get an env var with fallback (#5874)
* Add an example for `default` command to get an env var with fallback

* update test

* update test
2022-06-25 17:27:54 +08:00
pwygab
1345f97202
Errors when let in, let env and similar commands are passed. (#5866)
* throw `let nu/env/nothing/in` error in parsing

* add tests and fmt

* fix clippy

* suggestions

* fmt

* `lvalue.span` instead of `spans[1]`

* clippy

* fmt
2022-06-25 00:55:25 +03:00
JT
533e04a60a
Bump to 0.64.1 dev version (#5865) 2022-06-24 16:47:00 +12:00
Fernando Herrera
f231a6df4a
Remove quotes from external args (#5846)
* remove quotes from external args

* remove internal quotes

* correct escaped quotes in string
2022-06-22 22:01:44 -05:00
Fernando Herrera
3c0bccb900
Exclude ./... from expansion (#5839)
* exclude ./... from expansion

* use all instead of any

* no path expansion for external arguments

* clippy error

* expand only tilde
2022-06-22 22:00:30 -05:00
pwygab
f43a65d7a7
Prevents duplicate fields in transpose -r (#5840) 2022-06-22 19:19:06 -05:00
WindSoilder
82ae06865c
Port command (#5849)
* implement port command

* better comment

* fmt code

* fix example description

* fix usage

* fix tests
2022-06-21 23:27:58 -04:00
Fernando Herrera
7164929c61
Db commands without DB (#5838)
* database commands without db

* database command tests
2022-06-21 12:14:29 -05:00
pwygab
dbcfcdae89
calculates history duration properly (#5827) 2022-06-19 00:44:46 -04:00
pwygab
28c21121cf
fixes to nuon for inf, -inf, and NaN (#5818) 2022-06-17 21:01:37 +03:00
Darren Schroeder
a17d46f200
add more columns to the history command when using sqlite history (#5817) 2022-06-17 09:35:34 -05:00
Fernando Herrera
6cc8402127
Standardise to commands (#5800)
* standarize to commands

* move from to to into
2022-06-17 07:51:50 -05:00
Michael Angerman
bc48b4553c
Move the history and tutor commands out of core_commands (#5813)
* move history and tutor commands from core to misc

* add in the Misc Category for the history and tutor commands
2022-06-16 09:58:38 -07:00
nibon7
8b368b6a4e
Fix drop nth with open end range on 32-bit platforms (#5808)
Fixes #5793

Signed-off-by: nibon7 <nibon7@163.com>
2022-06-16 06:39:48 -05:00
WindSoilder
8c0d60d0fb
add notes for def_env (#5807)
* add notes for def_env

* Update crates/nu-command/src/core_commands/export_def_env.rs

Co-authored-by: Stefan Holderbach <sholderbach@users.noreply.github.com>

* Update crates/nu-command/src/core_commands/def_env.rs

Co-authored-by: Stefan Holderbach <sholderbach@users.noreply.github.com>

Co-authored-by: Stefan Holderbach <sholderbach@users.noreply.github.com>
2022-06-16 06:37:44 -05:00
Michael Angerman
cfe4eff566
update default_context.rs to put the Du command in platform instead core (#5795) 2022-06-15 11:11:26 -07:00
Fernando Herrera
38f3957edf
update polars (#5791) 2022-06-15 11:45:03 -05:00
JT
d1c719a8cc
bump to 0.64 (#5777)
Co-authored-by: sholderbach <sholderbach@users.noreply.github.com>
2022-06-15 14:39:17 +12:00
WindSoilder
4d854f36af
add --values flag to sort record by values, by default, sort record by keys (#5782) 2022-06-14 20:42:22 -05:00
Fernando Herrera
8d5848c955
bool type for binary operations (#5779)
* bool type for binary operations

* fixed type in commands
2022-06-14 20:31:14 -05:00
Stefan Holderbach
fe88d58b1e
Pin reedline v0.7.0 for the nushell v0.64.0 release (#5781)
Includes the new History API and sqlite history backend

Release notes: https://github.com/nushell/reedline/releases/tag/v0.7.0
2022-06-14 23:21:14 +02:00
phiresky
42dbfd1fa0
SQLite History MVP with timestamp, duration, working directory, exit status metadata (#5721)
This PR adds support for an SQLite history via nushell/reedline#401

The SQLite history is enabled by setting history_file_format: "sqlite" in config.nu.

* somewhat working sqlite history
* Hook up history command
* Fix error in SQlitebacked with empty lines

When entering an empty line there previously was the "No command run"
error with `SqliteBackedHistory` during addition of the metadata

May be considered a temporary fix

Co-authored-by: sholderbach <sholderbach@users.noreply.github.com>
2022-06-14 22:53:33 +02:00
Fernando Herrera
ff946a2f21
each while command (#5771)
* each while command

* test value adjustment
2022-06-14 16:16:31 +02:00
WindSoilder
3c0cbec993
sort not change shape (#5778) 2022-06-14 06:41:45 -05:00
WindSoilder
48e29e9ed6
path join support multi path (#5775) 2022-06-14 06:34:00 -05:00
pwygab
ff53352afe
Add option to sort-by naturally (#5774)
* add `natural` option to sort-by

* clippy

* Add tests
2022-06-14 09:03:13 +03:00
Mathspy
4fd4136d50
Should we keep old semantics of uniq command? (#5761)
* Update uniq tests with less surprising output

* Remove original nushell surprising semantics
2022-06-14 16:04:29 +12:00
Stefan Stanciulescu
dc1248a454
Fix drop nth bug (#5312)
* Fix drop nth bug on ranges. Should fix & close #5260

* Fix drop nth bug on ranges. Should fix & close #5260

* Add support for ranges

* Working version of drop nth, but the issue is that we unwrap the value which is problematic for Streams. Should convert to the way @stormasm was doing it before and implement the range check

* Fix fmt issue

* Drop nth now works for Lists, Records, and Ranges. We need support for ListStreams and for ExternalStreams

* Keep consistent naming

* Fix fmt issue

* Support ListStreams for drop nth

* Use DropNthIterator instead

* Found a more elegant way to deal with the check for no upper bound input

* Add extra checks for negative inputs or to < from for ranges

Co-authored-by: Stefan Stanciulescu <test@test.com>
2022-06-13 20:49:59 -07:00
Fernando Herrera
de554f8e5f
filesize conversion (#5770) 2022-06-13 14:44:32 -05:00
Fernando Herrera
44979f3051
expression to literal (#5769) 2022-06-13 13:22:46 -05:00
JT
7ae7394c85
Force floats to output a decimal in nuon (#5768)
* Force floats to output a decimal in nuon

* Add test
2022-06-14 05:45:07 +12:00
Darren Schroeder
9dbf7556b8
more verbose error handling (#5765) 2022-06-13 07:01:00 -05:00
pwygab
caafd26deb
Attempts to add // math operator (#5759)
* attempts to add `div` math operator

* allows `//` to be used too

* fmt:

* clippy issue

* returns appropriate type

* returns appropriate type 2

* fmt

* ensure consistency; rename to `fdiv`

* Update parser.rs
2022-06-13 13:54:47 +03:00
Fernando Herrera
11d7d8ea1e
Remove dfr from dataframe commands (#5760)
* input and output tests

* input and output types for dfr

* expression converter

* remove deprecated command

* correct expressions

* cargo clippy

* identifier for ls

* cargo clippy

* type for head and tail expression

* modify full cell path if block
2022-06-12 14:18:00 -05:00
Fernando Herrera
d5b99ae316
input and output types (#5750)
* input and output types

* added description

* type from stored variable

* string in custom value

* more tests with non custom
2022-06-10 10:59:35 -05:00
WindSoilder
b42ef45c7c
add as record tag to transfer result to record (#5736)
* add as record tag to transfer result to record

* tweak text

Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
2022-06-08 07:00:19 -05:00
pwygab
3423cd54a1
add search terms to alias (#5737) 2022-06-08 06:22:53 -05:00
Darren Schroeder
c57f41e5f2
make to text work more intuitively (#5733) 2022-06-07 14:43:24 -05:00
pwygab
8318d59ef1
improve str substring (#5730) 2022-06-07 06:09:16 -05:00
Justin Ma
64efa30f3e
fix: normalize some parameter names (#5725) 2022-06-06 09:42:13 -05:00