You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
--help and --version moved to the top of the Options section #2589
Now that the --help and --version options are added by the RootCommand constructor in 2.0.0-beta5.25306.1, rather than by CommandLineBuilderExtensions, they tend to stay at the beginning of the Command.Options list when the application adds its own options. The --help output then lists them at the top of the Options section, rather than at the bottom which would be more traditional.
I suppose an application could fix that by using IList<T>.Insert to add its options in front of those two, or more easily by clearing the whole list, adding its options, and then adding new instances of HelpOption and VersionOption. The latter solution would also let the application easily set a custom action for the HelpOption, as requested in #2588
It would be nicer if those options were placed at the bottom of the table by default, without the application needing to move them explicitly. But I'm not sure how to implement that now without breaking compatibility or extensibility.
I considered posting this as a comment in #2576 but filed as a separate issue because there might be some kind of fix.
Reacted by Dave, Frulfump, elgonzo, Barry Dorrans and Keisir
Activity
KalleOlaviNiemitalo commentedon Jun 24, 2025
In GNU argp, this is part of the option grouping feature:
--helpand--versiongo to group number -1, which is displayed last.ptr727 commentedon Jun 24, 2025
Last would be great, but now they are rendered before global / recursive options, i.e. in the middle of help output.
fix dotnet#2589
fix dotnet#2589 (dotnet#2654)