require "devops-client/options/common_options"

class DeployOptions < CommonOptions

  attr_accessor :deploy_params

  COMMAND_NAME = "deploy"

  def initialize args, def_options
    super(args, def_options)
    self.header = I18n.t("headers.deploy")
   # self.deploy_params = ["PROJECT_ID", "DEPLOY_ENV"]
  end

  def deploy_options
    options do |parser, options|
      parser.banner << self.banner
      parser.resource_name = :deploy

      parser.recognize_option_value(:tag, variable: 'TAG1,TAG2...') do |tags|
        options[:tags] = tags.split(",")
      end
      parser.recognize_option_value(:named_task)
    end
  end

  def banners
    [ self.banner ]
  end

  def banner
    "\tdeploy NODE_NAME [NODE_NAME ...]\n"
  end

  def invalid_deploy_command
    puts "#{self.header}:\n#{self.banner}"
  end

end
