commands.go 695 B

1234567891011121314151617181920212223242526
  1. package client
  2. // Command returns a cli command handler if one exists
  3. func (cli *DockerCli) Command(name string) func(...string) error {
  4. return map[string]func(...string) error{
  5. "build": cli.CmdBuild,
  6. "commit": cli.CmdCommit,
  7. "cp": cli.CmdCp,
  8. "events": cli.CmdEvents,
  9. "exec": cli.CmdExec,
  10. "info": cli.CmdInfo,
  11. "inspect": cli.CmdInspect,
  12. "load": cli.CmdLoad,
  13. "login": cli.CmdLogin,
  14. "logout": cli.CmdLogout,
  15. "ps": cli.CmdPs,
  16. "pull": cli.CmdPull,
  17. "push": cli.CmdPush,
  18. "rm": cli.CmdRm,
  19. "save": cli.CmdSave,
  20. "stats": cli.CmdStats,
  21. "tag": cli.CmdTag,
  22. "update": cli.CmdUpdate,
  23. "version": cli.CmdVersion,
  24. }[name]
  25. }