2018-03-25 15:03:37 +00:00
|
|
|
package ftpflags
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/ncw/rclone/cmd/serve/ftp/ftpopt"
|
|
|
|
"github.com/ncw/rclone/fs/config/flags"
|
2018-10-27 22:58:18 +00:00
|
|
|
"github.com/ncw/rclone/fs/rc"
|
2018-03-25 15:03:37 +00:00
|
|
|
"github.com/spf13/pflag"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Options set by command line flags
|
|
|
|
var (
|
|
|
|
Opt = ftpopt.DefaultOpt
|
|
|
|
)
|
|
|
|
|
|
|
|
// AddFlagsPrefix adds flags for the ftpopt
|
|
|
|
func AddFlagsPrefix(flagSet *pflag.FlagSet, prefix string, Opt *ftpopt.Options) {
|
2018-10-27 22:58:18 +00:00
|
|
|
rc.AddOption("ftp", &Opt)
|
2018-03-25 15:03:37 +00:00
|
|
|
flags.StringVarP(flagSet, &Opt.ListenAddr, prefix+"addr", "", Opt.ListenAddr, "IPaddress:Port or :Port to bind server to.")
|
|
|
|
flags.StringVarP(flagSet, &Opt.PassivePorts, prefix+"passive-port", "", Opt.PassivePorts, "Passive port range to use.")
|
|
|
|
flags.StringVarP(flagSet, &Opt.BasicUser, prefix+"user", "", Opt.BasicUser, "User name for authentication.")
|
|
|
|
flags.StringVarP(flagSet, &Opt.BasicPass, prefix+"pass", "", Opt.BasicPass, "Password for authentication. (empty value allow every password)")
|
|
|
|
}
|
|
|
|
|
|
|
|
// AddFlags adds flags for the httplib
|
|
|
|
func AddFlags(flagSet *pflag.FlagSet) {
|
|
|
|
AddFlagsPrefix(flagSet, "", &Opt)
|
|
|
|
}
|