def run(self, commandLine):

    # Sanity check
    assert self.mode in self.allModes

    # Check that requested admin operation is compatible with our "built" status
    if self.mode == "build":
      if self.isBuilt():
        self.error.gknoAlreadyBuilt()
        return True
    else:
      if not self.isBuilt():
        self.error.gknoNotBuilt()
        return False
      
    # Run the requested operation
    success = False
    if   self.mode == "build"       : success = self.build()
    elif self.mode == "update"      : success = self.update()
    elif self.mode == "update-light": success = self.updateLight()
    elif self.mode == "add-tool"    : success = self.addTool()
    elif self.mode == "version"     : success = self.showVersion()
    else:
    
      # Check command line for organism and/or release name, then resolve any potential alias.
      possibleResourceAlias, hasReleaseArg, releaseName = self.getResourceArgs(commandLine)
      resolvedOk, resourceName = self.resolveAlias(possibleResourceAlias)
      if not resolvedOk:
        self.error.requestedUnknownResource(possibleResourceAlias)
        return False

      # Add/remove/update as requested
      if   self.mode == "add-resource"   : success = self.addResource(resourceName, hasReleaseArg, releaseName)
      elif self.mode == "remove-resource": success = self.removeResource(resourceName, hasReleaseArg, releaseName)
      elif self.mode == "update-resource": success = self.updateResource(resourceName)

    # If admin mode ran successfully, update our user settings file
    if success: self.exportUserSettings()

    # Return success/failure
    return success

  # -------------------------------------------
  # Admin mode main operations
  # -------------------------------------------

  # "gkno build"
  #
  # Building gkno consists of ensuring that all git submodules are up-to-date, 
  # building (compiling) all tools, and fetching all default resources.
  #  
  # If the build succeeds, then gkno's 'built' status is set to True.
dataset/ETHPy150Open gkno/gkno_launcher/src/gkno/adminUtils.py/adminUtils.run/original