diff --git a/cmd/identities/identities.go b/cmd/identities/identities.go index 5f7c960a885..297bbc8c5af 100644 --- a/cmd/identities/identities.go +++ b/cmd/identities/identities.go @@ -2,8 +2,6 @@ package identities import ( "github.com/spf13/cobra" - - "github.com/ory/kratos/cmd/identities/port" ) // identitiesCmd represents the identity command @@ -14,7 +12,7 @@ var identitiesCmd = &cobra.Command{ func RegisterCommandRecursive(parent *cobra.Command) { parent.AddCommand(identitiesCmd) - port.RegisterCommandRecursive(identitiesCmd) + identitiesCmd.AddCommand(importCmd) } func init() { diff --git a/cmd/identities/port/import.go b/cmd/identities/import.go similarity index 71% rename from cmd/identities/port/import.go rename to cmd/identities/import.go index 2ac870c9773..6bdd046ee32 100644 --- a/cmd/identities/port/import.go +++ b/cmd/identities/import.go @@ -1,4 +1,4 @@ -package port +package identities import ( "github.com/spf13/cobra" @@ -11,7 +11,3 @@ var importCmd = &cobra.Command{ Use: "import ", Run: client.NewIdentityClient().Import, } - -func RegisterCommandRecursive(parent *cobra.Command) { - parent.AddCommand(importCmd) -} diff --git a/cmd/jsonnet/format/format.go b/cmd/jsonnet/format.go similarity index 94% rename from cmd/jsonnet/format/format.go rename to cmd/jsonnet/format.go index e08f8ef33f2..a6134e57570 100644 --- a/cmd/jsonnet/format/format.go +++ b/cmd/jsonnet/format.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -package format +package jsonnet import ( "fmt" @@ -62,10 +62,6 @@ Use -w or --write to write output back to files instead of stdout. }, } -func RegisterCommandRecursive(parent *cobra.Command) { - parent.AddCommand(jsonnetFormatCmd) -} - func init() { jsonnetFormatCmd.Flags().BoolP("write", "w", false, "Write formatted output back to file.") } diff --git a/cmd/jsonnet/jsonnet.go b/cmd/jsonnet/jsonnet.go index 5a1c513bade..d0efe8ab253 100644 --- a/cmd/jsonnet/jsonnet.go +++ b/cmd/jsonnet/jsonnet.go @@ -2,9 +2,6 @@ package jsonnet import ( "github.com/spf13/cobra" - - "github.com/ory/kratos/cmd/jsonnet/format" - "github.com/ory/kratos/cmd/jsonnet/lint" ) // jsonnetCmd represents the jsonnet command @@ -16,6 +13,6 @@ var jsonnetCmd = &cobra.Command{ func RegisterCommandRecursive(parent *cobra.Command) { parent.AddCommand(jsonnetCmd) - format.RegisterCommandRecursive(jsonnetCmd) - lint.RegisterCommandRecursive(jsonnetCmd) + jsonnetCmd.AddCommand(jsonnetFormatCmd) + jsonnetCmd.AddCommand(jsonnetLintCmd) } diff --git a/cmd/jsonnet/lint/lint.go b/cmd/jsonnet/lint.go similarity index 92% rename from cmd/jsonnet/lint/lint.go rename to cmd/jsonnet/lint.go index 9c88a72f791..8a64ee3a1be 100644 --- a/cmd/jsonnet/lint/lint.go +++ b/cmd/jsonnet/lint.go @@ -1,4 +1,4 @@ -package lint +package jsonnet import ( "fmt" @@ -44,7 +44,3 @@ var jsonnetLintCmd = &cobra.Command{ } }, } - -func RegisterCommandRecursive(parent *cobra.Command) { - parent.AddCommand(jsonnetLintCmd) -} diff --git a/cmd/migrate/migrate.go b/cmd/migrate/migrate.go index 54c4ca873d9..d727f85b2d5 100644 --- a/cmd/migrate/migrate.go +++ b/cmd/migrate/migrate.go @@ -2,8 +2,6 @@ package migrate import ( "github.com/spf13/cobra" - - "github.com/ory/kratos/cmd/migrate/sql" ) // migrateCmd represents the migrate command @@ -15,5 +13,5 @@ var migrateCmd = &cobra.Command{ func RegisterCommandRecursive(parent *cobra.Command) { parent.AddCommand(migrateCmd) - sql.RegisterCommandRecursive(migrateCmd) + migrateCmd.AddCommand(migrateSqlCmd) } diff --git a/cmd/migrate/sql/migrate_sql.go b/cmd/migrate/sql.go similarity index 94% rename from cmd/migrate/sql/migrate_sql.go rename to cmd/migrate/sql.go index 3f35717969f..7ba41be6699 100644 --- a/cmd/migrate/sql/migrate_sql.go +++ b/cmd/migrate/sql.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -package sql +package migrate import ( "github.com/spf13/cobra" @@ -52,10 +52,6 @@ Before running this command on an existing database, create a back up! }, } -func RegisterCommandRecursive(parent *cobra.Command) { - parent.AddCommand(migrateSqlCmd) -} - func init() { migrateSqlCmd.Flags().BoolP("read-from-env", "e", false, "If set, reads the database connection string from the environment variable DSN or config file key dsn.") migrateSqlCmd.Flags().BoolP("yes", "y", false, "If set all confirmation requests are accepted without user interaction.")