-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Description
Currently, the dotnet commands for printing data (--info, --help, --list-runtimes, --list-sdks) are required to be the first argument. With https://github.com/dotnet/runtime/pull/1160780, an --arch option is now available for --list-runtimes/sdks - and must come after the data printing command. The host has a number of other options intended for running an application:
runtime/src/native/corehost/fxr/command_line.cpp
Lines 25 to 31 in 39e8c08
| { _X("--additionalprobingpath"), _X("<path>"), _X("Path containing probing policy and assemblies to probe for.") }, | |
| { _X("--depsfile"), _X("<path>"), _X("Path to <application>.deps.json file.") }, | |
| { _X("--runtimeconfig"), _X("<path>"), _X("Path to <application>.runtimeconfig.json file.") }, | |
| { _X("--fx-version"), _X("<version>"), _X("Version of the installed Shared Framework to use to run the application.") }, | |
| { _X("--roll-forward"), _X("<value>"), _X("Roll forward to framework version (LatestPatch, Minor, LatestMinor, Major, LatestMajor, Disable)") }, | |
| { _X("--additional-deps"), _X("<path>"), _X("Path to additional deps.json file.") }, | |
| { _X("--roll-forward-on-no-candidate-fx"), _X("<n>"), _X("<obsolete>") } |
If any are specified before a data printing command, the data printing command is not recognized and the operation fails.
This is inconsistent with how such commands are typically handled, where they can appear in any order and specified with other options - where those options may not actually apply and printing data overrides other options.
We should consider relaxing this ordering requirement to be consistent with other command line behaviour.
Some considerations:
--list-runtimes/sdksis used as an indication that it is only for host data and the SDK does not need to be resolved or run. It should remain that way.--infoand--helpcall into the SDK when it exists - which will error out on unknown options. We'll need to skip the other known host options when calling into the SDK- Any unknown option coming before a printing command should still go to the SDK - for example
dotnet <unknown_option> --list-runtimesshould still call into the SDK
Metadata
Metadata
Assignees
Labels
Type
Projects
Status