refactor: remove unused code

This commit is contained in:
Wing-Kam Wong 2023-03-19 17:28:02 +08:00
parent 54de75db82
commit daf4922176

View file

@ -21,29 +21,19 @@ type RenameOptions struct {
IO *iostreams.IOStreams
Config func() (config.Config, error)
HttpClient func() (*http.Client, error)
Prompter iprompter
DoConfirm bool
Selector string
OldFileName string
NewFileName string
}
type iprompter interface {
Input(string, string) (string, error)
Confirm(string, bool) (bool, error)
}
func NewCmdRename(f *cmdutil.Factory, runf func(*RenameOptions) error) *cobra.Command {
opts := &RenameOptions{
IO: f.IOStreams,
HttpClient: f.HttpClient,
Config: f.Config,
Prompter: f.Prompter,
}
var confirm bool
cmd := &cobra.Command{
Use: "rename [<id> | <url>] <oldFilename> <newFilename>",
Short: "Rename a file in a gist",
@ -66,8 +56,6 @@ func NewCmdRename(f *cmdutil.Factory, runf func(*RenameOptions) error) *cobra.Co
},
}
cmd.Flags().BoolVarP(&confirm, "yes", "y", false, "Skip the confirmation prompt")
return cmd
}