require "optparse"
require "devops-client/options/server_options"
require "devops-client/options/image_options"
require "devops-client/options/project_options"
require "devops-client/options/environment_options"
require "devops-client/options/category_options"
require "devops-client/options/provider_options"
require "devops-client/options/common_options"
require "devops-client/options/deploy_options"
require "devops-client/options/key_options"
require "devops-client/options/user_options"
require "devops-client/options/script_options"
require "devops-client/options/filter_options"
require "devops-client/options/chef_options"
require "devops-client/options/role_options"
require "devops-client/options/stack_template_options"
require "devops-client/options/stack_options"

class Main < CommonOptions

  COMMAND_NAME = ""

  def initialize args, def_options
    super(args, def_options)
  end

  def info
    o = nil
    classes = [
      ChefOptions,
      DeployOptions,
      FilterOptions,
      ImageOptions,
      KeyOptions,
      ProjectOptions,
      EnvironmentOptions,
      CategoryOptions,
      ProviderOptions,
      ScriptOptions,
      ServerOptions,
      UserOptions,
      RoleOptions,
      StackTemplateOptions,
      StackOptions
    ]
    options do |opts, options|
      classes.each {|cl| opts.banner << cl.new(ARGV, default_options).error_banner}
      o = opts
    end
    puts(o.banner + "\n")
  end

end
