Skip to content

Commit

Permalink
Subtle fix: update && not required should not prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
cyx committed Mar 20, 2021
1 parent 95f1696 commit 1f9473e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/cli/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ func registerBool(cmd *cobra.Command, f *Flag, value *bool, defaultValue bool, i

func shouldAsk(cmd *cobra.Command, f *Flag, isUpdate bool) bool {
if isUpdate {
if !f.IsRequired {
return false
}

return shouldPromptWhenFlagless(cmd, f.LongForm)
}

Expand Down

0 comments on commit 1f9473e

Please sign in to comment.