Sha256: 4ae33926e4b2f26cbc4a2938f6b8a8d54832ac80fc3a8c78bade33d9aa3813d3

Contents?: true

Size: 1.26 KB

Versions: 14

Compression:

Stored size: 1.26 KB

Contents

module ConfigureS3Website
  class CLI
    def self.optparse_and_options
      options = {}
      optparse = OptionParser.new do |opts|
        opts.banner = banner
        opts.on('--headless',
                'Run without interaction from the user. See the --autocreate-cloudfront-dist for more info.') do
          options[:headless] = true
        end
        opts.on('--autocreate-cloudfront-dist',
                'When running with --headless, automatically create a CloudFront distribution for your S3 website.') do
          options['autocreate-cloudfront-dist'] = true
        end
        opts.on('-f', '--config-file FILE',
                'Pick credentials and the S3 bucket name from a config file') do
                |yaml_file_path|
          options[:config_source] =
            ConfigureS3Website::FileConfigSource.new yaml_file_path
        end
        opts.on('-v', '--verbose', 'Print more stuff') do
          options[:verbose] = true
        end
        opts.on('--help', 'Display this screen') do
          puts opts
          exit
        end
      end
      [options, optparse]
    end

    private

    def self.banner
      %|Usage: #{File.basename(__FILE__)} arguments

Configure your S3 bucket to function as a web site

Arguments:
      |
    end
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
configure-s3-website-ng-3.0.0 lib/configure-s3-website/cli.rb
configure-s3-website-2.3.0 lib/configure-s3-website/cli.rb
configure-s3-website-2.2.0 lib/configure-s3-website/cli.rb
configure-s3-website-2.1.0 lib/configure-s3-website/cli.rb
configure-s3-website-2.0.0 lib/configure-s3-website/cli.rb
configure-s3-website-2.0.0.pre.RC2 lib/configure-s3-website/cli.rb
configure-s3-website-2.0.0.pre.RC1 lib/configure-s3-website/cli.rb
configure-s3-website-1.7.5 lib/configure-s3-website/cli.rb
configure-s3-website-1.7.4 lib/configure-s3-website/cli.rb
configure-s3-website-1.7.3 lib/configure-s3-website/cli.rb
configure-s3-website-1.7.2 lib/configure-s3-website/cli.rb
configure-s3-website-1.7.1 lib/configure-s3-website/cli.rb
configure-s3-website-1.7.0 lib/configure-s3-website/cli.rb
configure-s3-website-1.6.0 lib/configure-s3-website/cli.rb