Skip to content

Conversation

baronfel
Copy link
Member

@baronfel baronfel commented Sep 3, 2025

Just a bit of fit and finish ahead of the upcoming release.

var rootCommand = new RootCommand("Sample command-line app");

var nameOption = new Option<string>(
aliases: ["--name", "-n"],
Copy link
Contributor

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:

public Option(string name, params string[] aliases)
: this(name, aliases, new Argument<T>(name))
{
}

Console.WriteLine($"Hello, {name ?? "World"}!");
});

return await rootCommand.InvokeAsync(args);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return await rootCommand.InvokeAsync(args);
return await rootCommand.Parse(args).InvokeAsync();

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");
Copy link
Contributor

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))

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.

Comment on lines +222 to +224
### 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))

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+

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

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.

Comment on lines +167 to +170
// Users can generate completion scripts using dotnet-suggest:
// dotnet tool install -g dotnet-suggest
// dotnet suggest script bash > ~/.bashrc
// dotnet suggest script powershell >> $PROFILE
Copy link

@KalleOlaviNiemitalo KalleOlaviNiemitalo Sep 4, 2025

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants