-
Notifications
You must be signed in to change notification settings - Fork 404
Add package readme for the core System.CommandLine package #2679
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: release/10.0
Are you sure you want to change the base?
Conversation
src/System.CommandLine/README.md
Outdated
var rootCommand = new RootCommand("Sample command-line app"); | ||
|
||
var nameOption = new Option<string>( | ||
aliases: ["--name", "-n"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This constructor call doesn't match the latest signature:
command-line-api/src/System.CommandLine/Option{T}.cs
Lines 19 to 22 in 0c37e9e
public Option(string name, params string[] aliases) | |
: this(name, aliases, new Argument<T>(name)) | |
{ | |
} |
src/System.CommandLine/README.md
Outdated
Console.WriteLine($"Hello, {name ?? "World"}!"); | ||
}); | ||
|
||
return await rootCommand.InvokeAsync(args); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return await rootCommand.InvokeAsync(args); | |
return await rootCommand.Parse(args).InvokeAsync(); |
src/System.CommandLine/README.md
Outdated
var configSetCommand = new Command("set", "Set a configuration value"); | ||
var configGetCommand = new Command("get", "Get a configuration value"); | ||
|
||
var keyOption = new Option<string>("--key", "Configuration key"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The second parameter here will be applied to the params string[] aliases
parameter.
### New Features | ||
- **Finnish Localization**: Added Finnish language translations for help text and error messages ([#2605](https://github.com/dotnet/command-line-api/pull/2605)) | ||
- **Improved Help System**: Enhanced `HelpAction` to allow users to provide custom `MaxWidth` for help text formatting ([#2635](https://github.com/dotnet/command-line-api/pull/2635)) | ||
- **Task<int> Support**: Added `SetAction` overload for `Task<int>` return types ([#2634](https://github.com/dotnet/command-line-api/issues/2634)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should backslash-escape the first less-than sign.
### Breaking Changes | ||
- Default value handling for `ProcessTerminationTimeout` has been re-added ([#2672](https://github.com/dotnet/command-line-api/pull/2672)) | ||
- Some internal APIs have been refactored to reduce reflection usage ([#2662](https://github.com/dotnet/command-line-api/pull/2662)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you set a custom action on a HelpOption or VersionOption, the option no longer clears parse errors implicitly. To restore the previous behaviour, make the action class override the CommandLineAction.ClearsParseErrors property to return true.
## Framework Support | ||
|
||
- **.NET 8.0+** - Full feature support with trimming and AOT compilation | ||
- **.NET Standard 2.0** - Compatible with .NET Framework 4.6.1+, .NET Core 2.0+ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#2213 still hurts .NET Framework compatibility.
|
||
### Other Improvements | ||
- Updated to .NET 10.0 RC1 compatibility | ||
- Enhanced parsing logic for better POSIX and Windows convention support |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what this refers to.
// Users can generate completion scripts using dotnet-suggest: | ||
// dotnet tool install -g dotnet-suggest | ||
// dotnet suggest script bash > ~/.bashrc | ||
// dotnet suggest script powershell >> $PROFILE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this also need a step to register the program with dotnet suggest
? The automatic registration on program startup was removed in #2099 earlier.
}); | ||
``` | ||
|
||
## Notable Changes Since v2.0.0-beta7 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NuGet also recognises the PackageReleaseNotes
MSBuild property for these. https://learn.microsoft.com/en-us/nuget/create-packages/package-authoring-best-practices#release-notes
Just a bit of fit and finish ahead of the upcoming release.