Skip to content

Commit 0a11108

Browse files
committed
Fix grammar and markdown issues using Copilot
1 parent c4c828a commit 0a11108

File tree

8 files changed

+69
-69
lines changed

8 files changed

+69
-69
lines changed

docs/standard/commandline/command-line-configuration.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,21 @@ ms.topic: how-to
1414

1515
[!INCLUDE [scl-preview](../../../includes/scl-preview.md)]
1616

17-
<xref:System.CommandLine.CommandLineConfiguration> is a class that provides properties to configure the parser. It's an optional argument for every `Parse` method such as <xref:System.CommandLine.Command.Parse> or <xref:System.CommandLine.Parsing.CommandLineParser.Parse>. When it's not provided, default configuration is used.
17+
<xref:System.CommandLine.CommandLineConfiguration> is a class that provides properties to configure the parser. It is an optional argument for every `Parse` method, such as <xref:System.CommandLine.Command.Parse> or <xref:System.CommandLine.Parsing.CommandLineParser.Parse>. When it is not provided, the default configuration is used.
1818

1919
Every <xref:System.CommandLine.ParseResult> instance has a <xref:System.CommandLine.ParseResult.Configuration> property that returns the configuration used for parsing.
2020

2121
## Standard output and error
2222

23-
<xref:System.CommandLine.CommandLineConfiguration> makes testing as well as many extensibility scenarios easier than using `System.Console`. It exposes two `TextWriter` properties: `Output` and `Error`. They can be set to any `TextWriter` instance, such as a `StringWriter`, which can be used to capture output for testing.
23+
<xref:System.CommandLine.CommandLineConfiguration> makes testing, as well as many extensibility scenarios, easier than using `System.Console`. It exposes two `TextWriter` properties: `Output` and `Error`. These can be set to any `TextWriter` instance, such as a `StringWriter`, which can be used to capture output for testing.
2424

2525
Let's define a simple command that writes to standard output:
2626

27-
:::code language="csharp" source="snippets/configuration/csharp/Program.cs" id="setaction" :::
27+
:::code language="csharp" source="snippets/configuration/csharp/Program.cs" id="setaction":::
2828

29-
And let's use `CommandLineConfiguration` to capture the output:
29+
Now, let's use `CommandLineConfiguration` to capture the output:
3030

31-
:::code language="csharp" source="snippets/configuration/csharp/Program.cs" id="captureoutput" :::
31+
:::code language="csharp" source="snippets/configuration/csharp/Program.cs" id="captureoutput":::
3232

3333
## EnablePosixBundling
3434

@@ -44,12 +44,12 @@ And let's use `CommandLineConfiguration` to capture the output:
4444

4545
## EnableDefaultExceptionHandler
4646

47-
By default, all unhandled exceptions thrown during invocation of a command are caught and reported to the user. This behavior can be disabled by setting the <xref:System.CommandLine.CommandLineConfiguration.EnableDefaultExceptionHandler> property to `false`. This is useful when you want to handle exceptions in a custom way, such as logging them or providing a different user experience.
47+
By default, all unhandled exceptions thrown during the invocation of a command are caught and reported to the user. This behavior can be disabled by setting the <xref:System.CommandLine.CommandLineConfiguration.EnableDefaultExceptionHandler> property to `false`. This is useful when you want to handle exceptions in a custom way, such as logging them or providing a different user experience.
4848

4949
## Derived classes
5050

5151
<xref:System.CommandLine.CommandLineConfiguration> is not sealed, so you can derive from it to add custom properties or methods. This is useful when you want to provide additional configuration options specific to your application.
5252

5353
## See also
5454

55-
[System.CommandLine overview](index.md)
55+
- [System.CommandLine overview](index.md)

docs/standard/commandline/design-guidance.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,21 @@ ms.topic: conceptual
1313

1414
The following sections present guidance that we recommend you follow when designing a CLI. Think of what your app expects on the command line as similar to what a REST API server expects in the URL. Consistent rules for REST APIs are what make them readily usable to client app developers. In the same way, users of your command-line apps will have a better experience if the CLI design follows common patterns.
1515

16-
Once you create a CLI it is hard to change, especially if your users have used your CLI in scripts they expect to keep running. The guidelines here were developed after the .NET CLI, and it doesn't always follow these guidelines. We are updating the .NET CLI where we can do it without introducing breaking changes. An example of this work is the new design for `dotnet new` in .NET 7.
16+
Once you create a CLI, it is hard to change, especially if your users have used your CLI in scripts they expect to keep running. The guidelines here were developed after the .NET CLI, and it doesn't always follow these guidelines. We are updating the .NET CLI where we can do so without introducing breaking changes. An example of this work is the new design for `dotnet new` in .NET 7.
1717

1818
## Symbols
1919

2020
### Commands and subcommands
2121

22-
If a command has subcommands, the command should function as an area, or a grouping identifier for the subcommands, rather than specify an action. When you invoke the app, you specify the grouping command and one of its subcommands. For example, try to run `dotnet tool`, and you get an error message because the `tool` command only identifies a group of tool-related subcommands, such as `install` and `list`. You can run `dotnet tool install`, but `dotnet tool` by itself would be incomplete.
22+
If a command has subcommands, the command should function as an area or a grouping identifier for the subcommands, rather than specify an action. When you invoke the app, you specify the grouping command and one of its subcommands. For example, try to run `dotnet tool`, and you get an error message because the `tool` command only identifies a group of tool-related subcommands, such as `install` and `list`. You can run `dotnet tool install`, but `dotnet tool` by itself would be incomplete.
2323

2424
One of the ways that defining areas helps your users is that it organizes the help output.
2525

26-
Within a CLI there is often an implicit area. For example, in the .NET CLI, the implicit area is the project and in the Docker CLI it is the image. As a result, you can use `dotnet build` without including an area. Consider whether your CLI has an implicit area. If it does, consider whether to allow the user to optionally include or omit it as in `docker build` and `docker image build`. If you optionally allow the implicit area to be typed by your user, you also automatically have help and tab completion for this grouping of commands. Supply the optional use of the implicit group by defining two commands that perform the same operation.
26+
Within a CLI, there is often an implicit area. For example, in the .NET CLI, the implicit area is the project, and in the Docker CLI, it is the image. As a result, you can use `dotnet build` without including an area. Consider whether your CLI has an implicit area. If it does, consider whether to allow the user to optionally include or omit it, as in `docker build` and `docker image build`. If you optionally allow the implicit area to be typed by your user, you also automatically have help and tab completion for this grouping of commands. Supply the optional use of the implicit group by defining two commands that perform the same operation.
2727

2828
### Options as parameters
2929

30-
Options should provide parameters to commands, rather than specifying actions themselves. This is a recommended design principle although it isn't always followed by `System.CommandLine` (`--help` displays help information).
30+
Options should provide parameters to commands, rather than specifying actions themselves. This is a recommended design principle, although it isn't always followed by `System.CommandLine` (`--help` displays help information).
3131

3232
## Naming
3333

@@ -39,7 +39,7 @@ In particular, avoid using any of the following aliases differently than their c
3939

4040
* `-i` for `--interactive`.
4141

42-
This option signals to the user that they may be prompted for inputs to questions that the command needs answered. For example, prompting for a username. Your CLI may be used in scripts, so use caution in prompting users that have not specified this switch.
42+
This option signals to the user that they may be prompted for inputs to questions that the command needs answered. For example, prompting for a username. Your CLI may be used in scripts, so use caution in prompting users who have not specified this switch.
4343

4444
* `-o` for `--output`.
4545

@@ -69,11 +69,11 @@ There are also some aliases with common usage limited to the .NET CLI. You can u
6969

7070
### Short names
7171

72-
Make names for commands, options, and arguments as short and easy to spell as possible. For example, if `class` is clear enough don't make the command `classification`.
72+
Make names for commands, options, and arguments as short and easy to spell as possible. For example, if `class` is clear enough, don't make the command `classification`.
7373

7474
### Lowercase names
7575

76-
Define names in lowercase only, except you can make uppercase aliases to make commands or options case insensitive.
76+
Define names in lowercase only, except you can make uppercase aliases to make commands or options case-insensitive.
7777

7878
### Kebab case names
7979

@@ -85,10 +85,10 @@ Within an app, be consistent in pluralization. For example, don't mix plural and
8585

8686
| Option names | Consistency |
8787
|----------------------------------------------|--------------|
88-
| `--additional-probing-paths` and `--sources` | ✔️ |
89-
| `--additional-probing-path` and `--source` | ✔️ |
90-
| `--additional-probing-paths` and `--source` ||
91-
| `--additional-probing-path` and `--sources` ||
88+
| `--additional-probing-paths` and `--sources` | ✔️ |
89+
| `--additional-probing-path` and `--source` | ✔️ |
90+
| `--additional-probing-paths` and `--source` | |
91+
| `--additional-probing-path` and `--sources` | |
9292

9393
### Verbs vs. nouns
9494

@@ -106,20 +106,20 @@ Use verbs rather than nouns for commands that refer to actions (those without su
106106

107107
These are the standard names, but existing apps sometimes use `Silent` in place of `Quiet`, and `Trace`, `Debug`, or `Verbose` in place of `Diagnostic`.
108108

109-
Each app defines its own criteria that determine what gets displayed at each level. Typically an app only needs three levels:
109+
Each app defines its own criteria that determine what gets displayed at each level. Typically, an app only needs three levels:
110110

111111
* Quiet
112112
* Normal
113113
* Diagnostic
114114

115115
If an app doesn't need five different levels, the option should still define the same five settings. In that case, `Minimal` and `Normal` will produce the same output, and `Detailed` and `Diagnostic` will likewise be the same. This allows your users to just type what they are familiar with, and the best fit will be used.
116116

117-
The expectation for `Quiet` is that no output is displayed on the console. However, if an app offers an interactive mode, the app should do one of the following alternatives:
117+
The expectation for `Quiet` is that no output is displayed on the console. However, if an app offers an interactive mode, the app should do one of the following:
118118

119119
* Display prompts for input when `--interactive` is specified, even if `--verbosity` is `Quiet`.
120120
* Disallow the use of `--verbosity Quiet` and `--interactive` together.
121121

122-
Otherwise the app will wait for input without telling the user what it's waiting for. It will appear that your application froze and the user will have no idea the application is waiting for input.
122+
Otherwise, the app will wait for input without telling the user what it's waiting for. It will appear that your application froze, and the user will have no idea the application is waiting for input.
123123

124124
If you define aliases, use `-v` for `--verbosity` and make `-v` without an argument an alias for `--verbosity Diagnostic`. Use `-q` for `--verbosity Quiet`.
125125

docs/standard/commandline/get-started-tutorial.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ helpviewer_keywords:
1313

1414
[!INCLUDE [scl-preview](../../../includes/scl-preview.md)]
1515

16-
This tutorial shows how to create a .NET command-line app that uses the [`System.CommandLine` library](index.md). You'll begin by creating a simple root command that has one option. Then you'll add to that base, creating a more complex app that contains multiple subcommands and different options for each command.
16+
This tutorial shows how to create a .NET command-line app that uses the [`System.CommandLine` library](index.md). You'll begin by creating a simple root command that has one option. Then you'll build on that base, creating a more complex app that contains multiple subcommands and different options for each command.
1717

1818
In this tutorial, you learn how to:
1919

@@ -25,7 +25,7 @@ In this tutorial, you learn how to:
2525
> * Assign an option recursively to all subcommands under a command.
2626
> * Work with multiple levels of nested subcommands.
2727
> * Create aliases for commands and options.
28-
> * Work with `string`, `string[]`, `int`, `bool`, `FileInfo` and enum option types.
28+
> * Work with `string`, `string[]`, `int`, `bool`, `FileInfo`, and enum option types.
2929
> * Read option values in command action code.
3030
> * Use custom code for parsing and validating options.
3131

docs/standard/commandline/index.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: System.CommandLine overview
3-
description: "Learn how to develop and use command-line apps that are based on the System.CommandLine library"
3+
description: "Learn how to develop and use command-line apps that are based on the System.CommandLine library."
44
ms.date: 04/07/2022
55
no-loc: [System.CommandLine]
66
helpviewer_keywords:
@@ -10,44 +10,44 @@ helpviewer_keywords:
1010
ms.topic: overview
1111
---
1212

13-
# System.CommandLine overview
13+
# System.CommandLine Overview
1414

1515
[!INCLUDE [scl-preview](../../../includes/scl-preview.md)]
1616

17-
The `System.CommandLine` library provides functionality that is commonly needed by command-line apps, such as parsing the command-line input and displaying help text.
17+
The `System.CommandLine` library provides functionality commonly needed by command-line apps, such as parsing command-line input and displaying help text.
1818

1919
Apps that use `System.CommandLine` include the [.NET CLI](../../core/tools/index.md), [additional tools](../../core/additional-tools/index.md), and many [global and local tools](../../core/tools/global-tools.md).
2020

2121
For app developers, the library:
2222

23-
* Lets you focus on writing your app code, since you don't have to write code to parse command-line input or produce a help page.
24-
* Lets you test app code independently of input parsing code.
25-
* Is [trim-friendly](../../core/deploying/trimming/trim-self-contained.md), making it a good choice for developing a fast, lightweight, AOT-capable CLI app.
23+
- Lets you focus on writing your app code, since you don't have to write code to parse command-line input or produce a help page.
24+
- Lets you test app code independently of input parsing code.
25+
- Is [trim-friendly](../../core/deploying/trimming/trim-self-contained.md), making it a good choice for developing fast, lightweight, AOT-capable CLI apps.
2626

2727
Use of the library also benefits app users:
2828

29-
* It ensures that command-line input is parsed consistently according to [POSIX](https://en.wikipedia.org/wiki/POSIX) or Windows conventions.
30-
* It automatically supports [tab completion](tab-completion.md) and [response files](syntax.md#response-files).
29+
- It ensures that command-line input is parsed consistently according to [POSIX](https://en.wikipedia.org/wiki/POSIX) or Windows conventions.
30+
- It automatically supports [tab completion](tab-completion.md) and [response files](syntax.md#response-files).
3131

32-
## NuGet package
32+
## NuGet Package
3333

34-
The library is available in a NuGet package:
34+
The library is available as a NuGet package:
3535

36-
* [System.CommandLine](https://www.nuget.org/packages/System.CommandLine)
36+
- [System.CommandLine](https://www.nuget.org/packages/System.CommandLine)
3737

38-
## Next steps
38+
## Next Steps
3939

4040
To get started with System.CommandLine, see the following resources:
4141

42-
* [Tutorial: Get started with System.CommandLine](get-started-tutorial.md)
43-
* [Syntax overview: commands, options, and arguments](syntax.md)
42+
- [Tutorial: Get started with System.CommandLine](get-started-tutorial.md)
43+
- [Syntax overview: commands, options, and arguments](syntax.md)
4444

4545
To learn more, see the following resources:
4646

47-
* [How to parse and invoke the result](parse-and-invoke.md)
48-
* [How to customize parsing and validation](parsing-and-validation.md)
49-
* [How to configure the parser](command-line-configuration.md)
50-
* [How to customize help](help.md)
51-
* [How to enable and customize tab completion](tab-completion.md)
52-
* [Command-line design guidance](design-guidance.md)
53-
* [System.CommandLine API reference](xref:System.CommandLine)
47+
- [How to parse and invoke the result](parse-and-invoke.md)
48+
- [How to customize parsing and validation](parsing-and-validation.md)
49+
- [How to configure the parser](command-line-configuration.md)
50+
- [How to customize help](help.md)
51+
- [How to enable and customize tab completion](tab-completion.md)
52+
- [Command-line design guidance](design-guidance.md)
53+
- [System.CommandLine API reference](xref:System.CommandLine)

0 commit comments

Comments
 (0)