Skip to content

Commit

Permalink
cmd: update usage, add option [--codis|--redis]
Browse files Browse the repository at this point in the history
  • Loading branch information
spinlock committed Feb 22, 2017
1 parent 12ed59e commit 8a1fc6e
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ func main() {
usage := `
Usage:
redis-port decode [--ncpu=N] [--parallel=M] [--input=INPUT] [--output=OUTPUT]
redis-port restore [--ncpu=N] [--parallel=M] [--input=INPUT] --target=TARGET [--codis] [--auth=AUTH] [--faketime=FAKETIME] [--filterdb=DB] [--extra]
redis-port sync [--ncpu=N] [--parallel=M] --from=MASTER [--password=PASSWORD] --target=TARGET [--codis] [--auth=AUTH] [--sockfile=FILE [--filesize=SIZE]] [--filterdb=DB] [--psync]
redis-port dump [--ncpu=N] [--parallel=M] --from=MASTER [--password=PASSWORD] [--output=OUTPUT] [--extra]
redis-port restore [--ncpu=N] [--parallel=M] [--input=INPUT] [--faketime=FAKETIME] [--extra] [--filterdb=DB] --target=TARGET [--auth=AUTH] [--redis|--codis]
redis-port sync [--ncpu=N] [--parallel=M] --from=MASTER [--password=PASSWORD] [--psync] [--filterdb=DB] --target=TARGET [--auth=AUTH] [--redis|--codis] [--sockfile=FILE [--filesize=SIZE]]
redis-port dump [--ncpu=N] [--parallel=M] --from=MASTER [--password=PASSWORD] [--extra] [--output=OUTPUT]
Options:
-n N, --ncpu=N Set runtime.GOMAXPROCS to N.
Expand All @@ -80,7 +80,8 @@ Options:
--sockfile=FILE Use FILE to as socket buffer, default is disabled.
--filesize=SIZE Set FILE size, default value is 1gb.
-e, --extra Set true to send/receive following redis commands, default is false.
--codis Target is codis proxy or normal redis instance.
--redis Target is normal redis instance, default is false.
--codis Target is codis proxy, default is true.
--filterdb=DB Filter db = DB, default is *.
--psync Use PSYNC command.
`
Expand Down Expand Up @@ -120,11 +121,12 @@ Options:
args.auth, _ = d["--auth"].(string)
args.target, _ = d["--target"].(string)

args.extra, _ = d["--extra"].(bool)
args.psync, _ = d["--psync"].(bool)
args.codis, _ = d["--codis"].(bool)
args.sockfile, _ = d["--sockfile"].(string)

args.extra = d["--extra"].(bool)
args.psync = d["--psync"].(bool)
args.codis = d["--codis"].(bool) || !d["--redis"].(bool)

if s, ok := d["--faketime"].(string); ok && s != "" {
switch s[0] {
case '-', '+':
Expand Down

0 comments on commit 8a1fc6e

Please sign in to comment.