nu_cmd_lang/core_commands/overlay/
command.rs1use nu_engine::{command_prelude::*, get_full_help};
2use nu_protocol::engine::CommandType;
3
4#[derive(Clone)]
5pub struct Overlay;
6
7impl Command for Overlay {
8 fn name(&self) -> &str {
9 "overlay"
10 }
11
12 fn signature(&self) -> Signature {
13 Signature::build("overlay")
14 .category(Category::Core)
15 .input_output_types(vec![(Type::Nothing, Type::String)])
16 }
17
18 fn description(&self) -> &str {
19 "Commands for manipulating overlays."
20 }
21
22 fn extra_description(&self) -> &str {
23 r#"This command is a parser keyword. For details, check:
24 https://www.nushell.sh/book/thinking_in_nu.html
25
26 You must use one of the following subcommands. Using this command as-is will only produce this help message."#
27 }
28
29 fn command_type(&self) -> CommandType {
30 CommandType::Keyword
31 }
32
33 fn run(
34 &self,
35 engine_state: &EngineState,
36 stack: &mut Stack,
37 call: &Call,
38 _input: PipelineData,
39 ) -> Result<PipelineData, ShellError> {
40 Ok(Value::string(get_full_help(self, engine_state, stack), call.head).into_pipeline_data())
41 }
42}