# frozen_string_literal: true require "thor" require_relative "list" require_relative "add" require_relative "remove" require_relative "../../sub_command_base" module Neetob class CLI module Heroku module Access class Commands < SubCommandBase class_option :apps, { type: :array, aliases: "-a", required: true, desc: "Heroku app names. Can be matched using the '*' wildcard. Example: \"neeto*\" \"neeto-cal-web-staging\"" } desc "list", "List all the users of the Heroku apps" def list List.new(options[:apps], options[:sandbox]).run end desc "add", "Add new users to the Heroku apps" option :users, type: :array, required: true, desc: "Users' emails that need to be added to Heroku apps" def add Add.new(options[:apps], options[:users], options[:sandbox]).run end desc "remove", "Remove the users from the Heroku apps" option :users, type: :array, required: true, desc: "Users' emails that need to be removed from the Heroku apps" def remove Remove.new(options[:apps], options[:users], options[:sandbox]).run end end end end end end