import shlex


def showcmd(args: list) -> str:
    """
    Stringify the elements of ``args``, shell-quote them, and join the results
    with a space
    """
    return " ".join(shlex.quote(str(a)) for a in args)