mirror of
https://github.com/schollz/croc.git
synced 2025-10-11 13:21:00 +02:00
Added --zip CLI argument for zipping all the dir specified
This commit is contained in:
parent
f0f9b80bdf
commit
4ea9a96d88
1 changed files with 3 additions and 2 deletions
|
@ -94,6 +94,7 @@ func Run() (err error) {
|
||||||
&cli.BoolFlag{Name: "local", Usage: "force to use only local connections"},
|
&cli.BoolFlag{Name: "local", Usage: "force to use only local connections"},
|
||||||
&cli.BoolFlag{Name: "ignore-stdin", Usage: "ignore piped stdin"},
|
&cli.BoolFlag{Name: "ignore-stdin", Usage: "ignore piped stdin"},
|
||||||
&cli.BoolFlag{Name: "overwrite", Usage: "do not prompt to overwrite"},
|
&cli.BoolFlag{Name: "overwrite", Usage: "do not prompt to overwrite"},
|
||||||
|
&cli.BoolFlag{Name: "zip", Usage: "zip folder if specified"},
|
||||||
&cli.StringFlag{Name: "curve", Value: "p256", Usage: "choose an encryption curve (" + strings.Join(pake.AvailableCurves(), ", ") + ")"},
|
&cli.StringFlag{Name: "curve", Value: "p256", Usage: "choose an encryption curve (" + strings.Join(pake.AvailableCurves(), ", ") + ")"},
|
||||||
&cli.StringFlag{Name: "ip", Value: "", Usage: "set sender ip if known e.g. 10.0.0.1:9009, [::1]:9009"},
|
&cli.StringFlag{Name: "ip", Value: "", Usage: "set sender ip if known e.g. 10.0.0.1:9009, [::1]:9009"},
|
||||||
&cli.StringFlag{Name: "relay", Value: models.DEFAULT_RELAY, Usage: "address of the relay", EnvVars: []string{"CROC_RELAY"}},
|
&cli.StringFlag{Name: "relay", Value: models.DEFAULT_RELAY, Usage: "address of the relay", EnvVars: []string{"CROC_RELAY"}},
|
||||||
|
@ -186,6 +187,7 @@ func send(c *cli.Context) (err error) {
|
||||||
Curve: c.String("curve"),
|
Curve: c.String("curve"),
|
||||||
HashAlgorithm: c.String("hash"),
|
HashAlgorithm: c.String("hash"),
|
||||||
ThrottleUpload: c.String("throttleUpload"),
|
ThrottleUpload: c.String("throttleUpload"),
|
||||||
|
ZipFolder: c.Bool("zip"),
|
||||||
}
|
}
|
||||||
if crocOptions.RelayAddress != models.DEFAULT_RELAY {
|
if crocOptions.RelayAddress != models.DEFAULT_RELAY {
|
||||||
crocOptions.RelayAddress6 = ""
|
crocOptions.RelayAddress6 = ""
|
||||||
|
@ -266,8 +268,7 @@ func send(c *cli.Context) (err error) {
|
||||||
// generate code phrase
|
// generate code phrase
|
||||||
crocOptions.SharedSecret = utils.GetRandomName()
|
crocOptions.SharedSecret = utils.GetRandomName()
|
||||||
}
|
}
|
||||||
|
minimalFileInfos, emptyFoldersToTransfer, totalNumberFolders, err := croc.GetFilesInfo(fnames, crocOptions.ZipFolder)
|
||||||
minimalFileInfos, emptyFoldersToTransfer, totalNumberFolders, err := croc.GetFilesInfo(fnames)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue