Add ability to set a flag description. #99

Merged
Soheab merged 5 commits from flags_option_description into 2.0 2021-10-16 12:27:02 +00:00
2 changed files with 4 additions and 2 deletions
Showing only changes of commit e9010454dd - Show all commits

View File

@@ -1234,7 +1234,7 @@ class Command(_BaseCommand, Generic[CogT, P, T]):
description = self.option_descriptions[name]
origin = getattr(annotation, "__origin__", None)
if inspect.isclass(annotation) and issubclass(annotation, FlagConverter):
return [
param

View File

@@ -149,7 +149,9 @@ def flag(
Whether multiple given values overrides the previous value. The default
value depends on the annotation given.
"""
return Flag(name=name, description=description, aliases=aliases, default=default, max_args=max_args, override=override)
return Flag(
name=name, description=description, aliases=aliases, default=default, max_args=max_args, override=override
)
def validate_flag_name(name: str, forbidden: Set[str]):