func HTTPAddrFlag(f *flag.FlagSet) *string {
	defaultHTTPAddr := os.Getenv(HTTPAddrEnvName)
	if defaultHTTPAddr == "" {
		defaultHTTPAddr = "127.0.0.1:8500"
	}
	return f.String("http-addr", defaultHTTPAddr,
		"HTTP address of the Consul agent")
}
HTTPAddrFlag returns a pointer to a string that will be populated
when the given flagset is parsed with the HTTP address of the Consul.
package command
import (
	"flag"
	"os"
	consulapi "github.com/socketplane/socketplane/Godeps/_workspace/src/github.com/hashicorp/consul/api"
	"github.com/socketplane/socketplane/Godeps/_workspace/src/github.com/hashicorp/consul/command/agent"
)
const (
	RPCAddrEnvName = "CONSUL_RPC_ADDR"
	HTTPAddrEnvName = "CONSUL_HTTP_ADDR"
)
func RPCAddrFlag(f *flag.FlagSet) *string {
	defaultRPCAddr := os.Getenv(RPCAddrEnvName)
	if defaultRPCAddr == "" {
		defaultRPCAddr = "127.0.0.1:8400"
	}
	return f.String("rpc-addr", defaultRPCAddr,
		"RPC address of the Consul agent")
}
func RPCClient(addr string) (*agent.RPCClient, error) {
	return agent.NewRPCClient(addr)
}