Refactor: Switch from CommandLineParser to System.CommandLine (#1016)#3014
Refactor: Switch from CommandLineParser to System.CommandLine (#1016)#3014abdulrahmanhossam wants to merge 12 commits intodotnet:masterfrom
Conversation
|
@dotnet-policy-service agree |
|
When running Therefore, I though it need to fix these tests first. Other points of concern are listed below.
|
|
Thanks a lot for the detailed review and catching these points, @filzrev! I have pushed a new commit that addresses all your concerns:
The local build is completely green now. Let me know if there is anything else needed! |
…smJavascriptEngineArguments property
|
**1. Keep help display ordering Is it able to keep existing argument orders that are displayed on help? **2. Show usage examples On existing CommandLineParser implementation. 3. Missing argument mappings. When comparing 4. DashDash extra arguments supports It's not explicitly documented/tested though. But after
It it able to ignore args that are placed after |
|
Thanks for pointing these out, @filzrev! I have just pushed a commit that addresses points 3 and 4:
Regarding Points 1 (Help Ordering) and 2 (Usage Examples): Let me know what you think is best for the project! |
As far as I've confirmed. Note: I've added some additional options registrations. So it needs maping to CommandLineOptions also. Add rootCommand optionsAdditionally |
|
Thanks again for the thorough review, @filzrev and @timcassell! I have applied all the requested refinements in the latest commit:
The local build is completely green. Let me know if there are any other final touches needed before merging! |
…s, and fix serialization order
…handling for unrecognized options
|
Hi @filzrev, I have addressed all the latest feedback:
All CI tests are completely green now! ✅ Let me know if we are good to go. |
Description
This PR addresses issue #1016 by migrating the command-line argument parsing logic from the legacy
CommandLineParserto the modern and stableSystem.CommandLine(v2.0).Key Changes
CommandLineParserandMcMaster.Extensions.CommandLineUtilsdependencies.System.CommandLinepackage reference.CommandLineOptionsto define options using the new API.ConfigParserto handle the new parsing result and map it back to the options object.Testing
Fixes #1016