mirror of
https://github.com/containers/skopeo.git
synced 2025-04-28 11:14:08 +00:00
58 lines
1015 B
Go
58 lines
1015 B
Go
package main
|
|
|
|
import (
|
|
"os"
|
|
|
|
"github.com/Sirupsen/logrus"
|
|
"github.com/codegangsta/cli"
|
|
"github.com/docker/docker/cliconfig"
|
|
)
|
|
|
|
const (
|
|
version = "0.1.12-dev"
|
|
usage = "interact with registries"
|
|
)
|
|
|
|
func main() {
|
|
app := cli.NewApp()
|
|
app.Name = "skopeo"
|
|
app.Version = version
|
|
app.Usage = usage
|
|
// TODO(runcom)
|
|
//app.EnableBashCompletion = true
|
|
app.Flags = []cli.Flag{
|
|
cli.BoolFlag{
|
|
Name: "debug",
|
|
Usage: "enable debug output",
|
|
},
|
|
cli.StringFlag{
|
|
Name: "username",
|
|
Value: "",
|
|
Usage: "registry username",
|
|
},
|
|
cli.StringFlag{
|
|
Name: "password",
|
|
Value: "",
|
|
Usage: "registry password",
|
|
},
|
|
cli.StringFlag{
|
|
Name: "docker-cfg",
|
|
Value: cliconfig.ConfigDir(),
|
|
Usage: "Docker's cli config for auth",
|
|
},
|
|
}
|
|
app.Before = func(c *cli.Context) error {
|
|
if c.GlobalBool("debug") {
|
|
logrus.SetLevel(logrus.DebugLevel)
|
|
}
|
|
return nil
|
|
}
|
|
app.Commands = []cli.Command{
|
|
inspectCmd,
|
|
layersCmd,
|
|
}
|
|
if err := app.Run(os.Args); err != nil {
|
|
logrus.Fatal(err)
|
|
}
|
|
}
|