Revision 7b2e4bf1 kamaki/cli/__init__.py
b/kamaki/cli/__init__.py | ||
---|---|---|
39 | 39 |
from kamaki.cli.argument import ArgumentParseManager |
40 | 40 |
from kamaki.cli.history import History |
41 | 41 |
from kamaki.cli.utils import print_dict, red, magenta, yellow |
42 |
from kamaki.cli.errors import CLIError |
|
42 |
from kamaki.cli.errors import CLIError, CLICmdSpecError
|
|
43 | 43 |
from kamaki.cli import logger |
44 | 44 |
|
45 | 45 |
_help = False |
... | ... | |
146 | 146 |
kloger.warning('%s failed max_len test' % cls_name) |
147 | 147 |
return None |
148 | 148 |
|
149 |
( |
|
150 |
cls.description, sep, cls.long_description |
|
151 |
) = cls.__doc__.partition('\n') |
|
149 |
try: |
|
150 |
( |
|
151 |
cls.description, sep, cls.long_description |
|
152 |
) = cls.__doc__.partition('\n') |
|
153 |
except AttributeError: |
|
154 |
raise CLICmdSpecError( |
|
155 |
'No commend in %s (acts as cmd description)' % cls.__name__) |
|
152 | 156 |
_construct_command_syntax(cls) |
153 | 157 |
|
154 | 158 |
cmd_tree.add_command(cls_name, cls.description, cls) |
Also available in: Unified diff