Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
cyx committed Mar 20, 2021
1 parent 25a1c89 commit 45626d5
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions internal/cli/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ func (f *Flag) RegisterBoolU(cmd *cobra.Command, value *bool, defaultValue bool)
registerBool(cmd, f, value, defaultValue, true)
}

// LOOK
func askFlag(cmd *cobra.Command, f *Flag, value interface{}, isUpdate bool) error {
if shouldAsk(cmd, f, isUpdate) {
return ask(cmd, f, value, isUpdate)
Expand All @@ -96,11 +95,6 @@ func askFlag(cmd *cobra.Command, f *Flag, value interface{}, isUpdate bool) erro
return nil
}

// LOOK
func (f *Flag) label() string {
return fmt.Sprintf("%s:", f.Name)
}

func selectFlag(cmd *cobra.Command, f *Flag, value interface{}, options []string, isUpdate bool) error {
if shouldAsk(cmd, f, isUpdate) {
return _select(cmd, f, value, options, isUpdate)
Expand All @@ -109,14 +103,6 @@ func selectFlag(cmd *cobra.Command, f *Flag, value interface{}, options []string
return nil
}

func shouldAsk(cmd *cobra.Command, f *Flag, isUpdate bool) bool {
if isUpdate {
return shouldPromptWhenFlagless(cmd, f.LongForm)
}

return shouldPrompt(cmd, f.LongForm)
}

func registerString(cmd *cobra.Command, f *Flag, value *string, defaultValue string, isUpdate bool) {
cmd.Flags().StringVarP(value, f.LongForm, f.ShortForm, defaultValue, f.Help)

Expand Down

0 comments on commit 45626d5

Please sign in to comment.