// Add cmdline params for this driver func ConfigFlags(B2D *driver.MachineConfig, flags *flag.FlagSet) error { //B2D.DriverCfg["virtualbox"] = cfg flags.StringVar(&cfg.VMDK, "basevmdk", "", "Path to VMDK to use as base for persistent partition") cfg.VBM = "VBoxManage" if runtime.GOOS == "windows" { p := "C:\\Program Files\\Oracle\\VirtualBox" if t := os.Getenv("VBOX_INSTALL_PATH"); t != "" { p = t } else if t = os.Getenv("VBOX_MSI_INSTALL_PATH"); t != "" { p = t } cfg.VBM = filepath.Join(p, "VBoxManage.exe") } flags.StringVar(&cfg.VBM, "vbm", cfg.VBM, "path to VirtualBox management utility.") // TODO once boot2docker improves, replace this all with homeDir() from config.go so we only share the current user's HOME by default shareDefault = "disable" switch runtime.GOOS { case "darwin": shareDefault = "/Users" + shareSliceSep + "Users" case "windows": shareDefault = "C:\\Users" + shareSliceSep + "c/Users" } var defaultText string if shareDefault != "disable" { defaultText = "(defaults to '" + shareDefault + "' if no shares are specified; use 'disable' to explicitly prevent any shares from being created) " } flags.Var(&cfg.shares, "vbox-share", fmt.Sprintf("%sList of directories to share during 'up|start|boot' via VirtualBox Guest Additions, with optional labels", defaultText)) return nil }
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, "") }
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", "", "") }
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).`) }
// Add cmdline params for this driver func ConfigFlags(B2D *driver.MachineConfig, flags *flag.FlagSet) error { //B2D.DriverCfg["dummy"] = cfg flags.StringVar(&cfg.DummyParam, "no-dummy", "", "Example parameter for the dummy driver.") return nil }
func addCommonOptions(f *flag.FlagSet) { f.StringVar(&ipaddr, "ip", "", "the IP address of the TUN/TAP device") f.StringVar(&netmask, "netmask", "255.255.0.0", "the netmask of the TUN/TAP device") f.StringVar(&password, "pass", "insecure", "password for authentication") }