def handle(self, *args, **options):

        if not len(args) or options['list']:

            page = options.get('page')
            per_page = options.get('per-page')
            ordered_by = [x.strip() for x in options.get('order').split(',')]
            self.show_options_list( Option.objects.all().order_by(*ordered_by), page, per_page )
            return

        option_key = args[0].strip()

        if options['value_to_add']:
            value, action = self.read_value(options['value_to_add'], *args[1:], **options)
            if not add_option( option_key, value ):
                raise CommandError("Cannot add '%s' option, already exists" % option_key)
            self.stdout.write('Add %s: %s %s' % ( option_key, value, action) )
        elif options['value_to_update']:
            value, action = self.read_value(options['value_to_update'], *args[1:], **options)
            if not update_option( option_key, value ):
                raise CommandError("Cannot update '%s' option with '%s'" % (option_key,value))
            self.stdout.write('Update %s: %s %s' % ( option_key, value, action ) )
        elif options['delete']:
            if 1 > len(args): raise CommandError('Too much arguments: %s' % args)
            if not delete_option( option_key ):
                raise CommandError("Cannot delete '%s' option" % option_key)
            self.stdout.write('Delete %s' % option_key )
        else:
            self.show_option_value( option_key )
dataset/ETHPy150Open joke2k/django-options/django_options/management/commands/options.py/Command.handle/swapped operands of `>`