Skip to content

Commit

Permalink
Version bump to 0.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
arpitbbhayani committed Nov 21, 2024
1 parent a92ce44 commit e7d9383
Showing 1 changed file with 2 additions and 19 deletions.
21 changes: 2 additions & 19 deletions cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,8 @@ func (c *DiceDBClient) Completer(d prompt.Document) []prompt.Suggest {
func (c *DiceDBClient) printReply(reply interface{}) {
switch v := reply.(type) {
case string:
fmt.Println(fmt.Sprintf("\"%s\"", v))
txt := fmt.Sprintf("\"%s\"", v)
fmt.Println(txt)
case int64:
fmt.Println(v)
case []byte:
Expand Down Expand Up @@ -324,24 +325,6 @@ func (c *DiceDBClient) watchCommand(cmd string, args ...interface{}) {
}
}

func (c *DiceDBClient) isAllowedDuringSubscription(input string) bool {
args := parseArgs(input)
if len(args) == 0 {
return false
}

cmd := strings.ToUpper(args[0])

// Allow UNSUBSCRIBE or the corresponding .UNWATCH command during subscription
if cmd == CmdUnsubscribe && c.subType == CmdSubscribe {
return true
}
if strings.HasSuffix(c.subType, SuffixWatch) && cmd == strings.Replace(c.subType, SuffixWatch, SuffixUnwatch, 1) {
return true
}
return false
}

func parseArgs(input string) []string {
var args []string
var currentArg string
Expand Down

0 comments on commit e7d9383

Please # to comment.