diff --git a/bonobo/config/options.py b/bonobo/config/options.py index 065cc9d..cad4ca8 100644 --- a/bonobo/config/options.py +++ b/bonobo/config/options.py @@ -53,13 +53,15 @@ class Option: _creation_counter = 0 - def __init__(self, type=None, *, required=True, positional=False, default=None): + def __init__(self, type=None, *, required=True, positional=False, default=None, __doc__=None): self.name = None self.type = type self.required = required if default is None else False self.positional = positional self.default = default + self.__doc__ = __doc__ or self.__doc__ + # This hack is necessary for python3.5 self._creation_counter = Option._creation_counter Option._creation_counter += 1 diff --git a/bonobo/nodes/basics.py b/bonobo/nodes/basics.py index b346404..fa74e40 100644 --- a/bonobo/nodes/basics.py +++ b/bonobo/nodes/basics.py @@ -77,9 +77,13 @@ def _shorten(s, w): class PrettyPrinter(Configurable): - max_width = Option(int, required=False, __doc__=''' + max_width = Option( + int, + required=False, + __doc__=''' If set, truncates the output values longer than this to this width. - ''') + ''' + ) def call(self, *args, **kwargs): formater = self._format_quiet if settings.QUIET.get() else self._format_console