Skip to content
Closed
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
4 changes: 2 additions & 2 deletions internal/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ zed permission check --explain document:firstdoc writer user:emilia
commands.RegisterWatchRelationshipCmd(relCmd)

schemaCmd := commands.RegisterSchemaCmd(rootCmd)
schemaCompileCmd := registerAdditionalSchemaCmds(schemaCmd)
registerPreviewCmd(rootCmd, schemaCompileCmd)
registerAdditionalSchemaCmds(schemaCmd)
registerPreviewCmd(rootCmd)

return rootCmd
}
Expand Down
11 changes: 1 addition & 10 deletions internal/cmd/preview.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,10 @@ import (
"github.com/spf13/cobra"
)

func registerPreviewCmd(rootCmd *cobra.Command, schemaCompileCmd *cobra.Command) {
func registerPreviewCmd(rootCmd *cobra.Command) {
previewCmd := &cobra.Command{
Use: "preview <subcommand>",
Short: "Experimental commands that have been made available for preview",
}

schemaCmd := &cobra.Command{
Use: "schema <subcommand>",
Short: "Manage schema for a permissions system",
Deprecated: "please use `zed schema compile`",
}

rootCmd.AddCommand(previewCmd)
previewCmd.AddCommand(schemaCmd)
schemaCmd.AddCommand(schemaCompileCmd)
}
4 changes: 1 addition & 3 deletions internal/cmd/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (rtc *realTermChecker) IsTerminal(fd int) bool {
return term.IsTerminal(fd)
}

func registerAdditionalSchemaCmds(schemaCmd *cobra.Command) *cobra.Command {
func registerAdditionalSchemaCmds(schemaCmd *cobra.Command) {
schemaWriteCmd := &cobra.Command{
Use: "write <file?>",
Args: commands.ValidationWrapper(cobra.MaximumNArgs(1)),
Expand Down Expand Up @@ -105,8 +105,6 @@ func registerAdditionalSchemaCmds(schemaCmd *cobra.Command) *cobra.Command {

schemaCmd.AddCommand(schemaCompileCmd)
schemaCompileCmd.Flags().String("out", "", "output filepath; omitting writes to stdout")

return schemaCompileCmd
}

func schemaDiffCmdFunc(_ *cobra.Command, args []string) error {
Expand Down
Loading