forked from extern/nushell
feat: add examples for length,lines,reject,benchmark and drop column (#4547)
This commit is contained in:
@ -3,7 +3,9 @@ use std::time::Instant;
|
||||
use nu_engine::{eval_block, CallExt};
|
||||
use nu_protocol::ast::Call;
|
||||
use nu_protocol::engine::{CaptureBlock, Command, EngineState, Stack};
|
||||
use nu_protocol::{Category, IntoPipelineData, PipelineData, Signature, SyntaxShape, Value};
|
||||
use nu_protocol::{
|
||||
Category, Example, IntoPipelineData, PipelineData, Signature, SyntaxShape, Value,
|
||||
};
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct Benchmark;
|
||||
@ -56,4 +58,12 @@ impl Command for Benchmark {
|
||||
|
||||
Ok(output.into_pipeline_data())
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<Example> {
|
||||
vec![Example {
|
||||
description: "Benchmarks a command within a block",
|
||||
example: "benchmark { sleep 500ms }",
|
||||
result: None,
|
||||
}]
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user