add passphrase flag (#4518)

<!-- PR description-->

add `--new-passphrase` flag for `update-passphrase` command  

#### Does this PR need a docs update or release note?

- [ ]  Yes, it's included
- [ ] 🕐 Yes, but in a later PR
- [ ]  No

#### Type of change

<!--- Please check the type of change your PR introduces: --->
- [ ] 🤖 Supportability/Tests

#### Issue(s)

<!-- Can reference multiple issues. Use one of the following "magic words" - "closes, fixes" to auto-close the Github issue. -->
* #<issue>

#### Test Plan

<!-- How will this be tested prior to merging.-->
- [ ] 💪 Manual
- [ ]  Unit test
- [ ] 💚 E2E
This commit is contained in:
neha_gupta 2023-10-17 14:28:05 +05:30 committed by GitHub
parent 02b8a77bdd
commit b4d14cb83f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -76,12 +76,16 @@ func AddCorsoPassphaseFlags(cmd *cobra.Command) {
} }
// M365 flags // M365 flags
func AddCorsoUpdatePassphraseFlags(cmd *cobra.Command) { func AddUpdatePassphraseFlags(cmd *cobra.Command, require bool) {
fs := cmd.Flags() fs := cmd.Flags()
fs.StringVar(&NewPhasephraseFV, fs.StringVar(&NewPhasephraseFV,
NewPassphraseFN, NewPassphraseFN,
"", "",
"update Corso passphrase for repo") "update Corso passphrase for repo")
if require {
cobra.CheckErr(cmd.MarkFlagRequired(NewPassphraseFN))
}
} }
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------

View File

@ -61,6 +61,8 @@ func AddCommands(cmd *cobra.Command) {
flags.AddMaintenanceUserFlag(maintenanceCmd) flags.AddMaintenanceUserFlag(maintenanceCmd)
flags.AddMaintenanceHostnameFlag(maintenanceCmd) flags.AddMaintenanceHostnameFlag(maintenanceCmd)
flags.AddUpdatePassphraseFlags(updatePassphraseCmd, true)
for _, addRepoTo := range repoCommands { for _, addRepoTo := range repoCommands {
addRepoTo(initCmd) addRepoTo(initCmd)
addRepoTo(connectCmd) addRepoTo(connectCmd)