nushell/crates/nu-cli/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
..
commands Move CLI related commands to nu-cli (#8832) 2023-04-10 10:56:47 +12:00
completions Only add the std lib files once (#8830) 2023-04-10 08:55:47 +12:00
menus Use variable names directly in the format strings (#7906) 2023-01-29 19:37:54 -06:00
config_files.rs remove nu_cli crate dependency from nu_std (#8807) 2023-04-08 13:53:43 +02:00
eval_cmds.rs Move CLI related commands to nu-cli (#8832) 2023-04-10 10:56:47 +12:00
eval_file.rs remove nu_cli crate dependency from nu_std (#8807) 2023-04-08 13:53:43 +02:00
lib.rs Move CLI related commands to nu-cli (#8832) 2023-04-10 10:56:47 +12:00
nu_highlight.rs Box ShellError in Value::Error (#8375) 2023-03-12 09:57:27 +01:00
print.rs print pipeline contents in print (#8305) 2023-03-04 11:31:01 +13:00
prompt_update.rs remove nu_cli crate dependency from nu_std (#8807) 2023-04-08 13:53:43 +02:00
prompt.rs Make the default prompt play nice with basic fonts (#8080) 2023-03-02 13:59:32 +13:00
reedline_config.rs Remove old alias implementation (#8797) 2023-04-07 21:09:38 +03:00
repl.rs remove nu_cli crate dependency from nu_std (#8807) 2023-04-08 13:53:43 +02:00
syntax_highlight.rs Remove old alias implementation (#8797) 2023-04-07 21:09:38 +03:00
util.rs remove nu_cli crate dependency from nu_std (#8807) 2023-04-08 13:53:43 +02:00
validation.rs Remove old alias implementation (#8797) 2023-04-07 21:09:38 +03:00