autoprogram icon indicating copy to clipboard operation
autoprogram copied to clipboard

No way to avoid sorting of program's sub-commands

Open denis-postanogov opened this issue 1 year ago • 0 comments

Sub-commands of argument parser always get sorted in the Sphinx documentation page generated with 'autoprogram'. There's no good way to turn alphabet sorting off (except maybe tricking with OrderedDict class, which breaks other functionality).

In my use case sorting of sub-commands produces misleading documentation, and I want to avoid sorting.

In autoprogram.py:

choices = sorted(choices, key=lambda pair: pair[0])

I suggest adding an option for 'autoprogram', for example: ":no_sorting:".

denis-postanogov avatar Jan 18 '24 14:01 denis-postanogov