mirror of https://github.com/schollz/croc.git
flag is no compress
This commit is contained in:
parent
bc34811750
commit
7be11a6fda
8
main.go
8
main.go
|
@ -34,8 +34,8 @@ func main() {
|
||||||
Description: "send a file over the relay",
|
Description: "send a file over the relay",
|
||||||
ArgsUsage: "[filename]",
|
ArgsUsage: "[filename]",
|
||||||
Flags: []cli.Flag{
|
Flags: []cli.Flag{
|
||||||
cli.BoolTFlag{Name: "compress, o"},
|
cli.BoolFlag{Name: "no-compress, o"},
|
||||||
cli.BoolTFlag{Name: "encrypt, e"},
|
cli.BoolFlag{Name: "no-encrypt, e"},
|
||||||
},
|
},
|
||||||
HelpName: "croc send",
|
HelpName: "croc send",
|
||||||
Action: func(c *cli.Context) error {
|
Action: func(c *cli.Context) error {
|
||||||
|
@ -113,8 +113,8 @@ func send(c *cli.Context) error {
|
||||||
if fname == "" {
|
if fname == "" {
|
||||||
return errors.New("must specify file: croc send [filename]")
|
return errors.New("must specify file: croc send [filename]")
|
||||||
}
|
}
|
||||||
cr.UseCompression = c.BoolT("compress")
|
cr.UseCompression = !c.Bool("no-compress")
|
||||||
cr.UseEncryption = c.BoolT("encrypt")
|
cr.UseEncryption = !c.Bool("no-encrypt")
|
||||||
return cr.Send(fname, c.GlobalString("code"))
|
return cr.Send(fname, c.GlobalString("code"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,7 @@ func (c *Croc) Relay() error {
|
||||||
|
|
||||||
// Send will take an existing file or folder and send it through the croc relay
|
// Send will take an existing file or folder and send it through the croc relay
|
||||||
func (c *Croc) Send(fname string, codePhrase string) (err error) {
|
func (c *Croc) Send(fname string, codePhrase string) (err error) {
|
||||||
|
log.Debugf("sending %s with compression, encryption: (%v, %v)", fname, c.UseCompression, c.UseEncryption)
|
||||||
// prepare code phrase
|
// prepare code phrase
|
||||||
defer c.cleanup()
|
defer c.cleanup()
|
||||||
c.cs.Lock()
|
c.cs.Lock()
|
||||||
|
|
Loading…
Reference in New Issue