def get_versions(module, cmd_path, bare, **kwargs):
    """ pyenv versions [--bare]
    """
    cmd = [cmd_path, "versions"]
    if bare:
        cmd.append("--bare")
    rc, out, err = module.run_command(cmd, **kwargs)
    if rc:
        return (False, dict(msg=err, stdout=out))
    else:
        # slice: remove last newline
        versions = [line.strip() for line in out.split("\n")[:-1]]
        return (True, dict(
            changed=False, failed=False, stdout=out, stderr=err,
            versions=versions))