From d39affeba28ac6e2bb25273fa657b092544442d9 Mon Sep 17 00:00:00 2001 From: Maina Wycliffe Date: Tue, 28 Jul 2020 00:29:15 +0300 Subject: [PATCH] Nest Password Command under Set Command This makes abit more usable as compared to the current approach. #17 --- cmd/resetPassword.go | 7 +++---- cmd/set.go | 30 ++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 cmd/set.go diff --git a/cmd/resetPassword.go b/cmd/resetPassword.go index 7b3e744..de0b69b 100644 --- a/cmd/resetPassword.go +++ b/cmd/resetPassword.go @@ -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.`, @@ -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", "", diff --git a/cmd/set.go b/cmd/set.go new file mode 100644 index 0000000..ef231b0 --- /dev/null +++ b/cmd/set.go @@ -0,0 +1,30 @@ +/* +Copyright © 2020 NAME HERE + +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) +}