Revision 264a13f7 kamaki/cli/argument/__init__.py

b/kamaki/cli/argument/__init__.py
459 459
            if arg.arity != 0:
460 460
                ret += ' %s' % required.upper()
461 461
            ret = ('{:<%s}' % lt_pn).format(ret)
462
            prefix = ('\n%s' % tab2) if len(ret) < lt_pn else ' '
463
            step, cur = (len(arg.help) / (lt_all - lt_pn)) or len(arg.help), 0
462
            prefix = ('\n%s' % tab2) if len(ret) > lt_pn else ' '
463
            cur = 0
464 464
            while arg.help[cur:]:
465
                next = cur + step
465
                next = cur + lt_all - lt_pn
466 466
                ret += prefix
467 467
                ret += ('{:<%s}' % (lt_all - lt_pn)).format(arg.help[cur:next])
468 468
                cur, finish = next, '\n%s' % tab2
......
581 581
            if not self._parse_required_arguments(self.required, parsed_args):
582 582
                self.print_help()
583 583
                raise CLISyntaxError('Missing required arguments')
584

  
585 584
        except SystemExit:
586 585
            raiseCLIError(CLISyntaxError('Argument Syntax Error'))
587 586
        for name, arg in self.arguments.items():

Also available in: Unified diff