More work on transfer kitten

This commit is contained in:
Kovid Goyal
2023-04-27 16:34:52 +05:30
parent 7cec9016d3
commit 870522360e
4 changed files with 108 additions and 3 deletions

View File

@@ -44,9 +44,6 @@ func read_bypass(loc string) (string, error) {
}
func main(cmd *cli.Command, opts *Options, args []string) (rc int, err error) {
if err != nil {
rc = 1
}
if opts.PermissionsBypass != "" {
val, err := read_bypass(opts.PermissionsBypass)
if err != nil {
@@ -54,6 +51,17 @@ func main(cmd *cli.Command, opts *Options, args []string) (rc int, err error) {
}
opts.PermissionsBypass = strings.TrimSpace(val)
}
if len(args) == 0 {
return 1, fmt.Errorf("Must specify at least one file to transfer")
}
if opts.Direction == "send" {
err = send_main(opts, args)
} else {
err = receive_main(opts, args)
}
if err != nil {
rc = 1
}
return
}