mirror of https://github.com/ledisdb/ledisdb.git
add flag upgrade-ttl
This commit is contained in:
parent
21fee60d8b
commit
5ee3a4ac2c
|
@ -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())
|
||||||
|
|
Loading…
Reference in New Issue