Commit Graph

125 Commits

Author SHA1 Message Date
Leon
5add5cbd12
Further edits to help messages (#6913) 2022-10-26 09:36:42 -07:00
WindSoilder
b47bd22b37
Removes export env command (#6468)
* remove export_env command

* remove several export env usage in test code

* adjust hiding relative test case

* fix clippy

* adjust tests

* update tests

* unignore these tests to expose ut failed

* using `use` instead of `overlay use` in some tests

* Revert "using `use` instead of `overlay use` in some tests"

This reverts commit 2ae24b24c3.

* Revert "adjust hiding relative test case"

This reverts commit 4369af6d05.

* Bring back module example

* Revert "update tests"

This reverts commit 6ae94ef513.

* Fix tests

* "Fix" a test

* Remove remaining deprecated env functionality

* Re-enable environment hiding for `hide`

To not break virtualenv since the overlay update is not merged yet

* Fix hiding env in `hide` and ignore some tests

Co-authored-by: kubouch <kubouch@gmail.com>
2022-09-25 19:52:43 +03:00
Dan Davison
ad0c6bf7d5
Improve "Did you mean?" suggestions (#6579)
* Copy lev_distance.rs from the rust compiler

* Minor changes to code from rust compiler

* "Did you mean" suggestions: test instrumented to generate markdown report

* Did you mean suggestions: delete test instrumentation

* Fix tests

* Fix test

`foo` has a genuine match: `for`

* Improve tests
2022-09-20 19:46:01 -05:00
Dan Davison
4926865c4e
str collect => str join (#6531)
* Initialize join.rs as a copy of collect.rs

* Evolve StrCollect into StrJoin

* Replace 'str collect' with 'str join' everywhere

git ls-files | lines | par-each { |it| sed -i 's,str collect,str join,g' $it }

* Deprecate 'str collect'

* Revert "Deprecate 'str collect'"

This reverts commit 959d14203e.

* Change `str collect` help message to say that it is deprecated

We cannot remove `str collect` currently (i.e. via
`nu_protocol::ShellError::DeprecatedCommand` since a prominent project
uses the API:

b85542c31c/src/virtualenv/activation/nushell/activate.nu (L43)
2022-09-11 11:48:27 +03:00
adamijak
14512988ba
Rename all?, any? and empty? (#6464)
Rename `all?`, `any?` and `empty?` to `all`, `any` and `is-empty` for sake of simplicity and consistency.

- More understandable for newcomers, that these commands are no special to others.
- `?` syntax did not really aprove readability. For me it made it worse.
- We can reserve `?` syntax for any other nushell feature.
2022-09-05 16:41:06 +02:00
Darren Schroeder
2591bd8c63
add more color highlighting to help (#6449) 2022-08-31 20:15:03 +12:00
nibon7
839b264261
Add test cases for $nu.config-path change (#6385)
* Add test cases for $nu.config-path change

Part of #6366

Signed-off-by: nibon7 <nibon7@163.com>

* do not start a new process to test default config path

Signed-off-by: nibon7 <nibon7@163.com>

Signed-off-by: nibon7 <nibon7@163.com>
2022-08-23 10:18:14 +03:00
Jakub Žádník
20528e96c7
Add hide-env to hide environment variables (#6313)
* Add hide-env to hide env vars; Cleanup tests

Also, there were some old unalias tests that I converted to hide.

* Add missing file

* Re-enable hide for env vars

* Fix test

* Rename did you mean error back

It was causing random tests to break
2022-08-13 12:55:06 +03:00
Justin Ma
48f1c3a49e
add bits ror and bits rol commands (#6224) 2022-08-05 15:40:01 +02:00
Darren Schroeder
cdeb8de75d
replace the regex crate with the fancy-regex crate (#6227) 2022-08-04 14:51:02 -05:00
Justin Ma
ce6df93d05
Add bits shl and bits shr command (#6202)
* Add `bits shift-left` and `bits shift-right` command

* update bits shift error tips

* some code refactor

* update shift right

* some code refactor for bits shift commands

* rename bits shift commands align with bits operators

* update search term

* Update crates/nu-command/src/bits/not.rs

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

* Update crates/nu-command/src/bits/shift_left.rs

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

* Update crates/nu-command/src/bits/shift_right.rs

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

* ci skip

* change default number-bytes for bits shift

* fix bits not tests

* fix bits tests

Co-authored-by: Stefan Holderbach <sholderbach@users.noreply.github.com>
2022-08-02 15:52:04 -05:00
Justin Ma
6a4eabf5c7
Add bits or and bits xor command (#6190) 2022-07-30 13:26:37 -05:00
Justin Ma
0e2c888f73
Add bits root command and bits and command (#6188) 2022-07-30 07:34:11 -05:00
JT
9695331eed
require variable names to follow additional restrictions (#6125) 2022-07-27 14:08:54 +12:00
nibon7
86a0e77065
Fix print_table_or_error when table is overridden (#6130)
Related #6113

Signed-off-by: nibon7 <nibon7@163.com>
2022-07-25 20:11:46 -05:00
nibon7
72c27bd095
Fix PipelineData::print when table is overridden (#6129)
* Fix PipelineData::print when `table` is overridden

Fixes #6113

Signed-off-by: nibon7 <nibon7@163.com>

* don't use deprecated `is_custom_command`

Signed-off-by: nibon7 <nibon7@163.com>

* add test

Signed-off-by: nibon7 <nibon7@163.com>
2022-07-25 18:41:30 -05:00
JT
475d32045f
Revert "Refactor external command (#6083)" (#6116)
This reverts commit 0646f1118c.
2022-07-26 05:37:15 +12:00
Kangaxx-0
0646f1118c
Refactor external command (#6083)
Co-authored-by: Frank <v-frankz@microsoft.com>
2022-07-21 19:56:57 -04:00
Justin Ma
4e90b478b7
Add bit operator: bit-xor (#5940) 2022-07-03 06:45:20 -05:00
JT
a48616697a
Rename bitwise operators for readability (#5937) 2022-07-02 17:05:02 -05:00
Justin Ma
b82dccf0bd
Add band and bor operator for bit operations (#5936)
* Add `band` and `bor` Operator

* Add tests
2022-07-02 13:03:36 -05:00
Justin Ma
3917fda7ed
Update #4202: Add shift operator bshl and bshr for integers (#5928)
* Update #4202: Add shift operator bshl and bshr for integers

* Add more tests
2022-07-02 06:48:43 -05:00
Fernando Herrera
ff946a2f21
each while command (#5771)
* each while command

* test value adjustment
2022-06-14 16:16:31 +02:00
Justin Ma
d44059c36b
feat: Add sensitive flag to get, fix #4295 (#5685)
* feat: Add insensitive flag to get, fix #4295

* add get insensitive example

* Fix get flags

* Update get examples
2022-06-01 08:34:42 -05:00
Clements
46eb34b35d
Differentiate internal signature from external signature w.r.t. help (#5667)
* Differentiate internal signature from external signature w.r.t. help

* Add in the --help flag to default externs in default config

* Remove unusued build_extern

Co-authored-by: mjclements <clements.michael.james@gmail.com>
2022-05-29 15:14:15 +02:00
WindSoilder
9e5e9819d6
adjust flatten default behavior (#5606) 2022-05-21 08:32:51 -05:00
panicbit
49cbc30974
Add ends-with operator and fix dataframe operator behavior (#5395)
* add ends-with operator

* escape needles in dataframe operator regex patterns
2022-05-02 20:02:38 +12:00
JT
4a69819f9a
Rename =^ to 'starts-with' (#5407) 2022-05-02 19:20:07 +12:00
JT
f16401152b
Make if else more lazy (#5386) 2022-05-01 09:13:21 +12:00
JT
be3f0edc97
Fix 'range' range exclusive (#5334) 2022-04-26 13:39:38 -05:00
JT
ee29a15119
Add 'and' and 'or' operators (#5297) 2022-04-23 07:14:31 +12:00
JT
76079d5183
Move config to be an env var (#5230)
* Move config to be an env var

* fix fmt and tests
2022-04-19 10:28:01 +12:00
Hristo Filaretov
cf65f77b02
Simplify known external tests (#5219)
* Simplify known external tests

* Cargo fmt
2022-04-17 14:31:03 -05:00
Hristo Filaretov
7710317224
Add known external tests (#5216)
* Add known external tests

* Add some documentation to the tests

* Document test_hello example

* Set PWD in run_test
2022-04-17 05:39:56 -05:00
Boy van Duuren
594006cfa0
Fix failing unit tests on Windows (#5142) (#5143)
* Fix failing unit tests on Windows (#5142)

Fix let_env_expressions failing on Windows:
The env expression uses PATH, but on windows Path is used.

Fix correctly_escape_external_arguments, execute_binary_in_string
failing on Windows:
Using cococo now to make sure testresults are platform independent

* Update macros.rs

Co-authored-by: JT <547158+jntrnr@users.noreply.github.com>
2022-04-12 06:18:46 +12:00
JT
14066ccc30
Fix known externals, fix operator spans (#5140) 2022-04-09 17:17:48 +12:00
JT
97eb8492a3
Improve $in handling (#5137)
* Simplify in logic

* Add tests

* more tests, and fixes
2022-04-09 09:41:05 +12:00
JT
0b85938415
Soften the block arity checking (#5135) 2022-04-09 07:57:27 +12:00
Reilly Wood
b2c52b51b7
Change string contains operators to regex (#5117) 2022-04-07 18:23:14 +12:00
JT
888369022f
Add datetime to math-like (#5118)
* Add datetime to math-like

* add test
2022-04-07 18:02:28 +12:00
JT
591fb4bd36
Add unary not (#5111) 2022-04-07 07:10:25 +12:00
JT
6649da3f5d
Add support for single value row conditions (#5072) 2022-04-03 10:41:36 +12:00
Darren Schroeder
2cb815b7b4
Add starts with operator (#5061)
* add starts_with operator

* added a test
2022-04-01 13:35:46 -05:00
JT
4bb95a880f
let a simple last be a single value (#5060) 2022-04-01 23:12:31 +13:00
JT
cf88c8eef3
Improve escaping in string interpolation (#4982) 2022-03-27 12:52:09 +13:00
Hristo Filaretov
8a9cc33aac
Fix alias import (#4968)
* Fix alias import

Alias importing was registering the alias id as a decl instead of alias.
This caused issues when hiding and then reimporting the alias.

* Clippy format

Co-authored-by: Hristo Filaretov <h.filaretov@protonmail.com>
2022-03-25 17:56:40 -05:00
JT
bd5778fa24
remove the boolean vars (#4879) 2022-03-20 08:12:10 +13:00
JT
f3bb1d11d3
Add export alias and export extern (#4878)
* export alias

* export extern
2022-03-20 07:58:01 +13:00
JT
d0cbb2d12c
Allow expanding aliases before keywords, improve hiding (#4858)
* Allow aliasing source

* Add test

* improve hiding

* Finish adding tests

* fix test
2022-03-18 11:35:50 +13:00
Darren Schroeder
6700fbeed7
rename update to upsert to mirror what it really does (#4859)
* rename `update` to `upsert` to mirror what it really does

* change to latest reedline and nu-ansi-term
2022-03-16 19:13:34 -05:00