class S3Ranger::CLI::BaseCmd

Public Instance Methods

has_options?() click to toggle source
# File lib/s3ranger/cli.rb, line 43
def has_options?
  not options.instance_variables.empty?
end
has_prefix?() click to toggle source
# File lib/s3ranger/cli.rb, line 47
def has_prefix?
  @has_prefix
end
usage() click to toggle source
# File lib/s3ranger/cli.rb, line 51
def usage
  u = []
  u << "Usage: #{File.basename commandparser.program_name} #{name} "
  u << "[options] " if has_options?
  u << "bucket" if has_args?

  if has_prefix? == 'required'
    u << ':prefix'
  elsif has_prefix?
    u << "[:prefix]"
  end

  u.join ''
end

Protected Instance Methods

parse_acl(opt) click to toggle source
# File lib/s3ranger/cli.rb, line 68
def parse_acl(opt)
  @acl = nil
  opt.on("-a", "--acl=ACL", "Options: #{AVAILABLE_ACLS.join ', '}") {|acl|
    @acl = acl.to_sym
  }
end