forked from Parallels/docker-machine-parallels
-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.go
43 lines (36 loc) · 1.15 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package main
import (
"os"
"path"
"github.com/Parallels/docker-machine-parallels"
"github.com/urfave/cli"
"github.com/docker/machine/libmachine/drivers/plugin"
)
var appHelpTemplate = `This is a Docker Machine plugin for Parallels Desktop.
Plugin binaries are not intended to be invoked directly.
Please use this plugin through the main 'docker-machine' binary.
Version: {{.Version}}{{if or .Author .Email}}
Author:{{if .Author}}
{{.Author}}{{if .Email}} - <{{.Email}}>{{end}}{{else}}
{{.Email}}{{end}}{{end}}
{{if .Flags}}
Options:
{{range .Flags}}{{.}}
{{end}}{{end}}
Commands:
{{range .Commands}}{{.Name}}{{with .ShortName}}, {{.}}{{end}}{{ "\t" }}{{.Usage}}
{{end}}
`
func main() {
cli.AppHelpTemplate = appHelpTemplate
app := cli.NewApp()
app.Name = path.Base(os.Args[0])
app.Usage = "This is a Docker Machine plugin binary. Please use it through the main 'docker-machine' binary."
app.Author = "Parallels IP Holdings GmbH"
app.Email = "https://github.com/Parallels/docker-machine-parallels/"
app.Version = parallels.FullVersion()
app.Action = func(c *cli.Context) {
plugin.RegisterDriver(parallels.NewDriver("", ""))
}
app.Run(os.Args)
}