示例#1
0
func AddCmdFlags(f *flag.FlagSet) {
	f.BoolVar(&config.enabled, "consul", false, "")
	f.StringVar(&config.port, "consul-port", "8500", "")
	f.Var((*authVar)(&config.auth), "consul-auth", "")
	f.BoolVar(&config.sslEnabled, "consul-ssl", false, "")
	f.BoolVar(&config.sslVerify, "consul-ssl-verify", true, "")
	f.StringVar(&config.sslCert, "consul-ssl-cert", "", "")
	f.StringVar(&config.sslCaCert, "consul-ssl-cacert", "", "")
	f.StringVar(&config.token, "consul-token", "", "")
}
示例#2
0
func AddCmdFlags(f *flag.FlagSet) {
	f.BoolVar(&config.enabled, "consul", false, "")
	f.StringVar(&config.ip, "consul-ip", "127.0.0.1", "")
	f.StringVar(&config.port, "consul-port", "8500", "")
	f.Var((*authVar)(&config.auth), "consul-auth", "")
	f.BoolVar(&config.sslEnabled, "consul-ssl", false, "")
	f.BoolVar(&config.sslVerify, "consul-ssl-verify", true, "")
	f.StringVar(&config.sslCert, "consul-ssl-cert", "", "")
	f.StringVar(&config.sslCaCert, "consul-ssl-cacert", "", "")
	f.StringVar(&config.token, "consul-token", "", "")
	f.IntVar(&config.heartbeatsBeforeRemove, "heartbeats-before-remove", 1, "")
}
示例#3
0
func (c *Config) registerFlags(f *flag.FlagSet) {
	f.VarP(newMultiString(nil, &c.regexes), "regex", "r", `
            A regular expression to match filenames. (May be repeated.)`)
	f.VarP(newMultiString(nil, &c.inverseRegexes), "inverse-regex", "R", `
            A regular expression to exclude matching filenames.
            (May be repeated.)`)
	f.VarP(newMultiString(nil, &c.globs), "glob", "g", `
            A shell glob expression to match filenames. (May be repeated.)`)
	f.VarP(newMultiString(nil, &c.inverseGlobs), "inverse-glob", "G", `
            A shell glob expression to exclude matching filenames.
            (May be repeated.)`)
	f.StringVar(&c.subSymbol, "substitute", defaultSubSymbol, `
            The substitution symbol that is replaced with the filename
            in a command.`)
	f.BoolVarP(&c.startService, "start-service", "s", false, `
            Indicates that the command is a long-running process to be
            restarted on matching changes.`)
	f.BoolVar(&c.onlyFiles, "only-files", false, `
            Only match files (not directories).`)
	f.BoolVar(&c.onlyDirs, "only-dirs", false, `
            Only match directories (not files).`)
	f.BoolVar(&c.allFiles, "all", false, `
            Include normally ignored files (VCS and editor special files).`)
}