Add more input/output type annotations (#7532)

This commit is contained in:
Stefan Holderbach
2022-12-21 20:20:46 +01:00
committed by GitHub
parent d27263af97
commit 4e1f94026c
78 changed files with 324 additions and 186 deletions

View File

@@ -3,7 +3,7 @@ use nu_parser::{parse, parse_module_block, unescape_unquote_string};
use nu_protocol::ast::Call;
use nu_protocol::engine::{Command, EngineState, Stack, StateWorkingSet};
use nu_protocol::{
Category, Example, PipelineData, ShellError, Signature, Span, Spanned, SyntaxShape, Value,
Category, Example, PipelineData, ShellError, Signature, Span, Spanned, SyntaxShape, Type, Value,
};
#[derive(Clone)]
@@ -16,6 +16,9 @@ impl Command for NuCheck {
fn signature(&self) -> Signature {
Signature::build("nu-check")
.input_output_types(vec![(Type::String, Type::Bool),
(Type::ListStream, Type::Bool),
(Type::List(Box::new(Type::Any)), Type::Bool)])
// type is string to avoid automatically canonicalizing the path
.optional("path", SyntaxShape::String, "File path to parse")
.switch("as-module", "Parse content as module", Some('m'))