2
0
mirror of https://github.com/hibiken/asynq.git synced 2025-10-23 10:16:12 +08:00

[ci skip] Allow config file to set default values for flags

This commit is contained in:
Ken Hibino
2020-01-19 08:40:51 -08:00
parent d37f2a09ab
commit 959c9fd01a
13 changed files with 106 additions and 29 deletions

View File

@@ -17,6 +17,7 @@ import (
"github.com/hibiken/asynq/internal/rdb"
"github.com/rs/xid"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
var lsValidArgs = []string{"enqueued", "inprogress", "scheduled", "retry", "dead"}
@@ -58,8 +59,9 @@ func init() {
func ls(cmd *cobra.Command, args []string) {
c := redis.NewClient(&redis.Options{
Addr: uri,
DB: db,
Addr: viper.GetString("uri"),
DB: viper.GetInt("db"),
Password: viper.GetString("password"),
})
r := rdb.NewRDB(c)
parts := strings.Split(args[0], ":")