working commit
This commit is contained in:
@@ -47,6 +47,7 @@ func (util *AccountUtil) CreateAccountCmds() *cobra.Command {
|
||||
createAccountCmd.Flags().StringVarP(&util.createAccountParams.NewPassword, "newpass", "P", "", "New account password")
|
||||
createAccountCmd.MarkFlagRequired("host")
|
||||
createAccountCmd.MarkFlagsRequiredTogether("newuser", "newpass")
|
||||
createAccountCmd.MarkFlagsRequiredTogether("username", "password")
|
||||
|
||||
subCmd.AddCommand(createAccountCmd)
|
||||
|
||||
@@ -60,8 +61,12 @@ func (util *AccountUtil) CreateAccountCmds() *cobra.Command {
|
||||
getAccountCmd.Flags().StringVarP(&util.getAccountParams.Username, "username", "u", "", "Username")
|
||||
getAccountCmd.Flags().StringVarP(&util.getAccountParams.Password, "password", "p", "", "Password")
|
||||
getAccountCmd.Flags().Uint64VarP(&util.getAccountParams.Timeout, "timeout", "t", defaultTimeout, "Operation timeout")
|
||||
getAccountCmd.Flags().StringVarP(&util.getAccountParams.AccountID, "id", "I", "", "Account ID")
|
||||
getAccountCmd.Flags().StringVarP(&util.getAccountParams.AccountID, "id", "I", "", "Account ID or name")
|
||||
getAccountCmd.Flags().StringVarP(&util.getAccountParams.AccountID, "name", "n", "", "Account ID or name")
|
||||
|
||||
getAccountCmd.MarkFlagRequired("host")
|
||||
getAccountCmd.MarkFlagsOneRequired("id", "name")
|
||||
getAccountCmd.MarkFlagsRequiredTogether("username", "password")
|
||||
|
||||
subCmd.AddCommand(getAccountCmd)
|
||||
|
||||
@@ -75,11 +80,13 @@ func (util *AccountUtil) CreateAccountCmds() *cobra.Command {
|
||||
updateAccountCmd.Flags().StringVarP(&util.updateAccountParams.Password, "password", "p", "", "Password")
|
||||
updateAccountCmd.Flags().StringVarP(&util.updateAccountParams.Hostname, "host", "x", "", "File path")
|
||||
updateAccountCmd.Flags().Uint64VarP(&util.updateAccountParams.Timeout, "timeout", "t", defaultTimeout, "Operation timeout")
|
||||
updateAccountCmd.MarkFlagRequired("host")
|
||||
|
||||
updateAccountCmd.Flags().StringVarP(&util.updateAccountParams.AccountID, "id", "I", "", "Account ID")
|
||||
updateAccountCmd.Flags().StringVarP(&util.updateAccountParams.AccountID, "id", "I", "", "Account ID or username")
|
||||
updateAccountCmd.Flags().StringVarP(&util.updateAccountParams.AccountID, "name", "n", "", "Account ID or username")
|
||||
updateAccountCmd.Flags().StringVarP(&util.updateAccountParams.NewUsername, "newuser", "U", "", "New username")
|
||||
updateAccountCmd.Flags().StringVarP(&util.updateAccountParams.NewPassword, "pass", "P", "", "New password")
|
||||
updateAccountCmd.MarkFlagRequired("host")
|
||||
updateAccountCmd.MarkFlagsOneRequired("id", "name")
|
||||
|
||||
subCmd.AddCommand(updateAccountCmd)
|
||||
|
||||
@@ -93,9 +100,12 @@ func (util *AccountUtil) CreateAccountCmds() *cobra.Command {
|
||||
deleteAccountCmd.Flags().StringVarP(&util.deleteAccountParams.Password, "password", "p", "", "Password")
|
||||
deleteAccountCmd.Flags().StringVarP(&util.deleteAccountParams.Hostname, "host", "x", defaultHostname, "Hostname")
|
||||
deleteAccountCmd.Flags().Uint64VarP(&util.deleteAccountParams.Timeout, "timeout", "t", defaultTimeout, "Operation timeout")
|
||||
deleteAccountCmd.MarkFlagRequired("host")
|
||||
|
||||
deleteAccountCmd.Flags().StringVarP(&util.deleteAccountParams.AccountID, "id", "I", "", "Account ID")
|
||||
deleteAccountCmd.Flags().StringVarP(&util.updateAccountParams.AccountID, "name", "n", "", "Account ID or username")
|
||||
deleteAccountCmd.MarkFlagRequired("host")
|
||||
deleteAccountCmd.MarkFlagsOneRequired("id", "name")
|
||||
deleteAccountCmd.MarkFlagsRequiredTogether("username", "password")
|
||||
|
||||
subCmd.AddCommand(deleteAccountCmd)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user