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
If all names for a parameter contain dashes, the internal name is generated automatically by taking the longest argument and converting all dashes to underscores.
However, in the implementation, when the possible names are sorted, it’s only for the purpose of grouping them “long options first” — meaning “options with two dashes first”, not “longest name first”.
Between version 5.x and 6.x, the implicit (misdocumented) order had changed, which broke my script.
This bug manifests only when multiple long parameter (option) names are specified, i.e.:
@click.option('--shorter', '--longer-option')
…in which case different versions of Click would choose a different name between shorter and longer_option instead of always choosing longer_option as suggested in the documentation.
The text was updated successfully, but these errors were encountered:
From the documentation:
However, in the implementation, when the possible names are sorted, it’s only for the purpose of grouping them “long options first” — meaning “options with two dashes first”, not “longest name first”.
See current master:
click/click/core.py
Line 1641 in 2e856a5
And compare with branch 5.x:
click/click/core.py
Line 1506 in 7ede2db
Between version 5.x and 6.x, the implicit (misdocumented) order had changed, which broke my script.
This bug manifests only when multiple long parameter (option) names are specified, i.e.:
@click.option('--shorter', '--longer-option')
…in which case different versions of Click would choose a different name between
shorter
andlonger_option
instead of always choosinglonger_option
as suggested in the documentation.The text was updated successfully, but these errors were encountered: