Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Hide internal keys in CLI listing #475

Merged
merged 2 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions cmd/client/list/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,15 @@ func exec(cmd *cobra.Command, _ []string) error {
}

func _exec(flags flags, queue common.QueryQueue) error {
queue.Add(Query{
query := Query{
KeyMinimum: flags.keyMin,
KeyMaximum: flags.keyMax,
})
}
if flags.keyMax == "" {
// By default, do not list internal keys
query.KeyMaximum = "__oxia/"
}
queue.Add(query)
return nil
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/client/list/cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,15 @@ func Test_exec(t *testing.T) {
nil,
[]common.Query{Query{
KeyMinimum: "a",
KeyMaximum: "",
KeyMaximum: "__oxia/",
}}},
{"range-no-limit",
"",
flags{},
nil,
[]common.Query{Query{
KeyMinimum: "",
KeyMaximum: "",
KeyMaximum: "__oxia/",
}}},
} {
t.Run(test.name, func(t *testing.T) {
Expand Down
Loading