Skip to content

Commit

Permalink
scope collections to the workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
pmenglund committed Oct 16, 2023
1 parent 8f5f011 commit d4d06c8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cmd/completions.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package cmd

import (
"github.com/rockset/rockset-go-client/option"
"github.com/spf13/cobra"
)

Expand All @@ -10,7 +11,12 @@ func collectionCompletion(cmd *cobra.Command, args []string, toComplete string)
return nil, cobra.ShellCompDirectiveError
}

collections, err := rs.ListCollections(cmd.Context())
var options []option.ListCollectionOption
if ws, _ := cmd.Flags().GetString(WorkspaceFlag); ws != "" {
options = append(options, option.WithWorkspace(ws))
}

collections, err := rs.ListCollections(cmd.Context(), options...)
if err != nil {
return nil, cobra.ShellCompDirectiveError
}
Expand Down

0 comments on commit d4d06c8

Please sign in to comment.