Switch to System.CommandLine for .NET Framework compatibility#402
Conversation
Co-authored-by: sensslen <3428860+sensslen@users.noreply.github.com>
Co-authored-by: sensslen <3428860+sensslen@users.noreply.github.com>
Co-authored-by: sensslen <3428860+sensslen@users.noreply.github.com>
Co-authored-by: sensslen <3428860+sensslen@users.noreply.github.com>
|
@copilot System.Commandline is available in version 2.0.2. we should avoid beta versions |
I've investigated the System.CommandLine versioning, and there's a complication: Two different API versions exist:
The stable 2.0.2 release actually has an older, incompatible API. To avoid beta versions while keeping the modern API, we have these options:
Which approach would you prefer? If you want to stick with non-beta/non-RC versions, I'll need to rewrite the command line parsing to use the older 2.0.2 API. |
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@copilot Now add command line autocomplete |
I've added command line autocomplete support in commit e2ec47a. The tool now includes a Usage examples: # Bash
nuget-license completion --shell bash > ~/.nuget-license-completion.sh
source ~/.nuget-license-completion.sh
# Or add to ~/.bashrc:
source <(nuget-license completion --shell bash)
# PowerShell
nuget-license completion --shell powershell | Out-String | Invoke-Expression
# Zsh
nuget-license completion --shell zsh > ~/.nuget-license-completion.zsh
source ~/.nuget-license-completion.zshThe completion scripts leverage System.CommandLine's built-in |
|
@copilot the output I get is Description: Usage: Options: |
e2ec47a to
5b906ce
Compare
|



McMaster.CommandLine dropped .NET Standard 2.0 support, breaking .NET Framework 4.7.2 compatibility.
Changes
McMaster.Extensions.CommandLineUtilswithSystem.CommandLine(2.0.2)NuGetLicenseCoreandNuGetLicenseFrameworkto invokeRootCommandinstead ofCommandLineApplication.ExecuteAsync<T>()completioncommand to generate shell completion scripts for bash, PowerShell, and zshShell Completion Support
Users can now enable tab completion for the tool:
The completion scripts leverage System.CommandLine's built-in
[suggest]directive to provide context-aware completions for all command options.Compatibility
All 16 command line options preserved with identical behavior. Version option now handled automatically by System.CommandLine from assembly attributes. All target frameworks supported: net8.0, net9.0, net10.0, net472.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.