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.
...and running cli.py --print-verbose-info was apparently defaulting over to the False value. Totally my mistake (it should have been --no-print-verbose-info), but it'd be nice to get a warning/error for boolean values which match exactly (ie: cannot be set to true).
It was kindof tricky to diagnose b/c I assumed that the --print-verbose-info that I was passing on the CLI was triggering the True path, not the False path, and usually Click option parsing is pretty bulletproof so it took a while to find that copy/paste problem.
This would be a good-first-issue, I'm submitting it now more as a reminder to maybe follow-up on it and figure out the appropriate P.R.
The text was updated successfully, but these errors were encountered:
diff --git a/click/core.py b/click/core.py
index 36004fe..edddd9f 100644
--- a/click/core.py
+++ b/click/core.py
@@ -1731,6 +1731,8 @@ class Option(Parameter):
second = second.lstrip()
if second:
secondary_opts.append(second.lstrip())
+ if first == second:
+ raise TypeError('Boolean options cannot use the same flag for true and false.')
else:
possible_names.append(split_opt(decl))
opts.append(decl)
I ran into an issue where I had the code:
...and running
cli.py --print-verbose-info
was apparently defaulting over to theFalse
value. Totally my mistake (it should have been--no-print-verbose-info
), but it'd be nice to get a warning/error for boolean values which match exactly (ie: cannot be set to true).It was kindof tricky to diagnose b/c I assumed that the
--print-verbose-info
that I was passing on the CLI was triggering theTrue
path, not theFalse
path, and usually Click option parsing is pretty bulletproof so it took a while to find that copy/paste problem.This would be a
good-first-issue
, I'm submitting it now more as a reminder to maybe follow-up on it and figure out the appropriate P.R.The text was updated successfully, but these errors were encountered: