def get_tool_version(dir_string):
    """
    Strip off tools_dir and take the first two names in the directory hierarchy to
    be the tool name and version. Return (tool, version).
    """
    match = re.match('{0}/(.+)'.format(args.tools_dir), os.path.normpath(dir_string))
    if not match:
        raise Exception("Could not parse env.sh path: " + dir_string + "\n")
    directories = match.group(1).split('/')  #note normpath removes trailing '/'
    if len(directories) < 2:
        raise Exception("Module name does not appear to have a version: " + match.group(1) + "\n")
    tool, version = directories[:2]
    return (tool, version)

# Delete any old module files, i.e. which contain the expected whatis regex
# First build a list and warn the user
dataset/ETHPy150Open gvlproject/gvl_commandline_utilities/roles/gvl.commandline-utilities/files/toolshed_to_modules.py/get_tool_version/original