@@ -307,7 +307,7 @@ func getAlpha(idx int) service {
307307 svc .Command += fmt .Sprintf (" --zero=%s" , zerosOpt )
308308 svc .Command += fmt .Sprintf (" --logtostderr -v=%d" , opts .Verbosity )
309309 if opts .LudicrousMode {
310- svc .Command += " --ludicrous-mode =true"
310+ svc .Command += " --ludicrous_mode =true"
311311 }
312312
313313 // Don't assign idx, let it auto-assign.
@@ -319,7 +319,7 @@ func getAlpha(idx int) service {
319319 svc .Command += " --whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16"
320320 }
321321 if opts .Acl {
322- svc .Command += " --acl-secret-file =/secret/hmac"
322+ svc .Command += " --acl_secret_file =/secret/hmac"
323323 svc .Volumes = append (svc .Volumes , volume {
324324 Type : "bind" ,
325325 Source : "./acl-secret" ,
@@ -328,10 +328,10 @@ func getAlpha(idx int) service {
328328 })
329329 }
330330 if opts .SnapshotAfter != "" {
331- svc .Command += fmt .Sprintf (" --snapshot-after =%s" , opts .SnapshotAfter )
331+ svc .Command += fmt .Sprintf (" --snapshot_after =%s" , opts .SnapshotAfter )
332332 }
333333 if opts .AclSecret != "" {
334- svc .Command += " --acl-secret-file =/secret/hmac"
334+ svc .Command += " --acl_secret_file =/secret/hmac"
335335 svc .Volumes = append (svc .Volumes , volume {
336336 Type : "bind" ,
337337 Source : opts .AclSecret ,
@@ -345,7 +345,7 @@ func getAlpha(idx int) service {
345345 }
346346 }
347347 if opts .Encryption {
348- svc .Command += " --encryption-key-file =/secret/enc_key"
348+ svc .Command += " --encryption_key_file =/secret/enc_key"
349349 svc .Volumes = append (svc .Volumes , volume {
350350 Type : "bind" ,
351351 Source : "./enc-secret" ,
@@ -354,7 +354,7 @@ func getAlpha(idx int) service {
354354 })
355355 }
356356 if opts .TlsDir != "" {
357- svc .Command += " --tls-dir =/secret/tls"
357+ svc .Command += " --tls_dir =/secret/tls"
358358 svc .Volumes = append (svc .Volumes , volume {
359359 Type : "bind" ,
360360 Source : opts .TlsDir ,
@@ -534,20 +534,19 @@ func main() {
534534 // dummy to get "Usage:" template in Usage() output.
535535 },
536536 }
537- cmd .SetGlobalNormalizationFunc (x .NormalizeFlags )
538537
539- cmd .PersistentFlags ().IntVarP (& opts .NumZeros , "num-zeros " , "z" , 3 ,
538+ cmd .PersistentFlags ().IntVarP (& opts .NumZeros , "num_zeros " , "z" , 3 ,
540539 "number of zeros in dgraph cluster" )
541- cmd .PersistentFlags ().IntVarP (& opts .NumAlphas , "num-alphas " , "a" , 3 ,
540+ cmd .PersistentFlags ().IntVarP (& opts .NumAlphas , "num_alphas " , "a" , 3 ,
542541 "number of alphas in dgraph cluster" )
543- cmd .PersistentFlags ().IntVarP (& opts .NumReplicas , "num-replicas " , "r" , 3 ,
542+ cmd .PersistentFlags ().IntVarP (& opts .NumReplicas , "num_replicas " , "r" , 3 ,
544543 "number of alpha replicas in dgraph cluster" )
545- cmd .PersistentFlags ().BoolVar (& opts .DataVol , "data-vol " , false ,
544+ cmd .PersistentFlags ().BoolVar (& opts .DataVol , "data_vol " , false ,
546545 "mount a docker volume as /data in containers" )
547- cmd .PersistentFlags ().StringVarP (& opts .DataDir , "data-dir " , "d" , "" ,
546+ cmd .PersistentFlags ().StringVarP (& opts .DataDir , "data_dir " , "d" , "" ,
548547 "mount a host directory as /data in containers" )
549548 cmd .PersistentFlags ().BoolVar (& opts .Acl , "acl" , false , "Create ACL secret file and enable ACLs" )
550- cmd .PersistentFlags ().StringVar (& opts .AclSecret , "acl-secret " , "" ,
549+ cmd .PersistentFlags ().StringVar (& opts .AclSecret , "acl_secret " , "" ,
551550 "enable ACL feature with specified HMAC secret file" )
552551 cmd .PersistentFlags ().BoolVarP (& opts .UserOwnership , "user" , "u" , false ,
553552 "run as the current user rather than root" )
@@ -557,7 +556,7 @@ func main() {
557556 "include jaeger service" )
558557 cmd .PersistentFlags ().BoolVarP (& opts .Metrics , "metrics" , "m" , false ,
559558 "include metrics (prometheus, grafana) services" )
560- cmd .PersistentFlags ().IntVarP (& opts .PortOffset , "port-offset " , "o" , 100 ,
559+ cmd .PersistentFlags ().IntVarP (& opts .PortOffset , "port_offset " , "o" , 100 ,
561560 "port offset for alpha and, if not 100, zero as well" )
562561 cmd .PersistentFlags ().IntVarP (& opts .Verbosity , "verbosity" , "v" , 2 ,
563562 "glog verbosity level" )
@@ -573,41 +572,41 @@ func main() {
573572 "include a whitelist if true" )
574573 cmd .PersistentFlags ().BoolVar (& opts .Ratel , "ratel" , false ,
575574 "include ratel service" )
576- cmd .PersistentFlags ().IntVar (& opts .RatelPort , "ratel-port " , 8000 ,
575+ cmd .PersistentFlags ().IntVar (& opts .RatelPort , "ratel_port " , 8000 ,
577576 "Port to expose Ratel service" )
578577 cmd .PersistentFlags ().StringVarP (& opts .MemLimit , "mem" , "" , "32G" ,
579578 "Limit memory provided to the docker containers, for example 8G." )
580- cmd .PersistentFlags ().StringVar (& opts .TlsDir , "tls-dir " , "" ,
579+ cmd .PersistentFlags ().StringVar (& opts .TlsDir , "tls_dir " , "" ,
581580 "TLS Dir." )
582- cmd .PersistentFlags ().BoolVar (& opts .ExposePorts , "expose-ports " , true ,
581+ cmd .PersistentFlags ().BoolVar (& opts .ExposePorts , "expose_ports " , true ,
583582 "expose host:container ports for each service" )
584583 cmd .PersistentFlags ().StringVar (& opts .Vmodule , "vmodule" , "" ,
585584 "comma-separated list of pattern=N settings for file-filtered logging" )
586585 cmd .PersistentFlags ().BoolVar (& opts .Encryption , "encryption" , false ,
587586 "enable encryption-at-rest feature." )
588- cmd .PersistentFlags ().BoolVar (& opts .LudicrousMode , "ludicrous-mode " , false ,
587+ cmd .PersistentFlags ().BoolVar (& opts .LudicrousMode , "ludicrous_mode " , false ,
589588 "enable zeros and alphas in ludicrous mode." )
590- cmd .PersistentFlags ().StringVar (& opts .SnapshotAfter , "snapshot-after " , "" ,
589+ cmd .PersistentFlags ().StringVar (& opts .SnapshotAfter , "snapshot_after " , "" ,
591590 "create a new Raft snapshot after this many number of Raft entries." )
592- cmd .PersistentFlags ().StringVar (& opts .AlphaFlags , "extra-alpha-flags " , "" ,
591+ cmd .PersistentFlags ().StringVar (& opts .AlphaFlags , "extra_alpha_flags " , "" ,
593592 "extra flags for alphas." )
594- cmd .PersistentFlags ().StringVar (& opts .ZeroFlags , "extra-zero-flags " , "" ,
593+ cmd .PersistentFlags ().StringVar (& opts .ZeroFlags , "extra_zero_flags " , "" ,
595594 "extra flags for zeros." )
596595 cmd .PersistentFlags ().BoolVar (& opts .ContainerNames , "names" , true ,
597596 "set container names in docker compose." )
598- cmd .PersistentFlags ().StringArrayVar (& opts .AlphaVolumes , "alpha-volume " , nil ,
597+ cmd .PersistentFlags ().StringArrayVar (& opts .AlphaVolumes , "alpha_volume " , nil ,
599598 "alpha volume mounts, following srcdir:dstdir[:ro]" )
600- cmd .PersistentFlags ().StringArrayVar (& opts .ZeroVolumes , "zero-volume " , nil ,
599+ cmd .PersistentFlags ().StringArrayVar (& opts .ZeroVolumes , "zero_volume " , nil ,
601600 "zero volume mounts, following srcdir:dstdir[:ro]" )
602- cmd .PersistentFlags ().StringArrayVar (& opts .AlphaEnvFile , "alpha-env-file " , nil ,
601+ cmd .PersistentFlags ().StringArrayVar (& opts .AlphaEnvFile , "alpha_env_file " , nil ,
603602 "env_file for alpha" )
604- cmd .PersistentFlags ().StringArrayVar (& opts .ZeroEnvFile , "zero-env-file " , nil ,
603+ cmd .PersistentFlags ().StringArrayVar (& opts .ZeroEnvFile , "zero_env_file " , nil ,
605604 "env_file for zero" )
606605 cmd .PersistentFlags ().BoolVar (& opts .Minio , "minio" , false ,
607606 "include minio service" )
608- cmd .PersistentFlags ().Uint16Var (& opts .MinioPort , "minio-port " , 9001 ,
607+ cmd .PersistentFlags ().Uint16Var (& opts .MinioPort , "minio_port " , 9001 ,
609608 "minio service port" )
610- cmd .PersistentFlags ().StringArrayVar (& opts .MinioEnvFile , "minio-env-file " , nil ,
609+ cmd .PersistentFlags ().StringArrayVar (& opts .MinioEnvFile , "minio_env_file " , nil ,
611610 "minio service env_file" )
612611 err := cmd .ParseFlags (os .Args )
613612 if err != nil {
@@ -629,13 +628,13 @@ func main() {
629628 fatal (errors .Errorf ("number of replicas must be odd" ))
630629 }
631630 if opts .DataVol && opts .DataDir != "" {
632- fatal (errors .Errorf ("only one of --data-vol and --data-dir may be used at a time" ))
631+ fatal (errors .Errorf ("only one of --data_vol and --data_dir may be used at a time" ))
633632 }
634633 if opts .UserOwnership && opts .DataDir == "" {
635- fatal (errors .Errorf ("--user option requires --data-dir =<path>" ))
634+ fatal (errors .Errorf ("--user option requires --data_dir =<path>" ))
636635 }
637- if cmd .Flags ().Changed ("ratel-port " ) && ! opts .Ratel {
638- fatal (errors .Errorf ("--ratel-port option requires --ratel" ))
636+ if cmd .Flags ().Changed ("ratel_port " ) && ! opts .Ratel {
637+ fatal (errors .Errorf ("--ratel_port option requires --ratel" ))
639638 }
640639
641640 services := make (map [string ]service )
0 commit comments