forked from extern/nushell
Add more input/output type annotations (#7532)
This commit is contained in:
committed by
GitHub
parent
d27263af97
commit
4e1f94026c
@@ -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'))
|
||||
|
Reference in New Issue
Block a user