parameters: ()
docstring: Returns the version of command-line tools from pkgutil.
docstring_summary: Returns the version of command-line tools from pkgutil.
docstring_tokens: Returns the version of command - line tools from pkgutil .
function: def CLTVersion():
    """Returns the version of command-line tools from pkgutil."""
    # pkgutil output looks like
    #   package-id: com.apple.pkg.CLTools_Executables
    #   version: 5.0.1.0.1.1382131676
    #   volume: /
    #   location: /
    #   install-time: 1382544035
    #   groups: com.apple.FindSystemFiles.pkg-group com.apple.DevToolsBoth.pkg-group com.apple.DevToolsNonRelocatableShared.pkg-group
    STANDALONE_PKG_ID = "com.apple.pkg.DeveloperToolsCLILeo"
    FROM_XCODE_PKG_ID = "com.apple.pkg.DeveloperToolsCLI"
    MAVERICKS_PKG_ID = "com.apple.pkg.CLTools_Executables"
  
    regex = re.compile('version: (?P<version>.+)')
    for key in [MAVERICKS_PKG_ID, STANDALONE_PKG_ID, FROM_XCODE_PKG_ID]:
      try:
        output = GetStdout(['/usr/sbin/pkgutil', '--pkg-info', key])
        return re.search(regex, output).groupdict()['version']
      except:
        continue
function_tokens: def CLTVersion ( ) : # pkgutil output looks like #   package-id: com.apple.pkg.CLTools_Executables #   version: 5.0.1.0.1.1382131676 #   volume: / #   location: / #   install-time: 1382544035 #   groups: com.apple.FindSystemFiles.pkg-group com.apple.DevToolsBoth.pkg-group com.apple.DevToolsNonRelocatableShared.pkg-group STANDALONE_PKG_ID = "com.apple.pkg.DeveloperToolsCLILeo" FROM_XCODE_PKG_ID = "com.apple.pkg.DeveloperToolsCLI" MAVERICKS_PKG_ID = "com.apple.pkg.CLTools_Executables" regex = re . compile ( 'version: (?P<version>.+)' ) for key in [ MAVERICKS_PKG_ID , STANDALONE_PKG_ID , FROM_XCODE_PKG_ID ] : try : output = GetStdout ( [ '/usr/sbin/pkgutil' , '--pkg-info' , key ] ) return re . search ( regex , output ) . groupdict ( ) [ 'version' ] except : continue