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

@@ -9,7 +9,7 @@ use nu_explore::{
use nu_protocol::{
ast::Call,
engine::{Command, EngineState, Stack},
Category, Example, PipelineData, ShellError, Signature, Span, SyntaxShape, Value,
Category, Example, PipelineData, ShellError, Signature, Span, SyntaxShape, Type, Value,
};
use std::collections::HashMap;
@@ -31,6 +31,7 @@ impl Command for Explore {
// if we set h i short flags it panics????
Signature::build("explore")
.input_output_types(vec![(Type::Any, Type::Any)])
.named(
"head",
SyntaxShape::Boolean,

View File

@@ -7,7 +7,7 @@ use nu_protocol::{
engine::{Command, EngineState, Stack, StateWorkingSet},
format_error, Category, Config, DataSource, Example, FooterMode, IntoPipelineData, ListStream,
PipelineData, PipelineMetadata, RawStream, ShellError, Signature, Span, SyntaxShape,
TableIndexMode, Value,
TableIndexMode, Type, Value,
};
use nu_table::{string_width, Table as NuTable, TableConfig, TableTheme};
use nu_utils::get_ls_colors;
@@ -57,6 +57,8 @@ impl Command for Table {
fn signature(&self) -> nu_protocol::Signature {
Signature::build("table")
.input_output_types(vec![(Type::Any, Type::Any)])
// TODO: make this more precise: what turns into string and what into raw stream
.named(
"start-number",
SyntaxShape::Int,