Merge stream_example into example plugin and clean up names (#12234)

# Description

As suggested by @WindSoilder, since plugins can now contain both simple
commands that produce `Value` and commands that produce `PipelineData`
without having to choose one or the other for the whole plugin, this
change merges `stream_example` into `example`.

# User-Facing Changes

All of the example plugins are renamed.

# Tests + Formatting

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

# After Submitting

- [ ] Check nushell/nushell.github.io for any docs that match the
command names changed
This commit is contained in:
Devyn Cairns
2024-03-19 10:36:46 -07:00
committed by GitHub
parent 02551c416c
commit a29efe28f7
28 changed files with 197 additions and 305 deletions

View File

@ -7,9 +7,9 @@ fn get_env_by_name() {
plugin: ("nu_plugin_example"),
r#"
$env.FOO = bar
nu-example-env FOO | print
example env FOO | print
$env.FOO = baz
nu-example-env FOO | print
example env FOO | print
"#
);
assert!(result.status.success());
@ -21,7 +21,7 @@ fn get_envs() {
let result = nu_with_plugins!(
cwd: ".",
plugin: ("nu_plugin_example"),
"$env.BAZ = foo; nu-example-env | get BAZ"
"$env.BAZ = foo; example env | get BAZ"
);
assert!(result.status.success());
assert_eq!("foo", result.out);
@ -37,7 +37,7 @@ fn get_current_dir() {
let result = nu_with_plugins!(
cwd: ".",
plugin: ("nu_plugin_example"),
"cd tests; nu-example-env --cwd"
"cd tests; example env --cwd"
);
assert!(result.status.success());
assert_eq!(cwd, result.out);
@ -48,7 +48,7 @@ fn set_env() {
let result = nu_with_plugins!(
cwd: ".",
plugin: ("nu_plugin_example"),
"nu-example-env NUSHELL_OPINION --set=rocks; $env.NUSHELL_OPINION"
"example env NUSHELL_OPINION --set=rocks; $env.NUSHELL_OPINION"
);
assert!(result.status.success());
assert_eq!("rocks", result.out);