nushell/src
Douglas 1c18e37a7c
Always populate config record during startup (#14435)
# Description

As a bit of a follow-on to #13802 and #14249, this (pretty much a
"one-line" change) really does *always* populate the `$env.config`
record with the `nu-protocol::config` defaults during startup. This
means that an `$env.config` record is value (with defaults) even during:

* `nu -n` to suppress loading of config files
* `nu -c <commandstring>`
* `nu <script>`

# User-Facing Changes

There should be no case in which there isn't a valid `$env.config`.

* Before:

  ```nushell
  nu -c "$env.config"
  # -> Error
  ```

* After:

  ```nushell
  nu -c "$env.config"
  # -> Default $env.config record
  ```

Startup time impact is negligible (17.072µs from `perf!` on my system) -
Seems well worth it.

# Tests + Formatting

Added tests for several `-n -c` cases.

- 🟢 `toolkit fmt`
- 🟢 `toolkit clippy`
- 🟢 `toolkit test`
- 🟢 `toolkit test stdlib`

# After Submitting

Config chapter update still in progress.
2024-11-27 13:52:47 +08:00
..
command.rs Fix quoting in to nuon and refactor quoting functions (#14180) 2024-10-29 07:43:26 -05:00
config_files.rs Always load default env/config values (#14249) 2024-11-20 16:15:15 -06:00
ide.rs Remove as_i64 and as_f64 (#14258) 2024-11-05 09:28:56 +01:00
logger.rs Add options for filtering the log output from nu (#13044) 2024-06-05 16:42:55 +08:00
main.rs Always populate config record during startup (#14435) 2024-11-27 13:52:47 +08:00
README.md Remove old nushell/merge engine-q 2022-02-07 14:54:06 -05:00
run.rs Always load default env/config values (#14249) 2024-11-20 16:15:15 -06:00
signals.rs fix: relay Signals reset to plugins (#13510) 2024-08-06 03:35:40 -07:00
terminal.rs Deduplicate nix dependency versions (#12307) 2024-03-27 16:43:37 +01:00
test_bins.rs Remove the NU_DISABLE_IR option (#14293) 2024-11-15 12:09:25 +08:00

Nushell REPL

This directory contains the main Nushell REPL (read eval print loop) as part of the CLI portion of Nushell, which creates the nu binary itself.

Current versions of the nu binary will use the Nu argument parsing logic to parse the commandline arguments passed to nu, leaving the logic here to be a thin layer around what the core libraries.