Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: refactor cmd to make commands importable
- Loading branch information
Showing
21 changed files
with
372 additions
and
230 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package identities | ||
|
||
import ( | ||
"github.com/spf13/cobra" | ||
|
||
"github.com/ory/kratos/cmd/identities/port" | ||
) | ||
|
||
// identitiesCmd represents the identity command | ||
var identitiesCmd = &cobra.Command{ | ||
Use: "identities", | ||
} | ||
|
||
func RegisterCommandRecursive(parent *cobra.Command) { | ||
parent.AddCommand(identitiesCmd) | ||
|
||
port.RegisterCommandRecursive(identitiesCmd) | ||
} | ||
|
||
func init() { | ||
identitiesCmd.PersistentFlags().String("endpoint", "", "Specifies the Ory Kratos Admin URL. Defaults to KRATOS_URLS_ADMIN") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package port | ||
|
||
import ( | ||
"github.com/spf13/cobra" | ||
|
||
"github.com/ory/kratos/cmd/client" | ||
) | ||
|
||
// importCmd represents the import command | ||
var importCmd = &cobra.Command{ | ||
Use: "import <file.json [file-2.json [file-3.json] ...]>", | ||
Run: client.NewIdentityClient().Import, | ||
} | ||
|
||
func RegisterCommandRecursive(parent *cobra.Command) { | ||
parent.AddCommand(importCmd) | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
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 | ||
var jsonnetCmd = &cobra.Command{ | ||
Use: "jsonnet", | ||
Short: "Helpers for linting and formatting JSONNet code", | ||
} | ||
|
||
func RegisterCommandRecursive(parent *cobra.Command) { | ||
parent.AddCommand(jsonnetCmd) | ||
|
||
format.RegisterCommandRecursive(jsonnetCmd) | ||
lint.RegisterCommandRecursive(jsonnetCmd) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package migrate | ||
|
||
import ( | ||
"github.com/spf13/cobra" | ||
|
||
"github.com/ory/kratos/cmd/migrate/sql" | ||
) | ||
|
||
// migrateCmd represents the migrate command | ||
var migrateCmd = &cobra.Command{ | ||
Use: "migrate", | ||
Short: "Various migration helpers", | ||
} | ||
|
||
func RegisterCommandRecursive(parent *cobra.Command) { | ||
parent.AddCommand(migrateCmd) | ||
|
||
sql.RegisterCommandRecursive(migrateCmd) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.