Skip to content
This repository has been archived by the owner on Feb 27, 2018. It is now read-only.

Commit

Permalink
Merge pull request #299 from tianon/no-more-socket
Browse files Browse the repository at this point in the history
Make "socket" an alias of "shellinit" and hide it from usage
  • Loading branch information
tianon committed Oct 23, 2014
2 parents 4973f89 + ce2bc31 commit bd95d5e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 29 deletions.
23 changes: 0 additions & 23 deletions cmds.go
Original file line number Diff line number Diff line change
Expand Up @@ -349,29 +349,6 @@ func cmdStatus() error {
return nil
}

// tell the User the Docker socket to connect to
func cmdSocket() error {
m, err := driver.GetMachine(&B2D)
if err != nil {
return fmt.Errorf("Failed to get machine %q: %s", B2D.VM, err)
}

if m.GetState() != driver.Running {
return fmt.Errorf("VM %q is not running.", B2D.VM)
}

socket, err := RequestSocketFromSSH(m)
if err != nil {
return fmt.Errorf("Error requesting socket: %s\n", err)
}

fmt.Fprintf(os.Stderr, "\n\t export DOCKER_HOST=")
fmt.Printf("%s", socket)
fmt.Fprintf(os.Stderr, "\n\n")

return nil
}

// Call the external SSH command to login into boot2docker VM.
func cmdSSH() error {
m, err := driver.GetMachine(&B2D)
Expand Down
5 changes: 2 additions & 3 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ func config() (*flag.FlagSet, error) {
}

func usageShort() {
fmt.Fprintf(os.Stderr, "Usage: %s [<options>] {help|init|up|ssh|save|down|poweroff|reset|restart|config|status|info|ip|socket|shellinit|delete|download|upgrade|version} [<args>]\n", os.Args[0])
fmt.Fprintf(os.Stderr, "Usage: %s [<options>] {help|init|up|ssh|save|down|poweroff|reset|restart|config|status|info|ip|shellinit|delete|download|upgrade|version} [<args>]\n", os.Args[0])
}

func usageLong(flags *flag.FlagSet) {
Expand All @@ -193,8 +193,7 @@ Commands:
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.
socket Display the DOCKER_HOST socket to connect to.
shellinit Display the shell command to set up the Docker client.
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).
Expand Down
4 changes: 1 addition & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,7 @@ func run() error {
return cmdDelete()
case "info":
return cmdInfo()
case "socket":
return cmdSocket()
case "shellinit":
case "shellinit", "socket":
return cmdShellInit()
case "status":
return cmdStatus()
Expand Down

0 comments on commit bd95d5e

Please sign in to comment.