mirror of
https://github.com/nushell/nushell.git
synced 2025-08-10 06:58:36 +02:00
Add more input/output type annotations (#7532)
This commit is contained in:
committed by
GitHub
parent
d27263af97
commit
4e1f94026c
@ -7,7 +7,7 @@ use nu_protocol::engine::{Command, EngineState, Stack};
|
||||
use nu_protocol::RawStream;
|
||||
|
||||
use nu_protocol::{
|
||||
Category, Example, PipelineData, ShellError, Signature, Span, SyntaxShape, Value,
|
||||
Category, Example, PipelineData, ShellError, Signature, Span, SyntaxShape, Type, Value,
|
||||
};
|
||||
use reqwest::blocking::Response;
|
||||
|
||||
@ -29,6 +29,7 @@ impl Command for SubCommand {
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("fetch")
|
||||
.input_output_types(vec![(Type::Nothing, Type::Any)])
|
||||
.required(
|
||||
"URL",
|
||||
SyntaxShape::String,
|
||||
|
@ -5,7 +5,7 @@ use nu_protocol::IntoPipelineData;
|
||||
use std::net::{Ipv4Addr, SocketAddr, SocketAddrV4, TcpListener};
|
||||
|
||||
use nu_protocol::{
|
||||
Category, Example, PipelineData, ShellError, Signature, Span, SyntaxShape, Value,
|
||||
Category, Example, PipelineData, ShellError, Signature, Span, SyntaxShape, Type, Value,
|
||||
};
|
||||
|
||||
#[derive(Clone)]
|
||||
@ -18,6 +18,7 @@ impl Command for SubCommand {
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("port")
|
||||
.input_output_types(vec![(Type::Nothing, Type::Int)])
|
||||
.optional(
|
||||
"start",
|
||||
SyntaxShape::Int,
|
||||
|
@ -10,7 +10,7 @@ use std::path::PathBuf;
|
||||
use std::str::FromStr;
|
||||
|
||||
use nu_protocol::{
|
||||
Category, Example, PipelineData, ShellError, Signature, Span, SyntaxShape, Value,
|
||||
Category, Example, PipelineData, ShellError, Signature, Span, SyntaxShape, Type, Value,
|
||||
};
|
||||
use std::collections::HashMap;
|
||||
use std::io::BufReader;
|
||||
@ -25,6 +25,7 @@ impl Command for SubCommand {
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("post")
|
||||
.input_output_types(vec![(Type::Nothing, Type::Any)])
|
||||
.required("path", SyntaxShape::String, "the URL to post to")
|
||||
.required("body", SyntaxShape::Any, "the contents of the post body")
|
||||
.named(
|
||||
|
Reference in New Issue
Block a user