示例#1
0
// 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
}
示例#2
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", "", "")
}
示例#3
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, "")
}