couchbaselabs / cbft

*THIS PROJECT HAS MOVED* from couchbaselabs TO: https://github.com/couchbase/cbft -- no further development will be done here on couchbaselabs/cbft
Other
27 stars 5 forks source link

-server flag help suggestion doesn't work #126

Closed mschoch closed 9 years ago

mschoch commented 9 years ago

I tried -server="127.0.0.1:8091" which is what the help suggests, but it seems to expect a URL and not the host:port syntax Go programs often use. Also, I seem to recall there was supposed to be all kinds of specialized help text, but I'm not seeing that, is it because I built it myself? Finally, can -server="127.0.0.1:8091" be a default? It seems like it would streamline the experience for developers downloading and running cbft the first time.

$ ./cbft -server="127.0.0.1:8091"
2015/05/04 19:51:26 main: ./cbft started (v0.0.4-16-g17b6a01/3.1.0)
2015/05/04 19:51:26   -bindHttp="0.0.0.0:8095"
2015/05/04 19:51:26   -cfgConnect="simple"
2015/05/04 19:51:26   -container=""
2015/05/04 19:51:26   -dataDir="data"
2015/05/04 19:51:26   -help="false"
2015/05/04 19:51:26   -register="wanted"
2015/05/04 19:51:26   -server="127.0.0.1:8091"
2015/05/04 19:51:26   -staticDir="static"
2015/05/04 19:51:26   -staticETag=""
2015/05/04 19:51:26   -tags=""
2015/05/04 19:51:26   -version="false"
2015/05/04 19:51:26   -weight="1"
2015/05/04 19:51:26   GOMAXPROCS=4
2015/05/04 19:51:26 main: registered bleve stores
2015/05/04 19:51:26   goleveldb
2015/05/04 19:51:26   boltdb
2015/05/04 19:51:26   metrics
2015/05/04 19:51:26   gtreap
2015/05/04 19:51:26   cznicb
2015/05/04 19:51:26   mem
2015/05/04 19:51:26 main: manager uuid: 7d92bda6d7f7d113
2015/05/04 19:51:26 main: manager uuid was reloaded
2015/05/04 19:51:26 FATAL: error: could not connect to server, URL: 127.0.0.1:8091, err: invalid URL <127.0.0.1:8091>
  Please check that your -server parameter ("127.0.0.1:8091")
  is correct and the server is available. -- main.main() at main.go:142
steveyen commented 9 years ago

Looks like that "Please check ..." error msg still needs even further improvement.

On all that "specialized help text", you can get that full help/usage text from using "-h".

I figured a full URL for the "-server" parameter would leave us the most flexibility for future kinds of datasource servers, but there is something nice in just being able to do a "HOST:PORT", so will noodle over it.

mschoch commented 9 years ago

Either form is fine. But the help should show the firm that works. On May 5, 2015 12:11 AM, "Steve Yen" notifications@github.com wrote:

Looks like that "Please check ..." error msg still needs even further improvement.

On all that "specialized help text", you can get that full help/usage text from using "-h".

I figured a full URL for the "-server" parameter would leave us the most flexibility for future kinds of datasource servers, but there is something nice in just being able to do a "HOST:PORT", so will noodle over it.

— Reply to this email directly or view it on GitHub https://github.com/couchbaselabs/cbft/issues/126#issuecomment-98943116.

steveyen commented 9 years ago

commit 7adb79d

Output wording now looks like...

$ ./cbft -server foo:8091
2015/05/06 15:30:01 main: ./cbft started (v0.0.5-7-g7adb79d/3.1.0)
2015/05/06 15:30:01   -bindHttp="0.0.0.0:8095"
2015/05/06 15:30:01   -cfgConnect="simple"
2015/05/06 15:30:01   -container=""
2015/05/06 15:30:01   -dataDir="data"
2015/05/06 15:30:01   -help="false"
2015/05/06 15:30:01   -register="wanted"
2015/05/06 15:30:01   -server="foo:8091"
2015/05/06 15:30:01   -staticDir="static"
2015/05/06 15:30:01   -staticETag=""
2015/05/06 15:30:01   -tags=""
2015/05/06 15:30:01   -version="false"
2015/05/06 15:30:01   -weight="1"
2015/05/06 15:30:01   GOMAXPROCS=8
2015/05/06 15:30:01 main: registered bleve stores
2015/05/06 15:30:01   goleveldb
2015/05/06 15:30:01   boltdb
2015/05/06 15:30:01   metrics
2015/05/06 15:30:01   leveldb
2015/05/06 15:30:01   mem
2015/05/06 15:30:01   gtreap
2015/05/06 15:30:01   cznicb
2015/05/06 15:30:01 main: manager uuid: 3062542ab25219e3
2015/05/06 15:30:01 main: manager uuid was reloaded
2015/05/06 15:30:01  HTTP request returned error Get http:///pools: http: no Host in request URL
2015/05/06 15:30:01 FATAL: error: not a URL, server: "foo:8091"
  Please check that your -server parameter is a valid URL
  (http://HOST:PORT), such as "http://localhost:8091",
  to a couchbase server -- main.main() at main.go:142