Skip to content

Commit

Permalink
fix: update cli documentation examples
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Oct 13, 2020
1 parent 244b4dd commit 216ea7f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
6 changes: 3 additions & 3 deletions cmd/identities/delete.go
Expand Up @@ -16,12 +16,12 @@ var deleteCmd = &cobra.Command{
Use: "delete <id-0 [id-1 ...]>",
Short: "Delete identities by ID",
Long: fmt.Sprintf(`This command deletes one or more identities by ID. To delete an identity by some selector, e.g. the recovery email address, use the list command in combination with jq.
Example: delete the identity with the recovery email address "foo@bar.com":
kratos identities delete $(kratos identities list --format json | jq -r 'map(select(.recovery_addresses[].value == "foo@bar.com")) | .[].id')
%s
`, clihelpers.WarningJQIsComplicated),
Example: `To delete the identity with the recovery email address "foo@bar.com", run:
$ kratos identities delete $(kratos identities list --format json | jq -r 'map(select(.recovery_addresses[].value == "foo@bar.com")) | .[].id')`,
Args: cobra.MinimumNArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
c := cliclient.NewClient(cmd)
Expand Down
6 changes: 3 additions & 3 deletions cmd/identities/get.go
Expand Up @@ -17,12 +17,12 @@ var getCmd = &cobra.Command{
Use: "get <id-0 [id-1 ...]>",
Short: "Get one or more identities by ID",
Long: fmt.Sprintf(`This command gets all the details about an identity. To get an identity by some selector, e.g. the recovery email address, use the list command in combination with jq.
Example: get the identities with the recovery email address at the domain "ory.sh":
kratos identities get $(kratos identities list --format json | jq -r 'map(select(.recovery_addresses[].value | endswith("@ory.sh"))) | .[].id')
%s
`, clihelpers.WarningJQIsComplicated),
Example: `To get the identities with the recovery email address at the domain "ory.sh", run:
$ kratos identities get $(kratos identities list --format json | jq -r 'map(select(.recovery_addresses[].value | endswith("@ory.sh"))) | .[].id')`,
Args: cobra.MinimumNArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
c := cliclient.NewClient(cmd)
Expand Down
8 changes: 3 additions & 5 deletions cmd/identities/import.go
Expand Up @@ -18,11 +18,9 @@ import (
var importCmd = &cobra.Command{
Use: "import <file.json [file-2.json [file-3.json] ...]>",
Short: "Import identities from files or STD_IN",
Long: `Import identities from files or STD_IN:
kratos identities import file.json
cat file.json | kratos identities import
Example: `$ kratos identities import file.json
$ cat file.json | kratos identities import`,
Long: `Import identities from files or STD_IN.
Files can contain only a single or an array of identities. The validity of files can be tested beforehand using "... identities validate".
Expand Down

0 comments on commit 216ea7f

Please sign in to comment.