Skip to content

Commit b524ac1

Browse files
authored
Merge pull request #8 from redis-field-engineering/more-edits
More edits
2 parents 2c280fa + ec4bccb commit b524ac1

File tree

9 files changed

+24
-23
lines changed

9 files changed

+24
-23
lines changed

BulkUpdateConfirmation/BulkUpdateConfirmation.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,21 @@ func (m Model) View() string {
5050
body := strings.Builder{}
5151

5252
if len(m.rulesToAdd) > 0 {
53-
body.WriteString("======Rules To Add======\n")
53+
body.WriteString("====== Rules to Add ======\n")
5454
for _, r := range m.rulesToAdd {
5555
body.WriteString(r.Formatted() + "\n")
5656
}
5757
}
5858

5959
if len(m.rulesToUpdate) > 0 {
60-
body.WriteString("\n\n======Rules To Update======b\n")
60+
body.WriteString("\n\n====== Rules To Update ======\n")
6161
for _, r := range m.rulesToUpdate {
6262
body.WriteString(fmt.Sprintf("%s\n", r.Formatted()))
6363
}
6464
}
6565

6666
if len(m.rulesToDelete) > 0 {
67-
body.WriteString("\n\n======Rules To Delete======\n")
67+
body.WriteString("\n\n====== Rules to Delete ======\n")
6868
for _, r := range m.rulesToDelete {
6969
body.WriteString(fmt.Sprintf("%s\n", r.Formatted()))
7070
}

RuleDialog/RuleDialog.go

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,17 @@ package RuleDialog
22

33
import (
44
"fmt"
5-
"github.com/charmbracelet/bubbles/list"
6-
"github.com/charmbracelet/bubbles/textinput"
7-
tea "github.com/charmbracelet/bubbletea"
8-
"github.com/charmbracelet/lipgloss"
9-
"github.com/redis/go-redis/v9"
105
"io"
116
"smart-cache-cli/ConfirmationDialog"
127
"smart-cache-cli/RedisCommon"
138
"smart-cache-cli/util"
149
"strings"
10+
11+
"github.com/charmbracelet/bubbles/list"
12+
"github.com/charmbracelet/bubbles/textinput"
13+
tea "github.com/charmbracelet/bubbletea"
14+
"github.com/charmbracelet/lipgloss"
15+
"github.com/redis/go-redis/v9"
1516
)
1617

1718
type item struct{ ruleType RedisCommon.RuleType }
@@ -242,22 +243,22 @@ func (m Model) View() string {
242243
var b strings.Builder
243244

244245
if m.ruleType == RedisCommon.Unknown {
245-
b.WriteString("select a rule type, press ctrl+b to return to the previous screen\n")
246+
b.WriteString(" == Create rule menu ==\n\n Select the type of rule you want to create.\n Press [CTRL+B] to return to the previous screen.\n\n")
246247
b.WriteString(m.typeSelectorList.View())
247248
return b.String()
248249
} else if m.match == "" && m.ruleType != RedisCommon.All {
249250
b.WriteString(m.ruleSoFar())
250251
if m.ruleType == RedisCommon.Regex {
251-
b.WriteString("Input a regular expression to match against:")
252+
b.WriteString("Enter a regular expression to match against:")
252253
} else if m.ruleType == RedisCommon.QueryIds {
253-
b.WriteString("Input a comma delimited list of Query Ids to match against:")
254+
b.WriteString("Enter a comma-separated list of Query IDs to match against:")
254255
} else {
255-
b.WriteString("Input a comma delimited list of tables to match against:")
256+
b.WriteString("Enter a comma-separated list of tables to match against:")
256257
}
257258
b.WriteString(m.textInput.View())
258259
} else {
259260
b.WriteString(m.ruleSoFar())
260-
b.WriteString("Input TTL in the form of a duration e.g. 1h, 300s, 5m: ")
261+
b.WriteString("Enter a TTL in the form of a duration (e.g. 1h, 300s, 5m):")
261262
b.WriteString(m.textInput.View())
262263
}
263264

TableList/TableList.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ func (m Model) View() string {
9393
body := strings.Builder{}
9494
body.WriteString("Press [ENTER] to update the TTL for a table\n")
9595
body.WriteString("Press 'b' to go back\n")
96-
body.WriteString("Press 's' to change sorting\n")
96+
body.WriteString("Press 's' to change sorting\n\n")
9797
body.WriteString(m.table.View())
9898

9999
return body.String()

cmd/listqueries.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const (
3333
// listqCmd represents the listq command
3434
var listqCmd = &cobra.Command{
3535
Use: "listqueries",
36-
Short: "List queries seen by Redis Smart Cache",
36+
Short: "List the queries seen by Redis Smart Cache",
3737
Long: `List queries seen by `,
3838
Run: func(cmd *cobra.Command, args []string) {
3939
rdb := redis.NewClient(&redis.Options{

cmd/listtables.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ import (
1818
// listtablesCmd represents the listtables command
1919
var listtablesCmd = &cobra.Command{
2020
Use: "listtables",
21-
Short: "List the tables being profiled by Redis Smart Cache.",
22-
Long: `List the tables being profiled by Redis Smart CAche.`,
21+
Short: "List the tables being profiled by Redis Smart Cache",
22+
Long: `List the tables being profiled by Redis Smart Cache`,
2323
Run: func(cmd *cobra.Command, args []string) {
2424
rdb := redis.NewClient(&redis.Options{
2525
Addr: fmt.Sprintf("%s:%s", HostName, Port),

cmd/makerule.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ import (
1818
// makeruleCmd represents the makerule command
1919
var makeruleCmd = &cobra.Command{
2020
Use: "makerule",
21-
Short: "Create a Redis Smart Cache caching rule",
22-
Long: `Creates a Redis Smart Cache caching rule`,
21+
Short: "Create a caching rule",
22+
Long: `Creates a caching rule`,
2323
Run: func(cmd *cobra.Command, args []string) {
2424
fmt.Println("makerule called")
2525
rdb := redis.NewClient(&redis.Options{

cmd/root.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func init() {
7979
rootCmd.PersistentFlags().StringVarP(&HostName, "host", "n", "localhost", "Redis host")
8080
rootCmd.PersistentFlags().StringVarP(&Port, "port", "p", "6379", "Redis port")
8181
rootCmd.PersistentFlags().StringVarP(&Password, "password", "a", "", "Redis password")
82-
rootCmd.PersistentFlags().StringVarP(&User, "user", "u", "default", "Redis user. Defaults to 'default'")
83-
rootCmd.PersistentFlags().StringVarP(&ApplicationName, "application", "s", "smartcache", "Application namespace. Defaults to 'smartcache'")
82+
rootCmd.PersistentFlags().StringVarP(&User, "user", "u", "default", "Redis user")
83+
rootCmd.PersistentFlags().StringVarP(&ApplicationName, "application", "s", "smartcache", "Application namespace")
8484
rootCmd.Flags().BoolVarP(&versionCheck, "version", "v", false, "Smart Cache CLI version")
8585
}

mainMenu/mainMenu.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ func InitialModel(rdb *redis.Client, applicationName string, connectionInfo stri
144144
const defaultWidth = 20
145145

146146
l := list.New(items, itemDelegate{}, defaultWidth, listHeight)
147-
l.Title = "-- Main menu --"
147+
l.Title = "== Main menu =="
148148
l.SetShowStatusBar(false)
149149
l.SetFilteringEnabled(false)
150150
l.Styles.Title = titleStyle

queryList/queryList.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ func (m Model) View() string {
178178
body.WriteString("Press [ENTER] to create a pending rule\n")
179179
body.WriteString("Press 'c' to commit selected rules\n")
180180
body.WriteString("Press 'b' to go back\n")
181-
body.WriteString("Press [CTRL+C] to quit\n")
181+
body.WriteString("Press [CTRL+C] to quit\n\n")
182182

183183
body.WriteString(m.table.View())
184184

0 commit comments

Comments
 (0)