Update PMI to use the new System.CommandLine parser#209
Update PMI to use the new System.CommandLine parser#209AndyAyersMS wants to merge 10 commits intodotnet:mainfrom
Conversation
Replace PMI's home-grown command line parsing with the new System.CommandLine version. Syntax changes slightly as the "suffix" options (eg `PREPALL-QUIET`) now need to be separated out (`PREPALL --quiet`). Only real "breaking" change is that the method index for `PREPALL` and `PREPONE` is now a named option. With this new package we get built in help and (in some shells) command line completion. I plan to eventually migrate all the utilites over to this package as the one they are using is now orphaned and unsupported. See dotnet#193.
|
@BruceForstall PTAL This also includes two bug fixes for Some examples. Overall help: Per-command help: |
|
Are command names case insensitive? If not then perhaps you should make them lower case, upper case commands seem to be the exception rather than the norm. |
|
Case sensitive. I can add "aliases" so you can specify either case; I don't know yet if you can make them case insensitive. |
|
Re case sensitivity -- looks like not (yet): dotnet/command-line-api#133 |
|
PMI treats its arguments as case-insensitive: https://github.com/dotnet/jitutils/blob/master/src/pmi/pmi.cs#L1329 I always use lower case when invoking it. |
|
Unfortunately this causes a version clash with the other tools, because the old fxlabs assembly and this new assembly are both called So I either need to convert everything over to the new format or find some way around this. Was planning on converting everything eventually, so perhaps I'll just start working on that. |
Kind of pointless as it is referring to the old CI server, but perhaps it can serve as a template for something to retrieve things from AzDO. But it at least shows how to adapt the `Config` we see in the other projects over to the new format without too radical of changes.
|
I have most of the other utilities converted but am still working on |
|
Have everything converted over and (mostly) working, but have hit a new snag: pmi needs to be able to run in the locally built coreclr, and there's a copy of the old Looks like it comes from R2R dump perhaps. So we may need to update that too. |
|
Thanks for doing this conversion. IMO, we should just move everything to lower-case. Not even sure we need upper-case aliases. |
|
Converting some of the other tools was a bit messy. Let me push my latest and you can get an idea. Things I hit:
|
|
@AndyAyersMS - I see that R2RDump was the last blocker in getting this PR merged. I see that you had suggested changes in dotnet/runtime#12766. Do you need any help in pushing that through, so we can complete this work item? |
|
I no longer think this is a good idea -- I like the behavior of the current parser better. Suggest we instead find a better supported implementation of what we have now -- see #193 (comment) |
Replace PMI's home-grown command line parsing with the new System.CommandLine
version.
Syntax changes slightly as the "suffix" options (eg
PREPALL-QUIET) now needto be separated out (
PREPALL --quiet). Only real "breaking" change is that themethod index for
PREPALLandPREPONEis now a named option.With this new package we get built in help and (in some shells) command line
completion.
I plan to eventually migrate all the utilites over to this package as the one
they are using is now orphaned and unsupported. See #193.