diff --git a/docopt/__init__.py b/docopt/__init__.py index 8f20a57..538c498 100644 --- a/docopt/__init__.py +++ b/docopt/__init__.py @@ -321,7 +321,15 @@ def parse(class_, option_description: str) -> Option: argcount = 1 if argcount: matched = re.findall(r"\[default: (.*)\]", description, flags=re.I) - value = matched[0] if matched else None + if matched: + value = matched[0] + if len(value) > 1: + if value.startswith("'") and value.endswith("'"): + value = value[1:-1] + elif value.startswith('"') and value.endswith('"'): + value = value[1:-1] + else: + value = None return class_(short, longer, argcount, value) def single_match(self, left: list[LeafPattern]) -> TSingleMatch: