nushell/src
Stefan Holderbach 57510f2fd2
Move CLI related commands to nu-cli (#8832)
# Description

Part of the larger cratification effort.

Moves all `reedline` or shell line editor specific commands to `nu-cli`.

## From `nu-cmd-lang`:
- `commandline`
- This shouldn't have moved there. Doesn't directly depend on reedline
but assumes parts in the engine state that are specific to the use of
reedline or a REPL

## From `nu-command`:
- `keybindings` and subcommands
  - `keybindings default`
  - `keybindings list`
  - `keybindings listen`
    - very `reedline` specific
- `history`
  - needs `reedline`
- `history session`

## internal use
Instead of having a separate `create_default_context()` that calls
`nu-command`'s `create_default_context()`, I added a `add_cli_context()`
that updates an `EngineState`


# User-Facing Changes

None

## Build time comparison

`cargo build --timings` from a `cargo clean --profile dev`

### total
main: 64 secs
this: 59 secs

### `nu-command` build time

branch | total| codegen | fraction  
---|---|---|---
main | 14.0s | 6.2s | (44%)
this | 12.5s | 5.5s | (44%)

`nu-cli` depends on `nu-command` at the moment.
Thus it is built during the code-gen phase of `nu-command` (on 16
virtual cores)

# Tests + Formatting

I removed the `test_example()` facilities for now as we had not run any
of the commands in an `Example` test and importing the right context for
those tests seemed more of a hassle than the duplicated
`test_examples()` implementations in `nu-cmd-lang` and `nu-command`
2023-04-10 10:56:47 +12:00
..
tests allow register to accept a const argument (#8758) 2023-04-08 15:04:57 -05:00
command.rs Add option to not load std-lib. Default tests to not use std-lib (#8833) 2023-04-10 10:55:29 +12:00
config_files.rs remove nu_cli crate dependency from nu_std (#8807) 2023-04-08 13:53:43 +02:00
ide.rs remove nu_cli crate dependency from nu_std (#8807) 2023-04-08 13:53:43 +02:00
logger.rs Use variable names directly in the format strings (#7906) 2023-01-29 19:37:54 -06:00
main.rs Move CLI related commands to nu-cli (#8832) 2023-04-10 10:56:47 +12:00
README.md Remove old nushell/merge engine-q 2022-02-07 14:54:06 -05:00
run.rs Add option to not load std-lib. Default tests to not use std-lib (#8833) 2023-04-10 10:55:29 +12:00
signals.rs Cleanup of src/main.rs (#7801) 2023-01-20 10:44:49 -08:00
terminal.rs Move all functions of main.rs into modules (#7803) 2023-01-20 13:20:38 -08:00
test_bins.rs Move CLI related commands to nu-cli (#8832) 2023-04-10 10:56:47 +12:00
tests.rs Fix parser recovery after error (#8798) 2023-04-08 07:01:12 +12: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.