Revision eb46e9a1 kamaki/cli/command_shell.py

b/kamaki/cli/command_shell.py
197 197
            # exec command or change context
198 198
            if subcmd.is_command:  # exec command
199 199
                try:
200
                    cls = subcmd.get_class()
200
                    cls = subcmd.cmd_class
201 201
                    ldescr = getattr(cls, 'long_description', '')
202 202
                    if subcmd.path == 'history_run':
203 203
                        instance = cls(
......
241 241
                old_prompt = self.prompt
242 242
                new_context._roll_command(cmd.parent_path)
243 243
                new_context.set_prompt(subcmd.path.replace('_', ' '))
244
                newcmds = [subcmd for subcmd in subcmd.get_subcommands()]
244
                newcmds = [subcmd for subcmd in subcmd.subcommands.values()]
245 245
                for subcmd in newcmds:
246 246
                    new_context._register_command(subcmd.path)
247 247
                new_context.cmdloop()
......
253 253
        def help_method(self):
254 254
            print('%s (%s -h for more options)' % (cmd.help, cmd.name))
255 255
            if cmd.is_command:
256
                cls = cmd.get_class()
256
                cls = cmd.cmd_class
257 257
                ldescr = getattr(cls, 'long_description', '')
258 258
                #_construct_command_syntax(cls)
259 259
                plist = self.prompt[len(self._prefix):-len(self._suffix)]
......
277 277
        def complete_method(self, text, line, begidx, endidx):
278 278
            subcmd, cmd_args = cmd.parse_out(split_input(line)[1:])
279 279
            if subcmd.is_command:
280
                cls = subcmd.get_class()
280
                cls = subcmd.cmd_class
281 281
                instance = cls(dict(arguments))
282 282
                empty, sep, subname = subcmd.path.partition(cmd.path)
283 283
                cmd_name = '%s %s' % (cmd.name, subname.replace('_', ' '))
284 284
                print('\n%s\nSyntax:\t%s %s' % (
285
                    cls.description, cmd_name, cls.syntax))
285
                    cls.help, cmd_name, cls.syntax))
286 286
                cmd_args = {}
287 287
                for arg in instance.arguments.values():
288 288
                    cmd_args[','.join(arg.parsed_name)] = arg.help

Also available in: Unified diff