2
0
Fork 0
mirror of https://github.com/nushell/nushell synced 2025-02-14 21:18:49 +00:00
Commit graph

1790 commits

Author SHA1 Message Date
JT
475d32045f
Revert "Refactor external command ()" ()
This reverts commit 0646f1118c.
2022-07-26 05:37:15 +12:00
JT
46f64c6fdc
exit with non-zero exit code when script ends with non-zero exit () 2022-07-25 10:57:10 +12:00
nibon7
0812a08bfb
Don't panic if nu failed to create config files ()
* Don't panic if nu failed to create config files

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

* eval default config

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

* tweak words

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

* tweak words again

Signed-off-by: nibon7 <nibon7@163.com>
2022-07-24 07:00:52 -05:00
Kangaxx-0
0646f1118c
Refactor external command ()
Co-authored-by: Frank <v-frankz@microsoft.com>
2022-07-21 19:56:57 -04:00
Mathspy
9aabafeb41
Add plugin CLI argument ()
* Add plugin CLI argument

While working on supporting CustomValues in Plugins I stumbled upon the
test utilities defined in [nu-test-support][nu-test-support]
and thought these will come in handy, but they end up being outdated.
They haven't been used or since engine-q's was merged, so they are
currently using the old way engine-q handled plugins, where it would
just look into a specific folder for plugins and call them without
signatures or registration. While fixing that I realized that there is
currently no way to tell nushell to load and save signatures into a
specific path, and so those integration tests could end up potentially
conflicting with each other and with the local plugins the person
running them is using.

So this adds a new CLI argument to specify where to store and load
plugin signatures from

I am not super sure of the way I implemented this, mainly
I was a bit confused about the distinction between
[src/config_files.rs][src/config_files.rs] and
[crates/nu-cli/src/config_files.rs][crates/nu-cli/src/config_files.rs].
Should I be moving the plugin loading function from the `nu-cli` one to
the root one?

[nu-test-support]: 9d0be7d96f/crates/nu-test-support/src/macros.rs (L106)
[src/config_files.rs]: 9d0be7d96f/src/config_files.rs
[crates/nu-cli/src/config_files.rs]: 9d0be7d96f/crates/nu-cli/src/config_files.rs

* Gate new CLI option behind plugin feature

* Rename option to plugin-config
2022-07-17 13:29:19 -05:00
Jakub Žádník
26f31da711
Split merging of parser delta and stack environment ()
* Remove comment

* Split delta and environment merging

* Move table mode to a more logical place

* Cleanup

* Merge environment after reading default_env.nu

* Fmt
2022-07-14 17:09:27 +03:00
WindSoilder
ed50210832
load default env when user don't specified env path () 2022-07-14 08:53:13 +03:00
Jakub Žádník
920e0acb85
Fix load order of config files () 2022-07-10 18:12:24 +03:00
Jakub Žádník
b7d3623e53
Revert "make module imports in scripts used for relative path. ()" ()
This reverts commit 6dde231dde.
2022-07-10 15:16:46 +03:00
Justin Ma
4e90b478b7
Add bit operator: bit-xor () 2022-07-03 06:45:20 -05:00
JT
a48616697a
Rename bitwise operators for readability () 2022-07-02 17:05:02 -05:00
Justin Ma
b82dccf0bd
Add band and bor operator for bit operations ()
* Add `band` and `bor` Operator

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

* Add more tests
2022-07-02 06:48:43 -05:00
WindSoilder
6dde231dde
make module imports in scripts used for relative path. ()
* always load env

* add interactive argument for read_config_file
2022-07-01 06:35:09 -05:00
WindSoilder
fab3f8fd40
fix exit code ()
* fix exit code

* fix usage

* add comment
2022-06-20 09:05:11 -05:00
phiresky
42dbfd1fa0
SQLite History MVP with timestamp, duration, working directory, exit status metadata ()
This PR adds support for an SQLite history via 

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 ()
* each while command

* test value adjustment
2022-06-14 16:16:31 +02:00
WindSoilder
2dea9e6f1f
fix arg parse ()
* fix arg parse

* add ut, fix clippy

* simplify code

* fmt code
2022-06-11 20:52:31 +12:00
WindSoilder
c5cb369d8d
While starting nu, force PWD to be current working directory ()
* fix current working directory during start

* fix tests

* always set PWD to current_dir
2022-06-10 13:01:08 -05:00
WindSoilder
2e0b964d5b
handle SIGQUIT ()
* handle sigquit

* fix clippy
2022-06-09 07:08:15 -05:00
sec65
3c421c5726
Added loginshell config file ()
* Added loginshell config file 

* added sample login.nu

* added environment variable loginshell-path
2022-06-06 06:52:37 -05:00
Justin Ma
d44059c36b
feat: Add sensitive flag to get, fix ()
* feat: Add insensitive flag to get, fix 

* 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 ()
* 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
a8db4f0b0e
load config when requried () 2022-05-23 15:47:08 +03:00
WindSoilder
9e5e9819d6
adjust flatten default behavior () 2022-05-21 08:32:51 -05:00
Reilly Wood
633ebc7e43
Revert "Enable backtraces by default ()" ()
This reverts commit 8004e8e2a0.
2022-05-17 15:02:45 -07:00
Darren Schroeder
f0cb2f38df
refactor all write_alls to ensure flushing () 2022-05-17 13:28:18 -05:00
Reilly Wood
8004e8e2a0
Enable backtraces by default () 2022-05-16 17:04:41 -07:00
Darren Schroeder
0b95465ea1
add --table_mode -m parameter ()
* add `--table_mode` `-m` parameter

* underscores to dashes
2022-05-11 16:15:31 -05:00
pwygab
8d8f25b210
Fixing the flag issue ()
* Fixing the flag issue

* whoops, forgot the original point of the function

* Update deparse.rs

* Update deparse.rs

* Update deparse.rs

* maybe this might work

* fmt

* quotation marks works now due to a rigorous check for args.

* fmt and clippy

* kept the original escape_quote_string(), escaped " and \

* removed script.nu

* Added appropriate comments.
2022-05-09 07:01:58 -05:00
panicbit
49cbc30974
Add ends-with operator and fix dataframe operator behavior ()
* 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' () 2022-05-02 19:20:07 +12:00
JT
96f8691c8d
More escaping/unescaping fixes () 2022-05-02 09:49:31 +12:00
JT
f16401152b
Make if else more lazy () 2022-05-01 09:13:21 +12:00
Tomoki Aonuma
ae9c0fc138
Fix quoting for command line args ()
* Fix quoting for command line args

* Replace custom quoting with escape_quote_string

* Use raw string for now
2022-04-30 13:23:05 -05:00
JT
be3f0edc97
Fix 'range' range exclusive () 2022-04-26 13:39:38 -05:00
JT
ec611526ac
Warn if we see let config = ../.. () 2022-04-25 08:40:55 +12:00
JT
ee29a15119
Add 'and' and 'or' operators () 2022-04-23 07:14:31 +12:00
JT
96253c69fb
Use better quoting for commandline args () 2022-04-21 15:31:52 +12:00
JT
76079d5183
Move config to be an env var ()
* 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 ()
* Simplify known external tests

* Cargo fmt
2022-04-17 14:31:03 -05:00
Hristo Filaretov
7710317224
Add known external tests ()
* 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 () ()
* Fix failing unit tests on Windows ()

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 () 2022-04-09 17:17:48 +12:00
JT
97eb8492a3
Improve $in handling ()
* Simplify in logic

* Add tests

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

* add test
2022-04-07 18:02:28 +12:00
JT
591fb4bd36
Add unary not () 2022-04-07 07:10:25 +12:00
Jakub Žádník
12d3e4e424
Add env.nu file for environment config ()
* Add env.nu file for environment config

* Add missing flag

* Add $nu.env-path variable

Prints `env.nu` path

* Add example of adding entries to PATH
2022-04-07 05:11:51 +12:00