Maint: cli package interface rework

- return concrete struct type
- split interface is sub-interfaces
This commit is contained in:
Quentin McGaw (desktop)
2021-07-23 18:52:38 +00:00
parent 0b985e8c35
commit d9ca0deb08
6 changed files with 30 additions and 19 deletions

View File

@@ -25,7 +25,11 @@ var (
ErrWriteToFile = errors.New("cannot write updated information to file")
)
func (c *cli) Update(ctx context.Context, args []string, logger logging.Logger) error {
type Updater interface {
Update(ctx context.Context, args []string, logger logging.Logger) error
}
func (c *CLI) Update(ctx context.Context, args []string, logger logging.Logger) error {
options := configuration.Updater{CLI: true}
var endUserMode, maintainerMode, updateAll bool
flagSet := flag.NewFlagSet("update", flag.ExitOnError)