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(
34 get_full_help(self, engine_state, stack, call.head),
35 call.head,
36 )
37 .into_pipeline_data())
38 }
39
40 fn examples(&self) -> Vec<Example<'_>> {
41 vec![Example {
42 description: "Show info about the system",
43 example: "sys",
44 result: None,
45 }]
46 }
47}