add flag upgrade-ttl

This commit is contained in:
siddontang 2014-10-29 16:07:58 +08:00
parent 21fee60d8b
commit 5ee3a4ac2c
1 changed files with 10 additions and 0 deletions

View File

@ -10,6 +10,8 @@ import (
) )
var configPath = flag.String("config", "", "ledisdb config file") 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() { func main() {
flag.Parse() flag.Parse()
@ -25,6 +27,14 @@ func main() {
return return
} }
if len(*dataDir) > 0 {
cfg.DataDir = *dataDir
}
if len(*dbName) > 0 {
cfg.DBName = *dbName
}
db, err := store.Open(cfg) db, err := store.Open(cfg)
if err != nil { if err != nil {
println(err.Error()) println(err.Error())