commands.go 833 B

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