Sha256: 024e56668a03a3f453860f2faca0d445164c33471fb61e332fa1f77b72197bcd

Contents?: true

Size: 1.18 KB

Versions: 3

Compression:

Stored size: 1.18 KB

Contents

module WordPressTools
  module SharedOptions
    extend ActiveSupport::Concern

    class_methods do
      def shared_options
        [
          [:force, { type: :boolean, desc: "Overwrite existing WP-CLI / WP-CLI Server installation" }],
          [:locale, { aliases: "-l", desc: "WordPress locale", default: Configuration.for(:locale) }],
          [:bare, { type: :boolean, aliases: "-b", desc: "Remove default themes and plugins" }],
          [:admin_user, { desc: "WordPress admin user", default: Configuration.for(:admin_user) }],
          [:admin_email, { desc: "WordPress admin email", default: Configuration.for(:admin_email) }],
          [:admin_password, { desc: "WordPress admin password", default: Configuration.for(:admin_password) }],
          [:db_user, { desc: "MySQL database user", default: Configuration.for(:db_user) }],
          [:db_password, { desc: "MySQL database pasword", default: Configuration.for(:db_password) }],
          [:site_url, { desc: "Wordpress site URL", default: Configuration.for(:site_url) }]
        ]
      end

      def add_method_options(options)
        options.each do |option|
          method_option(*option)
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
wordpress_tools-1.1.3 lib/wordpress_tools/shared_options.rb
wordpress_tools-1.1.2 lib/wordpress_tools/shared_options.rb
wordpress_tools-1.1.1 lib/wordpress_tools/shared_options.rb