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

@@ -10,7 +10,11 @@ import (
"github.com/qdm12/gluetun/internal/constants"
)
func (c *cli) ClientKey(args []string) error {
type ClientKeyFormatter interface {
ClientKey(args []string) error
}
func (c *CLI) ClientKey(args []string) error {
flagSet := flag.NewFlagSet("clientkey", flag.ExitOnError)
filepath := flagSet.String("path", constants.ClientKey, "file path to the client.key file")
if err := flagSet.Parse(args); err != nil {