commands.go 967 B

123456789101112131415161718192021222324252627282930313233343536
  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. "history": cli.CmdHistory,
  11. "images": cli.CmdImages,
  12. "import": cli.CmdImport,
  13. "info": cli.CmdInfo,
  14. "inspect": cli.CmdInspect,
  15. "kill": cli.CmdKill,
  16. "load": cli.CmdLoad,
  17. "login": cli.CmdLogin,
  18. "logout": cli.CmdLogout,
  19. "pause": cli.CmdPause,
  20. "port": cli.CmdPort,
  21. "ps": cli.CmdPs,
  22. "pull": cli.CmdPull,
  23. "push": cli.CmdPush,
  24. "rename": cli.CmdRename,
  25. "restart": cli.CmdRestart,
  26. "rm": cli.CmdRm,
  27. "save": cli.CmdSave,
  28. "stats": cli.CmdStats,
  29. "tag": cli.CmdTag,
  30. "top": cli.CmdTop,
  31. "update": cli.CmdUpdate,
  32. "version": cli.CmdVersion,
  33. "wait": cli.CmdWait,
  34. }[name]
  35. }