mirror of
https://github.com/nushell/nushell
synced 2024-12-26 13:03:07 +00:00
Categorification: move from Default category to Filters (#9945)
The following *Filters* commands were incorrectly in the category *Default* * group-by * join * reduce * split-by * transpose This continues the effort of moving commands out of default and into their proper category...
This commit is contained in:
parent
a9582e1c62
commit
7248de1167
5 changed files with 14 additions and 7 deletions
|
@ -2,7 +2,8 @@ use nu_engine::{eval_block, CallExt};
|
||||||
use nu_protocol::ast::{Call, CellPath};
|
use nu_protocol::ast::{Call, CellPath};
|
||||||
use nu_protocol::engine::{Closure, Command, EngineState, Stack};
|
use nu_protocol::engine::{Closure, Command, EngineState, Stack};
|
||||||
use nu_protocol::{
|
use nu_protocol::{
|
||||||
Example, IntoPipelineData, PipelineData, ShellError, Signature, Span, SyntaxShape, Type, Value,
|
Category, Example, IntoPipelineData, PipelineData, ShellError, Signature, Span, SyntaxShape,
|
||||||
|
Type, Value,
|
||||||
};
|
};
|
||||||
|
|
||||||
use indexmap::IndexMap;
|
use indexmap::IndexMap;
|
||||||
|
@ -35,6 +36,7 @@ impl Command for GroupBy {
|
||||||
]),
|
]),
|
||||||
"the path to the column to group on",
|
"the path to the column to group on",
|
||||||
)
|
)
|
||||||
|
.category(Category::Filters)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn usage(&self) -> &str {
|
fn usage(&self) -> &str {
|
||||||
|
|
|
@ -2,7 +2,7 @@ use nu_engine::CallExt;
|
||||||
use nu_protocol::ast::Call;
|
use nu_protocol::ast::Call;
|
||||||
use nu_protocol::engine::{Command, EngineState, Stack};
|
use nu_protocol::engine::{Command, EngineState, Stack};
|
||||||
use nu_protocol::{
|
use nu_protocol::{
|
||||||
Config, Example, PipelineData, ShellError, Signature, Span, SyntaxShape, Type, Value,
|
Category, Config, Example, PipelineData, ShellError, Signature, Span, SyntaxShape, Type, Value,
|
||||||
};
|
};
|
||||||
use std::cmp::max;
|
use std::cmp::max;
|
||||||
use std::collections::{HashMap, HashSet};
|
use std::collections::{HashMap, HashSet};
|
||||||
|
@ -53,6 +53,7 @@ impl Command for Join {
|
||||||
.switch("right", "Right-outer join", Some('r'))
|
.switch("right", "Right-outer join", Some('r'))
|
||||||
.switch("outer", "Outer join", Some('o'))
|
.switch("outer", "Outer join", Some('o'))
|
||||||
.input_output_types(vec![(Type::Table(vec![]), Type::Table(vec![]))])
|
.input_output_types(vec![(Type::Table(vec![]), Type::Table(vec![]))])
|
||||||
|
.category(Category::Filters)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn usage(&self) -> &str {
|
fn usage(&self) -> &str {
|
||||||
|
|
|
@ -3,7 +3,8 @@ use nu_engine::{eval_block_with_early_return, CallExt};
|
||||||
use nu_protocol::ast::Call;
|
use nu_protocol::ast::Call;
|
||||||
use nu_protocol::engine::{Closure, Command, EngineState, Stack};
|
use nu_protocol::engine::{Closure, Command, EngineState, Stack};
|
||||||
use nu_protocol::{
|
use nu_protocol::{
|
||||||
Example, IntoPipelineData, PipelineData, ShellError, Signature, SyntaxShape, Type, Value,
|
Category, Example, IntoPipelineData, PipelineData, ShellError, Signature, SyntaxShape, Type,
|
||||||
|
Value,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
|
@ -37,6 +38,7 @@ impl Command for Reduce {
|
||||||
"reducing function",
|
"reducing function",
|
||||||
)
|
)
|
||||||
.allow_variants_without_examples(true)
|
.allow_variants_without_examples(true)
|
||||||
|
.category(Category::Filters)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn usage(&self) -> &str {
|
fn usage(&self) -> &str {
|
||||||
|
|
|
@ -3,8 +3,8 @@ use nu_engine::CallExt;
|
||||||
use nu_protocol::ast::Call;
|
use nu_protocol::ast::Call;
|
||||||
use nu_protocol::engine::{Command, EngineState, Stack};
|
use nu_protocol::engine::{Command, EngineState, Stack};
|
||||||
use nu_protocol::{
|
use nu_protocol::{
|
||||||
Example, IntoPipelineData, PipelineData, ShellError, Signature, Span, Spanned, SyntaxShape,
|
Category, Example, IntoPipelineData, PipelineData, ShellError, Signature, Span, Spanned,
|
||||||
Type, Value,
|
SyntaxShape, Type, Value,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
|
@ -19,6 +19,7 @@ impl Command for SplitBy {
|
||||||
Signature::build("split-by")
|
Signature::build("split-by")
|
||||||
.input_output_types(vec![(Type::Record(vec![]), Type::Record(vec![]))])
|
.input_output_types(vec![(Type::Record(vec![]), Type::Record(vec![]))])
|
||||||
.optional("splitter", SyntaxShape::Any, "the splitter value to use")
|
.optional("splitter", SyntaxShape::Any, "the splitter value to use")
|
||||||
|
.category(Category::Filters)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn usage(&self) -> &str {
|
fn usage(&self) -> &str {
|
||||||
|
|
|
@ -3,8 +3,8 @@ use nu_engine::CallExt;
|
||||||
use nu_protocol::ast::Call;
|
use nu_protocol::ast::Call;
|
||||||
use nu_protocol::engine::{Command, EngineState, Stack};
|
use nu_protocol::engine::{Command, EngineState, Stack};
|
||||||
use nu_protocol::{
|
use nu_protocol::{
|
||||||
Example, IntoInterruptiblePipelineData, PipelineData, ShellError, Signature, Span, Spanned,
|
Category, Example, IntoInterruptiblePipelineData, PipelineData, ShellError, Signature, Span,
|
||||||
SyntaxShape, Type, Value,
|
Spanned, SyntaxShape, Type, Value,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
|
@ -61,6 +61,7 @@ impl Command for Transpose {
|
||||||
SyntaxShape::String,
|
SyntaxShape::String,
|
||||||
"the names to give columns once transposed",
|
"the names to give columns once transposed",
|
||||||
)
|
)
|
||||||
|
.category(Category::Filters)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn usage(&self) -> &str {
|
fn usage(&self) -> &str {
|
||||||
|
|
Loading…
Reference in a new issue