Skip to content

Commit e34b33f

Browse files
Mike KingMike King
authored andcommitted
Improved readme - added --region, and default to same filename
1 parent a5a7e78 commit e34b33f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,13 @@ You can also point it to another config file with e.g. `$ s3-cli --config /path/
3535

3636
### put
3737

38-
Uploads a file to S3.
38+
Uploads a file to S3. Assumes the target filename to be the same as the source filename (if none specified)
3939

4040
Example:
4141

4242
```
4343
s3-cli put /path/to/file s3://bucket/key/on/s3
44+
s3-cli put /path/to/source-file s3://bucket/target-file
4445
```
4546

4647
Options:
@@ -53,6 +54,7 @@ Options:
5354
* `--add-header=NAME:VALUE` - Add a given HTTP header to the upload request. Can be
5455
used multiple times. For instance set 'Expires' or 'Cache-Control' headers
5556
(or both) using this options if you like.
57+
* `--region=REGION-NAME` - Specify the region (defaults to us-east-1)
5658

5759
### get
5860

cli.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ function cmdPut() {
221221
var source = args._[0];
222222
var dest = args._[1];
223223
var parts = parseS3Url(dest);
224-
if (/\/$/.test(parts.key)) {
224+
if (/\/$/.test(parts.key) || parts.key == '') {
225225
parts.key += path.basename(source);
226226
}
227227
var acl = getAcl();

0 commit comments

Comments
 (0)