commands: driver management command stubs

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
Tonis Tiigi
2019-04-11 17:24:24 -07:00
parent 4586e0ed18
commit 950180ed82
7 changed files with 254 additions and 0 deletions

41
commands/use.go Normal file
View File

@ -0,0 +1,41 @@
package commands
import (
"fmt"
"github.com/docker/cli/cli"
"github.com/docker/cli/cli/command"
"github.com/spf13/cobra"
)
type useOptions struct {
isGlobal bool
isDefault bool
}
func runUse(dockerCli command.Cli, in useOptions) error {
fmt.Printf("%+v\n", in)
return nil
}
func useCmd(dockerCli command.Cli) *cobra.Command {
var options useOptions
cmd := &cobra.Command{
Use: "use [OPTIONS] NAME",
Short: "Set the current builder instance",
Args: cli.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
return runUse(dockerCli, options)
},
}
flags := cmd.Flags()
flags.BoolVar(&options.isGlobal, "global", false, "Builder persists context changes")
flags.BoolVar(&options.isDefault, "default", false, "Set builder as default for current context")
_ = flags
return cmd
}