commands.go 507 B

12345678910111213141516171819
  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. "cp": cli.CmdCp,
  6. "exec": cli.CmdExec,
  7. "info": cli.CmdInfo,
  8. "inspect": cli.CmdInspect,
  9. "load": cli.CmdLoad,
  10. "login": cli.CmdLogin,
  11. "logout": cli.CmdLogout,
  12. "ps": cli.CmdPs,
  13. "pull": cli.CmdPull,
  14. "push": cli.CmdPush,
  15. "save": cli.CmdSave,
  16. "update": cli.CmdUpdate,
  17. }[name]
  18. }