Skip to content

Commit

Permalink
refactor: change flag listen -> port
Browse files Browse the repository at this point in the history
  • Loading branch information
mhughdo committed Sep 9, 2024
1 parent cf21420 commit 5eabf27
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 3 additions & 2 deletions app/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"context"
"flag"
"fmt"
"io"
"log"
"os"
Expand All @@ -16,7 +17,7 @@ import (
)

var (
listen = flag.String("listen", ":6379", "listen address")
port = flag.String("port", "6379", "listening port")
dir = flag.String("dir", "/tmp/redis", "data directory")
dbFilename = flag.String("dbfilename", "dump.rdb", "database filename")
)
Expand All @@ -30,7 +31,7 @@ func run(ctx context.Context, _ io.Writer, _ []string) error {
defer signal.Stop(sigCh)
cfg := config.NewConfig()
err := cfg.SetBatch(map[string]string{
config.ListenAddrKey: *listen,
config.ListenAddrKey: fmt.Sprintf(":%s", *port),
config.DirKey: *dir,
config.DBFilenameKey: *dbFilename,
})
Expand Down
6 changes: 5 additions & 1 deletion pkg/command/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import (
)

const (
SERVER = "server"
SERVER = "server"
REPLICATION = "replication"
)

var (
Expand All @@ -21,6 +22,9 @@ var (
"redis_build_id": "20240616",
"redis_mode": "standalone",
},
REPLICATION: {
"role": "master",
},
}
)

Expand Down

0 comments on commit 5eabf27

Please sign in to comment.