def command(function):
    """Command decorator"""
    def decorate(*args, **kwargs):
        exit_code = 1
        try:
            exit_code = function(*args, **kwargs)
        except Exception as e:
            if str(e):
                click.secho('Error: ' + str(e), fg='red')
        finally:
            return exit_code
    return decorate