mirror of
https://github.com/nushell/nushell.git
synced 2025-08-13 15:27:30 +02:00
Short-hand flags (#1378)
* typo fixes * Change signature to take in short-hand flags * update help information * Parse short-hand flags as their long counterparts * lints * Modified a couple tests to use shorthand flags
This commit is contained in:
@ -16,9 +16,21 @@ 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", "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)")
|
||||
.switch(
|
||||
"major",
|
||||
"increment the major version (eg 1.2.1 -> 2.0.0)",
|
||||
Some('M'),
|
||||
)
|
||||
.switch(
|
||||
"minor",
|
||||
"increment the minor version (eg 1.2.1 -> 1.3.0)",
|
||||
Some('m'),
|
||||
)
|
||||
.switch(
|
||||
"patch",
|
||||
"increment the patch version (eg 1.2.1 -> 1.2.2)",
|
||||
Some('p'),
|
||||
)
|
||||
.rest(SyntaxShape::ColumnPath, "the column(s) to update")
|
||||
.filter())
|
||||
}
|
||||
|
Reference in New Issue
Block a user