Revision 9b3c8fd9

b/kamaki/cli/argument/__init__.py
452 452

  
453 453
    def __init__(
454 454
            self, exe,
455
            arguments=None, required=None, syntax=None, description=None):
455
            arguments=None, required=None, syntax=None, description=None,
456
            check_required=True):
456 457
        """
457 458
        :param exe: (str) the basic command (e.g. 'kamaki')
458 459

  
......
473 474
        :param syntax: (str) The basic syntax of the arguments. Default:
474 475
            exe <cmd_group> [<cmd_subbroup> ...] <cmd>
475 476
        :param description: (str) The description of the commands or ''
477
        :param check_required: (bool) Set to False inorder not to check for
478
            required argument values while parsing
476 479
        """
477 480
        self.parser = ArgumentParser(
478 481
            add_help=False, formatter_class=RawDescriptionHelpFormatter)
479 482
        self._exe = exe
480 483
        self.syntax = syntax or (
481 484
            '%s <cmd_group> [<cmd_subbroup> ...] <cmd>' % exe)
482
        self.required = required
485
        self.required, self.check_required = required, check_required
483 486
        self.parser.description = description or ''
484 487
        if arguments:
485 488
            self.arguments = arguments
......
613 616
            self.update_parser()
614 617

  
615 618
    def _parse_required_arguments(self, required, parsed_args):
616
        if not required:
619
        if not (self.check_required and required):
617 620
            return True
618 621
        if isinstance(required, tuple):
619 622
            for item in required:
b/kamaki/cli/command_shell.py
175 175
        tmp_args.pop('verbose', None)
176 176
        tmp_args.pop('silent', None)
177 177
        tmp_args.pop('config', None)
178
        print 'YOLO >>>\n\t', '\n\t'.join([
179
            ('%s %s %s' % k, v, v.value) for k, v in args.items()])
180 178
        help_parser = ArgumentParseManager(
181
            cmd_name, tmp_args, required, syntax=syntax, description=descr)
179
            cmd_name, tmp_args, required,
180
            syntax=syntax, description=descr, check_required=False)
182 181
        return help_parser.print_help
183 182

  
184 183
    def _register_command(self, cmd_path):
b/kamaki/cli/commands/__init__.py
252 252

  
253 253
    @property
254 254
    def value(self):
255
        return self._value
255
        return getattr(self, '_value', None)
256 256

  
257 257
    @value.setter
258 258
    def value(self, newvalue):

Also available in: Unified diff