Skip to content
This repository has been archived by the owner on May 16, 2021. It is now read-only.

Commit

Permalink
docs: update examples and test all of them
Browse files Browse the repository at this point in the history
  • Loading branch information
mainawycliffe committed Oct 9, 2020
1 parent a57ab82 commit f1c8b6f
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions cmd/addUser.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import (

// addUserCmd represents the addUser command
var addUserCmd = &cobra.Command{
Use: "addUser",
Aliases: []string{"add-user", "add"},
Example: `kamanda auth addUser --email [email protected] --password 1234 --custom-claims "admin=true" --custom-claims "key:value"`,
Use: "add",
Aliases: []string{"add-user", "addUsers"},
Example: `kamanda users add --email [email protected] --password 123456 --custom-claims "admin=true" --custom-claims "key=value"`,
Short: "Add a new Firebase Email/Password user (Accepts Custom Claims)",
Long: `Creates a new Firebase User (Email/Password). Both the Email and the Password are required.
Expand Down
2 changes: 1 addition & 1 deletion cmd/addUsers.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ The following fields are accepted:
- photoURL (string) - the photo url of the user
- uid (string) - the uid of the user. autogenerated if absent
`,
Example: `kamanda auth add-users --src users.json --extension json`,
Example: `kamanda users addUsers --source users.json --extension json`,
Run: func(cmd *cobra.Command, args []string) {
sourceFile, _ := cmd.Flags().GetString("source")
sourceFileExtension, _ := cmd.Flags().GetString("extension")
Expand Down
2 changes: 1 addition & 1 deletion cmd/byEmail.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var byEmailCmd = &cobra.Command{
Use: "byEmail",
Aliases: []string{"email", "by-email"},
Short: "Find a Firebase Auth user by email address",
Example: `kamanda auth find by-email [email protected]`,
Example: `kamanda users find by-email [email protected]`,
Run: func(cmd *cobra.Command, args []string) {
output, err := cmd.Flags().GetString("output")
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/byPhone.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var byPhoneCmd = &cobra.Command{
Use: "byPhone",
Aliases: []string{"phone", "by-phone"},
Short: "find a Firebase Auth User by their phone number",
Example: `kamanda auth find by-phone +254712345678`,
Example: `kamanda users find by-phone +254712345678`,
Run: func(cmd *cobra.Command, args []string) {
output, err := cmd.Flags().GetString("output")
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/deleteUser.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var deleteUserCmd = &cobra.Command{
Use: "deleteUsers",
Aliases: []string{"delete-users", "delete"},
Short: "Delete multiple Firebase Auth User by their UID",
Example: "kamanda auth delete [uid1] [uid2] [uid3]",
Example: "kamanda users delete [uid1] [uid2] [uid3]",
Run: func(cmd *cobra.Command, args []string) {
// args = list of uids
if len(args) == 0 {
Expand Down
2 changes: 1 addition & 1 deletion cmd/findUser.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var findUserCmd = &cobra.Command{
Short: "Find a a Firebase Auth user by their Firebase UID.",
Long: `Find a a Firebase Auth user by their Firebase UID.
To find user by email or by phone use "find by-email" or "find by-phone"`,
Example: `kamanda auth find [UID1] [UID2]`,
Example: `kamanda users find [UID1] [UID2]`,
Run: func(cmd *cobra.Command, args []string) {
output, err := cmd.Flags().GetString("output")
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/resetPassword.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
var resetPasswordCmd = &cobra.Command{
Use: "password",
Short: "Reset password for a firebase user(s)",
Example: "kamanda auth users set password [UID] --password newPassword",
Example: "kamanda users set password [UID] --password newPassword",
Long: `Reset the password of a Firebase user(s).
You can provide the password or the user or if left empty, Kamanda will automatically generate a password and print it.`,
Expand Down
2 changes: 1 addition & 1 deletion cmd/setCustomClaims.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var customClaimsCmd = &cobra.Command{
Use: "customClaims",
Aliases: []string{"custom-claims", "cc"},
Short: "Add custom claims to an existing firebase user or users through their UIDs",
Example: `kamanda auth users set customClaims [uid1] --customClaims "key1:value1" --customClaims "key2:value2"`,
Example: `kamanda users set customClaims [uid1] --customClaims "key1=value1" --customClaims "key2=value2"`,
Run: func(cmd *cobra.Command, args []string) {
// args = list of uids
if len(args) == 0 {
Expand Down
2 changes: 1 addition & 1 deletion cmd/unsetCustomClaims.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var unsetCustomClaimsCmd = &cobra.Command{
Use: "custom-claims",
Aliases: []string{"customClaims"},
Short: "Unset custom claims from a firebase user account",
Example: "kamanda users unset custom-claims --keys \"role\"",
Example: "kamanda users unset custom-claims --keys \"role\" [UID]",
Run: func(cmd *cobra.Command, args []string) {
keys, _ := cmd.Flags().GetStringArray("keys")
hasError := false
Expand Down
6 changes: 3 additions & 3 deletions cmd/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ var usersCmd = &cobra.Command{
This will display a table you can interact with.
In cases where there are more than 500 users, you will also get a nextPageToken, that you can use to fetch more users.`,
Example: `kamanda auth users
kamanda auth users -o json
kamanda auth users -output yaml`,
Example: `kamanda users
kamanda users -o json
kamanda users -output yaml`,
Run: func(cmd *cobra.Command, args []string) {
output, err := cmd.Flags().GetString("output")
if err != nil {
Expand Down

0 comments on commit f1c8b6f

Please sign in to comment.