2020-07-08 16:01:54 +02:00
|
|
|
package logout
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
|
|
|
|
"github.com/docker/api/cli/mobycli"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Command returns the login command
|
|
|
|
func Command() *cobra.Command {
|
|
|
|
cmd := &cobra.Command{
|
|
|
|
Use: "logout [SERVER]",
|
|
|
|
Short: "Log out from a Docker registry or cloud backend",
|
|
|
|
Long: "Log out from a Docker registry or cloud backend.\nIf no server is specified, the default is defined by the daemon.",
|
2020-07-17 16:23:52 +02:00
|
|
|
Args: cobra.MaximumNArgs(1),
|
2020-07-08 16:01:54 +02:00
|
|
|
RunE: runLogout,
|
|
|
|
}
|
|
|
|
|
|
|
|
cmd.AddCommand(AzureLogoutCommand())
|
|
|
|
return cmd
|
|
|
|
}
|
|
|
|
|
|
|
|
func runLogout(cmd *cobra.Command, args []string) error {
|
2020-08-04 17:41:49 +02:00
|
|
|
mobycli.Exec()
|
|
|
|
return nil
|
2020-07-08 16:01:54 +02:00
|
|
|
}
|