Delete a user from the specified htpasswd file.

    pwfile
        Path to htpasswd file

    user
        User name

    runas
        The system user to run htpasswd command with

    all_results
        Return stdout, stderr, and retcode, not just stdout

    CLI Examples:

    .. code-block:: bash

        salt '*' webutil.userdel /etc/httpd/htpasswd larry

def userdel(pwfile, user, runas=None, all_results=False):
    '''
    Delete a user from the specified htpasswd file.

    pwfile
        Path to htpasswd file

    user
        User name

    runas
        The system user to run htpasswd command with

    all_results
        Return stdout, stderr, and retcode, not just stdout

    CLI Examples:

    .. code-block:: bash

        salt '*' webutil.userdel /etc/httpd/htpasswd larry
    '''
    if not os.path.exists(pwfile):
        return 'Error: The specified htpasswd file does not exist'

    cmd = ['htpasswd', '-D', pwfile, user]

    if all_results:
        out = __salt__['cmd.run_all'](cmd, runas=runas, python_shell=False)
    else:
        out = __salt__['cmd.run'](cmd, runas=runas,
                                  python_shell=False).splitlines()

    return out