File tree 2 files changed +8
-2
lines changed
2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change
1
+ Sort ``--generated-rcfile`` output.
2
+
3
+ Refs #7655
Original file line number Diff line number Diff line change @@ -437,7 +437,10 @@ def generate_config(
437
437
)
438
438
options_by_section = {}
439
439
sections = []
440
- for group in self ._arg_parser ._action_groups :
440
+ for group in sorted (
441
+ self ._arg_parser ._action_groups ,
442
+ key = lambda x : (x .title != "Main" , x .title ),
443
+ ):
441
444
group_name = group .title
442
445
assert group_name
443
446
if group_name in skipsections :
@@ -449,7 +452,7 @@ def generate_config(
449
452
for i in group ._group_actions
450
453
if not isinstance (i , argparse ._SubParsersAction )
451
454
]
452
- for opt in option_actions :
455
+ for opt in sorted ( option_actions , key = lambda x : x . option_strings [ 0 ][ 2 :]) :
453
456
if "--help" in opt .option_strings :
454
457
continue
455
458
You can’t perform that action at this time.
0 commit comments