Skip to content

Commit

Permalink
Add --host and --host-bucket command line options
Browse files Browse the repository at this point in the history
To update Config().host_base and host_bucket via CLI without
having to edit the config file.  Useful when specifying
a non-S3 host.

Likely also want to set --region.
  • Loading branch information
mdomsch committed Dec 10, 2015
1 parent de0da80 commit 84168b2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion s3cmd
Original file line number Diff line number Diff line change
Expand Up @@ -2472,7 +2472,7 @@ class MyHelpFormatter(IndentedHelpFormatter):

def main():
global cfg

cfg = Config()
commands_list = get_commands_list()
commands = {}

Expand Down Expand Up @@ -2544,6 +2544,8 @@ def main():

optparser.add_option( "--files-from", dest="files_from", action="append", metavar="FILE", help="Read list of source-file names from FILE. Use - to read from stdin.")
optparser.add_option( "--region", "--bucket-location", metavar="REGION", dest="bucket_location", help="Region to create bucket in. As of now the regions are: us-east-1, us-west-1, us-west-2, eu-west-1, eu-central-1, ap-northeast-1, ap-southeast-1, ap-southeast-2, sa-east-1")
optparser.add_option( "--host", metavar="HOSTNAME", dest="host_base", help="HOSTNAME:PORT for S3 endpoint (default: %s, alternatives such as s3-eu-west-1.amazonaws.com). You should also set --host-bucket." % (cfg.host_base))
optparser.add_option( "--host-bucket", dest="host_bucket", help="DNS-style bucket+hostname:port template for accessing a bucket (default: %s)" % (cfg.host_bucket))
optparser.add_option( "--reduced-redundancy", "--rr", dest="reduced_redundancy", action="store_true", help="Store object with 'Reduced redundancy'. Lower per-GB price. [put, cp, mv]")
optparser.add_option( "--no-reduced-redundancy", "--no-rr", dest="reduced_redundancy", action="store_false", help="Store object without 'Reduced redundancy'. Higher per-GB price. [put, cp, mv]")
optparser.add_option( "--storage-class", dest="storage_class", action="store", metavar="CLASS", help="Store object with specified CLASS (STANDARD, STANDARD_IA, or REDUCED_REDUNDANCY). Lower per-GB price. [put, cp, mv]")
Expand Down

0 comments on commit 84168b2

Please sign in to comment.