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

Commit

Permalink
Nest Password Command under Set Command
Browse files Browse the repository at this point in the history
This makes abit more usable as compared to the current approach.

#17
  • Loading branch information
mainawycliffe committed Jul 27, 2020
1 parent 07247b6 commit d39affe
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 4 deletions.
7 changes: 3 additions & 4 deletions cmd/resetPassword.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ import (

// resetPasswordCmd represents the resetPassword command
var resetPasswordCmd = &cobra.Command{
Use: "password",
Aliases: []string{"resetPassword", "reset-password"},
Short: "Reset password for a firebase user(s)",
Use: "password",
Short: "Reset password for a firebase user(s)",
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 Expand Up @@ -41,7 +40,7 @@ You can provide the password or the user or if left empty, Kamanda will automati
}

func init() {
listUsersCmd.AddCommand(resetPasswordCmd)
setCmd.AddCommand(resetPasswordCmd)
resetPasswordCmd.Flags().String(
"password",
"",
Expand Down
30 changes: 30 additions & 0 deletions cmd/set.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
Copyright © 2020 NAME HERE <EMAIL ADDRESS>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
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 cmd

import (
"github.com/spf13/cobra"
)

// setCmd represents the set command
var setCmd = &cobra.Command{
Use: "set",
Short: "Set users details like password",
}

func init() {
listUsersCmd.AddCommand(setCmd)
}

0 comments on commit d39affe

Please sign in to comment.