summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDanny Sepler <dannysepler@gmail.com>2021-07-05 12:33:40 -0400
committerDavid Lord <davidism@gmail.com>2022-02-20 11:08:18 -0800
commit40830087dd9e9023dbcf75befe0ca9056127a064 (patch)
treec0550260fe4a4e1f8229638425bd6221dec676b3 /src
parent422cb2064eed146dbe03ba3aed5be35daeb70414 (diff)
downloadclick-40830087dd9e9023dbcf75befe0ca9056127a064.tar.gz
enforce required flag
Diffstat (limited to 'src')
-rw-r--r--src/click/core.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/click/core.py b/src/click/core.py
index 97d699e..1ab2b20 100644
--- a/src/click/core.py
+++ b/src/click/core.py
@@ -2511,7 +2511,7 @@ class Option(Parameter):
# flag if flag_value is set.
self._flag_needs_value = flag_value is not None
- if is_flag and default_is_missing:
+ if is_flag and default_is_missing and not self.required:
self.default: t.Union[t.Any, t.Callable[[], t.Any]] = False
if flag_value is None: