Example #1
0
func usageLong(flags *flag.FlagSet) {
	// NOTE: the help message uses spaces, not tabs for indentation!
	fmt.Fprintf(os.Stderr, `Usage: %s [<options>] <command> [<args>]

Boot2Docker management utility.

Commands:
   init                Create a new Boot2Docker VM.
   up|start|boot       Start VM from any states.
   ssh [ssh-command]   Login to VM via SSH.
   save|suspend        Suspend VM and save state to disk.
   down|stop|halt      Gracefully shutdown the VM.
   restart             Gracefully reboot the VM.
   poweroff            Forcefully power off the VM (may corrupt disk image).
   reset               Forcefully power cycle the VM (may corrupt disk image).
   delete|destroy      Delete Boot2Docker VM and its disk image.
   config|cfg          Show selected profile file settings.
   info                Display detailed information of VM.
   ip                  Display the IP address of the VM's Host-only network.
   shellinit           Display the shell commands to set up the Docker client.
   status              Display current state of VM.
   download            Download Boot2Docker ISO image.
   upgrade             Upgrade the Boot2Docker ISO image (restart if running).
   version             Display version information.

Options:
`, os.Args[0])
	flags.PrintDefaults()
}
Example #2
0
func usageLong(flags *flag.FlagSet) {
	// NOTE: the help message uses spaces, not tabs for indentation!
	errf(`Usage: %s [<options>] <command> [<args>]

boot2kevoree management utility.

Commands:
    init                    Create a new boot2kevoree VM.
    up|start|boot           Start VM from any states.
    ssh [ssh-command]       Login to VM via SSH.
    editor                  Open the Kevoree editor.
    gui                     Open the default Kevoree cloud GUI in your browser.
    save|suspend            Suspend VM and save state to disk.
    down|stop|halt          Gracefully shutdown the VM.
    restart                 Gracefully reboot the VM.
    poweroff                Forcefully power off the VM (might corrupt disk image).
    reset                   Forcefully power cycle the VM (might corrupt disk image).
    delete                  Delete boot2kevoree VM and its disk image.
    config|cfg              Show selected profile file settings.
    info                    Display detailed information of VM.
    status                  Display current state of VM.
    download                Download boot2kevoree ISO image.
    version                 Display version information.

Options:
`, os.Args[0])
	flags.PrintDefaults()
}
Example #3
0
func usageLong(flags *flag.FlagSet) {
	// NOTE: the help message uses spaces, not tabs for indentation!
	errf(`Usage: %s [<options>] <command> [<args>]

boot2docker management utility.

Commands:
    init [<vm>]             Create a new boot2docker VM.
    up|start|boot [<vm>]    Start VM from any states.
    ssh                     Login to VM via SSH.
    save|suspend [<vm>]     Suspend VM and save state to disk.
    down|stop|halt [<vm>]   Gracefully shutdown the VM.
    restart [<vm>]          Gracefully reboot the VM.
    poweroff [<vm>]         Forcefully power off the VM (might corrupt disk image).
    reset [<vm>]            Forcefully power cycle the VM (might corrupt disk image).
    delete [<vm>]           Delete boot2docker VM and its disk image.
    config|cfg              Show selected profile file settings.
    info [<vm>]             Display detailed information of VM.
    status [<vm>]           Display current state of VM.
    download                Download boot2docker ISO image.
    version                 Display version information.

Options:
`, os.Args[0])
	flags.PrintDefaults()
}
Example #4
0
func id_main(f *flag.FlagSet) {
	file_list := f.Args()

	if len(file_list) == 0 {
		identify_pipe()
	} else if len(file_list) == 1 && !(recursive_flag || include_meta) && depth == 0 {
		identify_file(file_list[0])
	} else {
		identify_files(file_list)
	}

}
Example #5
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
}
Example #6
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", "", "")
	f.IntVar(&config.heartbeatsBeforeRemove, "heartbeats-before-remove", 1, "")
}
Example #7
0
// 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
}
Example #8
0
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")
}
Example #9
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).`)
}