From 45626d54617f519be1404b795d3199b0945053db Mon Sep 17 00:00:00 2001 From: Cyril David Date: Sat, 20 Mar 2021 10:15:16 -0700 Subject: [PATCH] Cleanup --- internal/cli/flags.go | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/internal/cli/flags.go b/internal/cli/flags.go index 66f1b60bc..532e9018c 100644 --- a/internal/cli/flags.go +++ b/internal/cli/flags.go @@ -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) @@ -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) @@ -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)