mirror of
https://github.com/nushell/nushell.git
synced 2025-08-18 22:46:02 +02:00
Add more input/output type annotations (#7532)
This commit is contained in:
committed by
GitHub
parent
d27263af97
commit
4e1f94026c
@@ -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,
|
||||
|
@@ -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,
|
||||
|
Reference in New Issue
Block a user