mirror of
https://github.com/nushell/nushell.git
synced 2025-08-10 14:37:59 +02:00
Add descriptions to arguments
This commit is contained in:
@ -53,10 +53,13 @@ impl Add {
|
||||
impl Plugin for Add {
|
||||
fn config(&mut self) -> Result<Signature, ShellError> {
|
||||
Ok(Signature::build("add")
|
||||
.desc("Add a new field to the table.")
|
||||
.required("Field", SyntaxShape::ColumnPath)
|
||||
.required("Value", SyntaxShape::String)
|
||||
.rest(SyntaxShape::String)
|
||||
.desc("Add a new column to the table.")
|
||||
.required("column", SyntaxShape::ColumnPath, "the column name to add")
|
||||
.required(
|
||||
"value",
|
||||
SyntaxShape::String,
|
||||
"the value to give the cell(s)",
|
||||
)
|
||||
.filter())
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,7 @@ impl Plugin for BinaryView {
|
||||
fn config(&mut self) -> Result<Signature, ShellError> {
|
||||
Ok(Signature::build("binaryview")
|
||||
.desc("Autoview of binary data.")
|
||||
.switch("lores"))
|
||||
.switch("lores", "use low resolution output mode"))
|
||||
}
|
||||
|
||||
fn sink(&mut self, call_info: CallInfo, input: Vec<Tagged<Value>>) {
|
||||
|
@ -48,8 +48,16 @@ impl Plugin for Edit {
|
||||
fn config(&mut self) -> Result<Signature, ShellError> {
|
||||
Ok(Signature::build("edit")
|
||||
.desc("Edit an existing column to have a new value.")
|
||||
.required("Field", SyntaxShape::ColumnPath)
|
||||
.required("Value", SyntaxShape::String)
|
||||
.required(
|
||||
"Field",
|
||||
SyntaxShape::ColumnPath,
|
||||
"the name of the column to edit",
|
||||
)
|
||||
.required(
|
||||
"Value",
|
||||
SyntaxShape::String,
|
||||
"the new value to give the cell(s)",
|
||||
)
|
||||
.filter())
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@ impl Plugin for Embed {
|
||||
fn config(&mut self) -> Result<Signature, ShellError> {
|
||||
Ok(Signature::build("embed")
|
||||
.desc("Embeds a new field to the table.")
|
||||
.optional("field", SyntaxShape::String)
|
||||
.optional("field", SyntaxShape::String, "the name of the new column")
|
||||
.filter())
|
||||
}
|
||||
|
||||
|
@ -137,10 +137,10 @@ impl Plugin for Inc {
|
||||
fn config(&mut self) -> Result<Signature, ShellError> {
|
||||
Ok(Signature::build("inc")
|
||||
.desc("Increment a value or version. Optionally use the column of a table.")
|
||||
.switch("major")
|
||||
.switch("minor")
|
||||
.switch("patch")
|
||||
.rest(SyntaxShape::ColumnPath)
|
||||
.switch("major", "increment the major version (eg 1.2.1 -> 2.0.0)")
|
||||
.switch("minor", "increment the minor version (eg 1.2.1 -> 1.3.0)")
|
||||
.switch("patch", "increment the patch version (eg 1.2.1 -> 1.2.2)")
|
||||
.rest(SyntaxShape::ColumnPath, "the column(s) to update")
|
||||
.filter())
|
||||
}
|
||||
|
||||
|
@ -22,8 +22,8 @@ impl Plugin for Match {
|
||||
fn config(&mut self) -> Result<Signature, ShellError> {
|
||||
Ok(Signature::build("match")
|
||||
.desc("filter rows by regex")
|
||||
.required("member", SyntaxShape::Member)
|
||||
.required("regex", SyntaxShape::String)
|
||||
.required("member", SyntaxShape::Member, "the column name to match")
|
||||
.required("regex", SyntaxShape::String, "the regex to match with")
|
||||
.filter())
|
||||
}
|
||||
fn begin_filter(&mut self, call_info: CallInfo) -> Result<Vec<ReturnValue>, ShellError> {
|
||||
|
@ -17,7 +17,7 @@ impl Plugin for Skip {
|
||||
fn config(&mut self) -> Result<Signature, ShellError> {
|
||||
Ok(Signature::build("skip")
|
||||
.desc("Skip a number of rows")
|
||||
.rest(SyntaxShape::Number)
|
||||
.rest(SyntaxShape::Number, "the number of rows to skip")
|
||||
.filter())
|
||||
}
|
||||
fn begin_filter(&mut self, call_info: CallInfo) -> Result<Vec<ReturnValue>, ShellError> {
|
||||
|
@ -128,11 +128,11 @@ impl Str {
|
||||
impl Plugin for Str {
|
||||
fn config(&mut self) -> Result<Signature, ShellError> {
|
||||
Ok(Signature::build("str")
|
||||
.desc("Apply string function. Optional use the field of a table")
|
||||
.switch("downcase")
|
||||
.switch("upcase")
|
||||
.switch("to-int")
|
||||
.rest(SyntaxShape::ColumnPath)
|
||||
.desc("Apply string function. Optional use the column of a table")
|
||||
.switch("downcase", "convert string to lowercase")
|
||||
.switch("upcase", "convert string to uppercase")
|
||||
.switch("to-int", "convert string to integer")
|
||||
.rest(SyntaxShape::ColumnPath, "the column(s) to convert")
|
||||
.filter())
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user