commands.go 670 B

12345678910111213141516171819202122232425
  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. "update": cli.CmdUpdate,
  22. "version": cli.CmdVersion,
  23. }[name]
  24. }