-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Milestone
Description
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.
nyanpasu64
Metadata
Metadata
Assignees
Labels
No labels