nushell/crates/nu-command/src/core_commands
Stefan Holderbach 735a7a21bd
Add example showing first class closure to do (#7473)
# Description

Demonstrates that you can use `do` to execute stored closures and
evaluate their captures properly.

# Tests + Formatting

As an example test increases coverage of the usage to execute first
class closures.
Additional tests using that found in
`tests/shell/pipeline/commands/internal.rs`
2022-12-14 20:55:00 +01:00
..
overlay Simplify FILE_PWD setting in 'overlay use' (#7425) 2022-12-10 19:23:55 +02:00
alias.rs Improve empty pipelines (#7383) 2022-12-08 07:31:57 +13:00
ast.rs Improve empty pipelines (#7383) 2022-12-08 07:31:57 +13:00
break_.rs New commands: break, continue, return, and loop (#7230) 2022-11-25 09:39:16 +13:00
commandline.rs Declare input and output types of commands (#6796) 2022-11-10 10:55:05 +13:00
continue_.rs New commands: break, continue, return, and loop (#7230) 2022-11-25 09:39:16 +13:00
debug.rs Declare input and output types of commands (#6796) 2022-11-10 10:55:05 +13:00
def_env.rs Reduced LOC by replacing several instances of Value::Int {}, Value::Float{}, Value::Bool {}, and Value::String {} with Value::int(), Value::float(), Value::boolean() and Value::string() (#7412) 2022-12-09 11:37:51 -05:00
def.rs Improve empty pipelines (#7383) 2022-12-08 07:31:57 +13:00
describe.rs Declare input and output types of commands (#6796) 2022-11-10 10:55:05 +13:00
do_.rs Add example showing first class closure to do (#7473) 2022-12-14 20:55:00 +01:00
echo.rs Reduced LOC by replacing several instances of Value::Int {}, Value::Float{}, Value::Bool {}, and Value::String {} with Value::int(), Value::float(), Value::boolean() and Value::string() (#7412) 2022-12-09 11:37:51 -05:00
error_make.rs Protocol: debug_assert!() Span to reflect a valid slice (#6806) 2022-12-03 11:44:12 +02:00
export_alias.rs Improve empty pipelines (#7383) 2022-12-08 07:31:57 +13:00
export_def_env.rs Reduced LOC by replacing several instances of Value::Int {}, Value::Float{}, Value::Bool {}, and Value::String {} with Value::int(), Value::float(), Value::boolean() and Value::string() (#7412) 2022-12-09 11:37:51 -05:00
export_def.rs Reduced LOC by replacing several instances of Value::Int {}, Value::Float{}, Value::Bool {}, and Value::String {} with Value::int(), Value::float(), Value::boolean() and Value::string() (#7412) 2022-12-09 11:37:51 -05:00
export_extern.rs Improve empty pipelines (#7383) 2022-12-08 07:31:57 +13:00
export_use.rs Reduced LOC by replacing several instances of Value::Int {}, Value::Float{}, Value::Bool {}, and Value::String {} with Value::int(), Value::float(), Value::boolean() and Value::string() (#7412) 2022-12-09 11:37:51 -05:00
export.rs Reduced LOC by replacing several instances of Value::Int {}, Value::Float{}, Value::Bool {}, and Value::String {} with Value::int(), Value::float(), Value::boolean() and Value::string() (#7412) 2022-12-09 11:37:51 -05:00
extern_.rs Improve empty pipelines (#7383) 2022-12-08 07:31:57 +13:00
for_.rs break for, loop, while execution when external command runs to failed (#7475) 2022-12-14 16:20:18 +01:00
help_operators.rs Revert "Add pipeline operators to help" (#7454) 2022-12-13 16:49:00 +13:00
help.rs Reduced LOC by replacing several instances of Value::Int {}, Value::Float{}, Value::Bool {}, and Value::String {} with Value::int(), Value::float(), Value::boolean() and Value::string() (#7412) 2022-12-09 11:37:51 -05:00
hide_env.rs Improve empty pipelines (#7383) 2022-12-08 07:31:57 +13:00
hide.rs Improve empty pipelines (#7383) 2022-12-08 07:31:57 +13:00
if_.rs Add OneOf shape to fix else (#7385) 2022-12-08 08:58:54 +13:00
ignore.rs Improve empty pipelines (#7383) 2022-12-08 07:31:57 +13:00
let_.rs Improve empty pipelines (#7383) 2022-12-08 07:31:57 +13:00
loop_.rs break for, loop, while execution when external command runs to failed (#7475) 2022-12-14 16:20:18 +01:00
metadata.rs Reduced LOC by replacing several instances of Value::Int {}, Value::Float{}, Value::Bool {}, and Value::String {} with Value::int(), Value::float(), Value::boolean() and Value::string() (#7412) 2022-12-09 11:37:51 -05:00
mod.rs add help operators command (#7254) 2022-11-27 21:03:17 +13:00
module.rs Reduced LOC by replacing several instances of Value::Int {}, Value::Float{}, Value::Bool {}, and Value::String {} with Value::int(), Value::float(), Value::boolean() and Value::string() (#7412) 2022-12-09 11:37:51 -05:00
mut_.rs Improve empty pipelines (#7383) 2022-12-08 07:31:57 +13:00
register.rs Improve empty pipelines (#7383) 2022-12-08 07:31:57 +13:00
return_.rs New commands: break, continue, return, and loop (#7230) 2022-11-25 09:39:16 +13:00
try_.rs refactor: introduce is_external_failed to PipelineData, and simplify try logic (#7476) 2022-12-14 10:25:32 -08:00
use_.rs Reduced LOC by replacing several instances of Value::Int {}, Value::Float{}, Value::Bool {}, and Value::String {} with Value::int(), Value::float(), Value::boolean() and Value::string() (#7412) 2022-12-09 11:37:51 -05:00
version.rs Reduced LOC by replacing several instances of Value::Int {}, Value::Float{}, Value::Bool {}, and Value::String {} with Value::int(), Value::float(), Value::boolean() and Value::string() (#7412) 2022-12-09 11:37:51 -05:00
while_.rs break for, loop, while execution when external command runs to failed (#7475) 2022-12-14 16:20:18 +01:00