logout.go 597 B

1234567891011121314151617181920212223242526
  1. package logout
  2. import (
  3. "github.com/spf13/cobra"
  4. "github.com/docker/api/cli/mobycli"
  5. )
  6. // Command returns the login command
  7. func Command() *cobra.Command {
  8. cmd := &cobra.Command{
  9. Use: "logout [SERVER]",
  10. Short: "Log out from a Docker registry or cloud backend",
  11. Long: "Log out from a Docker registry or cloud backend.\nIf no server is specified, the default is defined by the daemon.",
  12. Args: cobra.MaximumNArgs(1),
  13. RunE: runLogout,
  14. }
  15. cmd.AddCommand(AzureLogoutCommand())
  16. return cmd
  17. }
  18. func runLogout(cmd *cobra.Command, args []string) error {
  19. mobycli.Exec()
  20. return nil
  21. }