nushell/src
WindSoilder 6cfe35eb7e
enable to pass switch values dynamically (#11057)
# Description
Closes: #7260 

About the change:
When we make an internalcall, and meet a `switch` (Flag.arg is None),
nushell will try to see if the switch is called like `--xyz=false` , if
that is true, `parse_long_flag` will return relative value.

# User-Facing Changes
So after the pr, the following would be possible:
```nushell
def build-imp [--push, --release] {
    echo $"Doing a build with push: ($push) and release: ($release)"
}
def build [--push, --release] {
    build-imp --push=$push --release=$release
}

build --push --release=false
build --push=false --release=true
build --push=false --release=false
build --push --release
build
```

# Tests + Formatting
Done

# After Submitting
Needs to submit a doc update, mentioned about the difference between
`def a [--x] {}` and `def a [--x: bool] {}`
2023-11-23 06:57:37 +08:00
..
tests enable to pass switch values dynamically (#11057) 2023-11-23 06:57:37 +08:00
command.rs Apply nightly clippy fixes (#11083) 2023-11-17 09:15:55 -06:00
config_files.rs Improve case insensitivity consistency (#10884) 2023-11-08 23:58:54 +01:00
ide.rs Convert FileNotFoundCustom to named fields (#11123) 2023-11-21 17:30:21 -06:00
logger.rs Use variable names directly in the format strings (#7906) 2023-01-29 19:37:54 -06:00
main.rs Implement LSP Text Document Synchronization (#10941) 2023-11-15 17:35:48 -06:00
README.md Remove old nushell/merge engine-q 2022-02-07 14:54:06 -05:00
run.rs allow --login to be used with nu's --commands parameter (#10253) 2023-09-06 13:27:16 -05:00
signals.rs Cleanup of src/main.rs (#7801) 2023-01-20 10:44:49 -08:00
terminal.rs Fix rm on macOS (#10282) 2023-09-08 19:03:30 -05:00
test_bins.rs Move eval_hook to nu-cmd-base (#10146) 2023-08-29 23:46:50 +02:00
tests.rs Spread operator for list literals (#11006) 2023-11-22 23:10:08 +02: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.