Enforce required, optional, and rest positional arguments start with an uppercase and end with a period. (#11285)

# Description

This updates all the positional arguments (except with
`--features=dataframe` or `--features=extra`) to start with an uppercase
letter and end with a period.

Part of #5066, specifically [this
comment](/nushell/nushell/issues/5066#issuecomment-1421528910)

Some arguments had example data removed from them because it also
appears in the examples.

There are other inconsistencies in positional arguments I noticed while
making the tests pass which I will bring up in #5066.

# User-Facing Changes

Positional arguments are now consistent

# Tests + Formatting

- 🟢 `toolkit fmt`
- 🟢 `toolkit clippy`
- 🟢 `toolkit test`
- 🟢 `toolkit test stdlib`

# After Submitting

Automatic documentation updates
This commit is contained in:
Eric Hodel
2023-12-14 22:32:37 -08:00
committed by GitHub
parent c2b684464f
commit 5b01685fc3
196 changed files with 383 additions and 281 deletions

View File

@ -40,7 +40,7 @@ impl Command for BytesAdd {
(Type::Record(vec![]), Type::Record(vec![])),
])
.allow_variants_without_examples(true)
.required("data", SyntaxShape::Binary, "the binary to add")
.required("data", SyntaxShape::Binary, "The binary to add.")
.named(
"index",
SyntaxShape::Int,
@ -51,7 +51,7 @@ impl Command for BytesAdd {
.rest(
"rest",
SyntaxShape::CellPath,
"for a data structure input, add bytes to the data at the given cell paths",
"For a data structure input, add bytes to the data at the given cell paths.",
)
.category(Category::Bytes)
}

View File

@ -47,11 +47,11 @@ impl Command for BytesAt {
(Type::Table(vec![]), Type::Table(vec![])),
(Type::Record(vec![]), Type::Record(vec![])),
])
.required("range", SyntaxShape::Range, "the range to get bytes")
.required("range", SyntaxShape::Range, "The range to get bytes.")
.rest(
"rest",
SyntaxShape::CellPath,
"for a data structure input, get bytes from data at the given cell paths",
"For a data structure input, get bytes from data at the given cell paths.",
)
.category(Category::Bytes)
}

View File

@ -25,7 +25,7 @@ impl Command for BytesBuild {
fn signature(&self) -> nu_protocol::Signature {
Signature::build("bytes build")
.input_output_types(vec![(Type::Nothing, Type::Binary)])
.rest("rest", SyntaxShape::Any, "list of bytes")
.rest("rest", SyntaxShape::Any, "List of bytes.")
.category(Category::Bytes)
}

View File

@ -20,7 +20,7 @@ impl Command for BytesCollect {
.optional(
"separator",
SyntaxShape::Binary,
"optional separator to use when creating binary",
"Optional separator to use when creating binary.",
)
.category(Category::Bytes)
}

View File

@ -33,11 +33,11 @@ impl Command for BytesEndsWith {
(Type::Record(vec![]), Type::Record(vec![])),
])
.allow_variants_without_examples(true)
.required("pattern", SyntaxShape::Binary, "the pattern to match")
.required("pattern", SyntaxShape::Binary, "The pattern to match.")
.rest(
"rest",
SyntaxShape::CellPath,
"for a data structure input, check if bytes at the given cell paths end with the pattern",
"For a data structure input, check if bytes at the given cell paths end with the pattern.",
)
.category(Category::Bytes)
}

View File

@ -41,12 +41,12 @@ impl Command for BytesIndexOf {
.required(
"pattern",
SyntaxShape::Binary,
"the pattern to find index of",
"The pattern to find index of.",
)
.rest(
"rest",
SyntaxShape::CellPath,
"for a data structure input, find the indexes at the given cell paths",
"For a data structure input, find the indexes at the given cell paths.",
)
.switch("all", "returns all matched index", Some('a'))
.switch("end", "search from the end of the binary", Some('e'))

View File

@ -29,7 +29,7 @@ impl Command for BytesLen {
.rest(
"rest",
SyntaxShape::CellPath,
"for a data structure input, find the length of data at the given cell paths",
"For a data structure input, find the length of data at the given cell paths.",
)
.category(Category::Bytes)
}

View File

@ -35,11 +35,11 @@ impl Command for BytesRemove {
(Type::Table(vec![]), Type::Table(vec![])),
(Type::Record(vec![]), Type::Record(vec![])),
])
.required("pattern", SyntaxShape::Binary, "the pattern to find")
.required("pattern", SyntaxShape::Binary, "The pattern to find.")
.rest(
"rest",
SyntaxShape::CellPath,
"for a data structure input, remove bytes from data at the given cell paths",
"For a data structure input, remove bytes from data at the given cell paths.",
)
.switch("end", "remove from end of binary", Some('e'))
.switch("all", "remove occurrences of finding binary", Some('a'))

View File

@ -36,12 +36,12 @@ impl Command for BytesReplace {
(Type::Record(vec![]), Type::Record(vec![])),
])
.allow_variants_without_examples(true)
.required("find", SyntaxShape::Binary, "the pattern to find")
.required("replace", SyntaxShape::Binary, "the replacement pattern")
.required("find", SyntaxShape::Binary, "The pattern to find.")
.required("replace", SyntaxShape::Binary, "The replacement pattern.")
.rest(
"rest",
SyntaxShape::CellPath,
"for a data structure input, replace bytes in data at the given cell paths",
"For a data structure input, replace bytes in data at the given cell paths.",
)
.switch("all", "replace all occurrences of find binary", Some('a'))
.category(Category::Bytes)

View File

@ -26,7 +26,7 @@ impl Command for BytesReverse {
.rest(
"rest",
SyntaxShape::CellPath,
"for a data structure input, reverse data at the given cell paths",
"For a data structure input, reverse data at the given cell paths.",
)
.category(Category::Bytes)
}

View File

@ -35,11 +35,11 @@ impl Command for BytesStartsWith {
(Type::Record(vec![]), Type::Record(vec![])),
])
.allow_variants_without_examples(true)
.required("pattern", SyntaxShape::Binary, "the pattern to match")
.required("pattern", SyntaxShape::Binary, "The pattern to match.")
.rest(
"rest",
SyntaxShape::CellPath,
"for a data structure input, check if bytes at the given cell paths start with the pattern",
"For a data structure input, check if bytes at the given cell paths start with the pattern.",
)
.category(Category::Bytes)
}