nu_cmd_lang/core_commands/scope/
command.rs

1use nu_engine::{command_prelude::*, get_full_help};
2
3#[derive(Clone)]
4pub struct Scope;
5
6impl Command for Scope {
7    fn name(&self) -> &str {
8        "scope"
9    }
10
11    fn signature(&self) -> Signature {
12        Signature::build("scope")
13            .category(Category::Core)
14            .input_output_types(vec![(Type::Nothing, Type::String)])
15            .allow_variants_without_examples(true)
16    }
17
18    fn description(&self) -> &str {
19        "Commands for getting info about what is in scope."
20    }
21
22    fn run(
23        &self,
24        engine_state: &EngineState,
25        stack: &mut Stack,
26        call: &Call,
27        _input: PipelineData,
28    ) -> Result<PipelineData, ShellError> {
29        Ok(Value::string(get_full_help(self, engine_state, stack), call.head).into_pipeline_data())
30    }
31}