nu_command/system/sys/
sys_.rs1use nu_engine::{command_prelude::*, get_full_help};
2
3#[derive(Clone)]
4pub struct Sys;
5
6impl Command for Sys {
7 fn name(&self) -> &str {
8 "sys"
9 }
10
11 fn signature(&self) -> Signature {
12 Signature::build("sys")
13 .filter()
14 .category(Category::System)
15 .input_output_types(vec![(Type::Nothing, Type::record())])
16 }
17
18 fn description(&self) -> &str {
19 "View information about the system."
20 }
21
22 fn extra_description(&self) -> &str {
23 "You must use one of the following subcommands. Using this command as-is will only produce this help message."
24 }
25
26 fn run(
27 &self,
28 engine_state: &EngineState,
29 stack: &mut Stack,
30 call: &Call,
31 _input: PipelineData,
32 ) -> Result<PipelineData, ShellError> {
33 Ok(Value::string(get_full_help(self, engine_state, stack), call.head).into_pipeline_data())
34 }
35
36 fn examples(&self) -> Vec<Example> {
37 vec![Example {
38 description: "Show info about the system",
39 example: "sys",
40 result: None,
41 }]
42 }
43}