From 5ee3a4ac2ca7af2fe2fadf4cbe0c979408174be4 Mon Sep 17 00:00:00 2001 From: siddontang Date: Wed, 29 Oct 2014 16:07:58 +0800 Subject: [PATCH] add flag upgrade-ttl --- upgrade/ledis-upgrade-ttl/main.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/upgrade/ledis-upgrade-ttl/main.go b/upgrade/ledis-upgrade-ttl/main.go index ea8dab1..96d1a28 100644 --- a/upgrade/ledis-upgrade-ttl/main.go +++ b/upgrade/ledis-upgrade-ttl/main.go @@ -10,6 +10,8 @@ import ( ) var configPath = flag.String("config", "", "ledisdb config file") +var dataDir = flag.String("data_dir", "", "ledisdb base data dir") +var dbName = flag.String("db_name", "", "select a db to use, it will overwrite the config's db name") func main() { flag.Parse() @@ -25,6 +27,14 @@ func main() { return } + if len(*dataDir) > 0 { + cfg.DataDir = *dataDir + } + + if len(*dbName) > 0 { + cfg.DBName = *dbName + } + db, err := store.Open(cfg) if err != nil { println(err.Error())