def addResource(self, resourceName, hasReleaseArg=False, releaseName=""):

    # If no organism name provided, list all available organisms
    # ("gkno add-resource")
    if resourceName == "":
      self.listAddableResources()
      return True

    # Otherwise, make sure that gkno actually knows about this organism
    else:
      found = False
      for resource in conf.resources:
        if resource.name == resourceName:
          found = True
          break
      if not found:
        self.error.requestedUnknownResource(resourceName)
        return False

    # If no release mentioned at all, fetch the current release for requested organism
    # ("gkno add-resource X")
    if not hasReleaseArg:
      print("Fetching current release for "+resourceName+":", file=sys.stdout)
      sys.stdout.flush()
      return self.addCurrentRelease(resourceName, "  ")

    # If "--release" was entered without a release name, list all available releases for specified organism
    # ("gkno add-resource X --release")
    if releaseName == "":
      self.listAddableReleases(resourceName)
      return True

    # Otherwise, fetch requested release for requested organism
    # ("gkno add-resource X --release Y")
    else:
      print("Fetching release "+releaseName+" for "+resourceName+":", file=sys.stdout)
      sys.stdout.flush()
      return self.addRelease(resourceName, releaseName, "  ")

  # "gkno remove-resource [organism] [options]"
  #
  # Depending on input parameters, either lists removable resources/releases or 
  # removes the requested resource/release.
dataset/ETHPy150Open gkno/gkno_launcher/src/gkno/adminUtils.py/adminUtils.addResource/original