Skip to content

Commit

Permalink
Update put-main.go
Browse files Browse the repository at this point in the history
put: Add --md5 and --disable-multipart to make it easier to use.
  • Loading branch information
llchry authored Sep 24, 2024
1 parent 3dac3d3 commit c7120ce
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions cmd/put-main.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ var (
Usage: "upload only if object does not exist",
Hidden: true,
},
cli.BoolFlag{
Name: "disable-multipart",
Usage: "disable multipart upload feature",
},
cli.BoolFlag{
Name: "md5",
Usage: "force all upload(s) to calculate md5sum checksum",
},
}
)

Expand Down Expand Up @@ -115,6 +123,9 @@ func mainPut(cliCtx *cli.Context) (e error) {
fatalIf(errInvalidArgument().Trace(strconv.Itoa(threads)), "Invalid number of threads")
}

md5 := cliCtx.Bool("md5")
disableMultipart := cliCtx.Bool("disable-multipart")

// Parse encryption keys per command.
encryptionKeys, err := validateAndCreateEncryptionKeys(cliCtx)
if err != nil {
Expand Down Expand Up @@ -157,6 +168,8 @@ func mainPut(cliCtx *cli.Context) (e error) {
totalBytes += putURLs.SourceContent.Size
pg.SetTotal(totalBytes)
totalObjects++
putURLs.MD5 = md5
putURLs.DisableMultipart = disableMultipart
putURLsCh <- putURLs
}
close(putURLsCh)
Expand Down

0 comments on commit c7120ce

Please sign in to comment.