feat: add examples for length,lines,reject,benchmark and drop column (#4547)

This commit is contained in:
Justin Ma
2022-02-19 09:03:24 +08:00
committed by GitHub
parent 0f4f660759
commit 3f14b75153
5 changed files with 82 additions and 8 deletions

View File

@ -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,
}]
}
}