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

@ -514,7 +514,7 @@ impl Command for AnsiCommand {
.optional(
"code",
SyntaxShape::Any,
"the name of the code to use like 'green' or 'reset' to reset the color",
"The name of the code to use (from `ansi -l`).",
)
.switch(
"escape", // \x1b[

View File

@ -37,7 +37,7 @@ impl Command for SubCommand {
.rest(
"cell path",
SyntaxShape::CellPath,
"for a data structure input, add links to all strings at the given cell paths",
"For a data structure input, add links to all strings at the given cell paths.",
)
.allow_variants_without_examples(true)
.category(Category::Platform)

View File

@ -24,7 +24,7 @@ impl Command for SubCommand {
.rest(
"cell path",
SyntaxShape::CellPath,
"for a data structure input, remove ANSI sequences from strings at the given cell paths",
"For a data structure input, remove ANSI sequences from strings at the given cell paths.",
)
.allow_variants_without_examples(true)
.category(Category::Platform)

View File

@ -38,7 +38,7 @@ impl Command for Du {
Signature::build("du")
.input_output_types(vec![(Type::Nothing, Type::Table(vec![]))])
.allow_variants_without_examples(true)
.optional("path", SyntaxShape::GlobPattern, "starting directory")
.optional("path", SyntaxShape::GlobPattern, "Starting directory.")
.switch(
"all",
"Output file sizes as well as directory sizes",

View File

@ -39,7 +39,7 @@ impl Command for Input {
(Type::Nothing, Type::Binary),
])
.allow_variants_without_examples(true)
.optional("prompt", SyntaxShape::String, "prompt to show the user")
.optional("prompt", SyntaxShape::String, "Prompt to show the user.")
.named(
"bytes-until-any",
SyntaxShape::String,

View File

@ -46,7 +46,7 @@ impl Command for InputList {
(Type::List(Box::new(Type::Any)), Type::Any),
(Type::Range, Type::Int),
])
.optional("prompt", SyntaxShape::String, "the prompt to display")
.optional("prompt", SyntaxShape::String, "The prompt to display.")
.switch(
"multi",
"Use multiple results, you can press a to toggle all options on/off",

View File

@ -26,9 +26,9 @@ impl Command for Kill {
.required(
"pid",
SyntaxShape::Int,
"process id of process that is to be killed",
"Process id of process that is to be killed.",
)
.rest("rest", SyntaxShape::Int, "rest of processes to kill")
.rest("rest", SyntaxShape::Int, "Rest of processes to kill.")
.switch("force", "forcefully kill the process", Some('f'))
.switch("quiet", "won't print anything to the console", Some('q'))
.category(Category::Platform);

View File

@ -27,8 +27,8 @@ impl Command for Sleep {
fn signature(&self) -> Signature {
Signature::build("sleep")
.input_output_types(vec![(Type::Nothing, Type::Nothing)])
.required("duration", SyntaxShape::Duration, "time to sleep")
.rest("rest", SyntaxShape::Duration, "additional time")
.required("duration", SyntaxShape::Duration, "Time to sleep.")
.rest("rest", SyntaxShape::Duration, "Additional time.")
.category(Category::Platform)
}