What's the correct syntax for parameters?

The tour uses --param value syntax. Example (source):

docker exec -it dgraph dgraph server --lru_mb 2048 --zero localhost:5080

The docs use --param=value syntax. Example (source):

docker run -it -p 7080:7080 -p 8080:8080 -p 9080:9080 -v ~/server1:/dgraph dgraph/dgraph:latest dgraph server --lru_mb=<typically one-third the RAM> --zero=HOSTIPADDR:5080 --my=HOSTIPADDR:7080

Finally, running dgraph-ratel --help produces param names with single dash - and no indication of how to use them:

Usage of dgraph-ratel:
  -addr string
    	Address of the Dgraph server.
  -port int
    	Port on which the ratel server will run. (default 8000)
  -version
    	Prints the version of ratel.

Could you please clarify which syntax is correct or if multiple syntaxes are supported?

Multiple syntaxes are supported.

For dgraph-ratel specifically, it simply uses flag - The Go Programming Language which provides the single-hypen flag names.

1 Like