def args_to_str(*args, **kwargs):
    """Convert the given args to a string command."""
    text = ''
    if len(args) > 0:
        text += ' '.join((str(arg) for arg in args))
    if len(kwargs) > 0:
        if len(args) > 0:
            text += ' '
        text += ' '.join(('--{} {}'.format(k, v) for k, v in kwargs.items()))

    text = text.rstrip()
    return text