Docs state By default, the name of the parameter is the first long option defined; otherwise the first short one is used.
The implementation of this is in _parse_decls method of Option which has a line...
possible_names.sort(key=lambda x: len(x[0]))
name = possible_names[-1][1].replace('-', '_').lower()
... currently here
This invocation of list.sort with key= essentially makes every short option equal to each other and every long option equal to each other. The original order they were defined in is subject to change.
In fact... even if it were to maintain that order, the code would actually be grabbing the last long parameter.
Fix coming soon... I'll submit it. I'll change the code to match the docs.
Docs state
By default, the name of the parameter is the first long option defined; otherwise the first short one is used.The implementation of this is in
_parse_declsmethod ofOptionwhich has a line...... currently here
This invocation of
list.sortwithkey=essentially makes every short option equal to each other and every long option equal to each other. The original order they were defined in is subject to change.In fact... even if it were to maintain that order, the code would actually be grabbing the last long parameter.
Fix coming soon... I'll submit it. I'll change the code to match the docs.