mirror of
https://github.com/nushell/nushell.git
synced 2025-08-17 20:41:12 +02:00
Add search terms to Command and Signature (#4980)
* Add search terms to command * Rename Signature desc to usage To be named uniformly with extra_usage * Throw in foldl search term for reduce * Add missing usage to post * Add search terms to signature * Try to add capnp Signature serialization
This commit is contained in:
@ -129,7 +129,7 @@ fn display(model: &Model) -> Result<(), Box<dyn Error>> {
|
||||
impl Plugin for SubCommand {
|
||||
fn config(&mut self) -> Result<Signature, ShellError> {
|
||||
Ok(Signature::build("chart bar")
|
||||
.desc("Bar charts")
|
||||
.usage("Bar charts")
|
||||
.switch("acc", "accumulate values", Some('a'))
|
||||
.optional(
|
||||
"columns",
|
||||
|
@ -127,7 +127,7 @@ fn display(model: &Model) -> Result<(), Box<dyn Error>> {
|
||||
impl Plugin for SubCommand {
|
||||
fn config(&mut self) -> Result<Signature, ShellError> {
|
||||
Ok(Signature::build("chart line")
|
||||
.desc("Line charts")
|
||||
.usage("Line charts")
|
||||
.switch("acc", "accumulate values", Some('a'))
|
||||
.optional(
|
||||
"columns",
|
||||
|
@ -10,7 +10,7 @@ use nu_source::Tag;
|
||||
impl Plugin for FromBson {
|
||||
fn config(&mut self) -> Result<Signature, ShellError> {
|
||||
Ok(Signature::build("from bson")
|
||||
.desc("Convert from .bson binary into table")
|
||||
.usage("Convert from .bson binary into table")
|
||||
.filter())
|
||||
}
|
||||
|
||||
|
@ -10,7 +10,7 @@ use nu_source::Tag;
|
||||
impl Plugin for FromMp4 {
|
||||
fn config(&mut self) -> Result<Signature, ShellError> {
|
||||
Ok(Signature::build("from mp4")
|
||||
.desc("Get meta-data of mp4 file")
|
||||
.usage("Get meta-data of mp4 file")
|
||||
.filter())
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,7 @@ impl Plugin for FromSqlite {
|
||||
"Only convert specified tables",
|
||||
Some('t'),
|
||||
)
|
||||
.desc("Convert from sqlite binary into table")
|
||||
.usage("Convert from sqlite binary into table")
|
||||
.filter())
|
||||
}
|
||||
|
||||
|
@ -9,7 +9,7 @@ use crate::handler::s3_helper;
|
||||
impl Plugin for handler::Handler {
|
||||
fn config(&mut self) -> Result<Signature, ShellError> {
|
||||
Ok(Signature::build("s3")
|
||||
.desc("Load S3 resource into a cell, convert to table if possible (avoid by appending '--raw' or '-R')")
|
||||
.usage("Load S3 resource into a cell, convert to table if possible (avoid by appending '--raw' or '-R')")
|
||||
.required(
|
||||
"RESOURCE",
|
||||
SyntaxShape::String,
|
||||
|
@ -7,7 +7,7 @@ use crate::start::Start;
|
||||
impl Plugin for Start {
|
||||
fn config(&mut self) -> Result<Signature, ShellError> {
|
||||
Ok(Signature::build("start")
|
||||
.desc("Opens each file/directory/URL using the default application")
|
||||
.usage("Opens each file/directory/URL using the default application")
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::String,
|
||||
|
@ -10,7 +10,7 @@ use nu_source::Tag;
|
||||
impl Plugin for ToBson {
|
||||
fn config(&mut self) -> Result<Signature, ShellError> {
|
||||
Ok(Signature::build("to bson")
|
||||
.desc("Convert table into .bson binary")
|
||||
.usage("Convert table into .bson binary")
|
||||
.filter())
|
||||
}
|
||||
|
||||
|
@ -10,7 +10,7 @@ use nu_source::Tag;
|
||||
impl Plugin for ToSqlite {
|
||||
fn config(&mut self) -> Result<Signature, ShellError> {
|
||||
Ok(Signature::build("to sqlite")
|
||||
.desc("Convert table into sqlite binary")
|
||||
.usage("Convert table into sqlite binary")
|
||||
.filter())
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,7 @@ use crate::TreeViewer;
|
||||
|
||||
impl Plugin for TreeViewer {
|
||||
fn config(&mut self) -> Result<Signature, ShellError> {
|
||||
Ok(Signature::build("tree").desc("View the contents of the pipeline as a tree."))
|
||||
Ok(Signature::build("tree").usage("View the contents of the pipeline as a tree."))
|
||||
}
|
||||
|
||||
fn sink(&mut self, _call_info: CallInfo, input: Vec<Value>) {
|
||||
|
Reference in New Issue
Block a user