Skip to content

Commit

Permalink
chore: export CLI commands (#1030)
Browse files Browse the repository at this point in the history
  • Loading branch information
hperl authored Sep 22, 2022
1 parent c35683d commit 30e75b9
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmd/relationtuple/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"github.com/ory/x/cmdx"
)

func newCreateCmd() *cobra.Command {
func NewCreateCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "create <relation-tuple.json> [<relation-tuple-dir>]",
Short: "Create relation tuples from JSON files",
Expand Down
2 changes: 1 addition & 1 deletion cmd/relationtuple/delete_all.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const (
FlagForce = "force"
)

func newDeleteAllCmd() *cobra.Command {
func NewDeleteAllCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "delete-all",
Short: "Delete ALL relation tuples matching the relation query.",
Expand Down
2 changes: 1 addition & 1 deletion cmd/relationtuple/delete_all_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func TestDeleteAllCmd(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), 100*time.Millisecond)
defer cancel()

cmd := newDeleteAllCmd()
cmd := NewDeleteAllCmd()
// we will get an error here because there is no server running, but we really only care about the execution path
stdout, _, _ := cmdx.ExecCtx(ctx, cmd, nil, "--insecure-skip-hostname-verification=true")
assert.Contains(t, stdout, "WARNING: This operation is not reversible.")
Expand Down
2 changes: 1 addition & 1 deletion cmd/relationtuple/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func readQueryFromFlags(cmd *cobra.Command) (*rts.RelationQuery, error) {
return query.ToProto(), nil
}

func newGetCmd() *cobra.Command {
func NewGetCmd() *cobra.Command {
var (
pageSize int32
pageToken string
Expand Down
2 changes: 1 addition & 1 deletion cmd/relationtuple/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func RegisterCommandsRecursive(parent *cobra.Command) {

parent.AddCommand(relationCmd)

relationCmd.AddCommand(newGetCmd(), newCreateCmd(), newDeleteCmd(), newDeleteAllCmd(), newParseCmd())
relationCmd.AddCommand(NewGetCmd(), NewCreateCmd(), newDeleteCmd(), NewDeleteAllCmd(), newParseCmd())
}

func registerPackageFlags(flags *pflag.FlagSet) {
Expand Down

0 comments on commit 30e75b9

Please # to comment.