def remove
      if buildpack_url = shift_argument
        if options[:index]
          error("Please choose either index or Buildpack URL, but not both.")
        end
      elsif index = get_index
        # cool!
      else
        error("Usage: heroku buildpacks:remove [BUILDPACK_URL].\nMust specify a buildpack to remove, either by index or URL.")
      end

      mutate_buildpacks(buildpack_url, index, "removed") do |app_buildpacks|
        if app_buildpacks.size == 0
          error("No buildpacks were found. Next release on #{app} will detect buildpack normally.")
        end

        if index and (index < 0 or index > app_buildpacks.size)
          if app_buildpacks.size == 1
            error("Invalid index. Only valid value is 1.")
          else
            error("Invalid index. Please choose a value between 1 and #{app_buildpacks.size}")
          end
        end

        buildpack_urls = app_buildpacks.map { |buildpack|
          ordinal = buildpack["ordinal"].to_i
          if ordinal == index
            nil
          elsif buildpack["buildpack"]["url"] == buildpack_url
            nil
          else
            buildpack["buildpack"]["url"]
          end
        }.compact

        if buildpack_urls.size == app_buildpacks.size
          error("Buildpack not found. Nothing was removed.")
        end

        buildpack_urls
      end
    end
def remove
      if buildpack_url = shift_argument
        if options[:index]
          error("Please choose either index or Buildpack URL, but not both.")
        end
      elsif index = get_index
        # cool!
      else
        error("Usage: heroku buildpacks:remove [BUILDPACK_URL].\nMust specify a buildpack to remove, either by index or URL.")
      end

      mutate_buildpacks(buildpack_url, index, "removed") do |app_buildpacks|
        if app_buildpacks.size == 0
          error("No buildpacks were found. Next release on #{app} will detect buildpack normally.")
        end

        if index and (index < 0 or index > app_buildpacks.size)
          if app_buildpacks.size == 1
            error("Invalid index. Only valid value is 1.")
          else
            error("Invalid index. Please choose a value between 1 and #{app_buildpacks.size}")
          end
        end

        buildpack_urls = app_buildpacks.map { |buildpack|
          ordinal = buildpack["ordinal"].to_i
          if ordinal == index
            nil
          elsif buildpack["buildpack"]["url"] == buildpack_url
            nil
          else
            buildpack["buildpack"]["url"]
          end
        }.compact

        if buildpack_urls.size == app_buildpacks.size
          error("Buildpack not found. Nothing was removed.")
        end

        buildpack_urls
      end
    end
buildpacks:remove [BUILDPACK_URL]

 remove a buildpack set on the app

 -i, --index NUM      # the 1-based index of the URL to remove from the list of URLs