nu_command/network/url/
url_.rs1use nu_engine::{command_prelude::*, get_full_help};
2
3#[derive(Clone)]
4pub struct Url;
5
6impl Command for Url {
7 fn name(&self) -> &str {
8 "url"
9 }
10
11 fn signature(&self) -> Signature {
12 Signature::build("url")
13 .input_output_types(vec![(Type::Nothing, Type::String)])
14 .category(Category::Network)
15 }
16
17 fn description(&self) -> &str {
18 "Various commands for working with URLs."
19 }
20
21 fn extra_description(&self) -> &str {
22 "You must use one of the following subcommands. Using this command as-is will only produce this help message."
23 }
24
25 fn search_terms(&self) -> Vec<&str> {
26 vec!["network", "parse"]
27 }
28
29 fn run(
30 &self,
31 engine_state: &EngineState,
32 stack: &mut Stack,
33 call: &Call,
34 _input: PipelineData,
35 ) -> Result<PipelineData, ShellError> {
36 Ok(Value::string(get_full_help(self, engine_state, stack), call.head).into_pipeline_data())
37 }
38}